Question

I've been trying to send the SKU of the product from the product page to another page so I can integrate it with an API.

Here's my code phtml code: PHTML Code

Here's my Controller code:

Controller

For some reason I can't seem to get my SKU across so I can receive it on the other side? can someone please enlighten me as to what I'm doing wrong?

P.S. ignore comments and naming, I remove the former and change the latter later.

Was it helpful?

Solution

As I can see you did well.

As per Magento coding following are the 2 way to get post value.

  1. $this->getRequest()->getPostValue('monkey');
  2. $this->getRequest()->getPost('monkey');

Please check both the way and let me know if any.

If this helps to build your login then hit like.

Enjoy your coding!!! :)

Hiren Patel

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top