0

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.

1 Answer 1

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.