6

I am using a plugin to enable notify me (Out of stock) feature, the plugin is working properly but the problem is it is taking the core product id and storing it in the backend, even after I select a different color and size.

For example, if I have Product with the product id 82 and SKU code GEN26, even if I select a product with color green and size medium with SKU code GEN26GRMED and product id 84 and click on notify me button it is still storing the old product id 82 in the backend.

For now, I can see they are echoing the id using $_product->getId(), how can I dynamically get the product id of the product of the color and size I have selected so that I can know for which particular product customer have clicked notify me button.

5
  • 2
    Not being part of the Magento core it's likely that a very few know and have that plugin. But just because it's a commercial extension which hopefully comes with support, why don't you ask this question to the extension developer? Commented May 27, 2016 at 6:30
  • @AlessandroRonchi Hi, I tried but didn't get a reply, all I want to know is how can i get the id of the product variant that I select dynamically. I don't know much about magento as I am newbie here. Commented May 27, 2016 at 6:33
  • 1
    If you did different attempts to contact the developer and you never received a reply, please inform Magento about that. It can be useful for other potential customers and the whole ecosystem would benefit from that. About your problem: you, the only one who has access to the code (pay attention not to disclose a commercial code) have to identify in which way the extension gets the product ID and change it with the selected variant. It's likely that some JavaScript is or should be used. Commented May 27, 2016 at 6:49
  • On product page phtml file,simply pass child product id rather than parent id .
    – akgola
    Commented Oct 27, 2017 at 7:33
  • Check this, magento.stackexchange.com/a/209940/59677 , I have answered here to get a simple product id based on selection. Commented Dec 28, 2019 at 8:36

1 Answer 1

0

You need to change method where $_product->getId() is called. In some product types you need to get selected simple productID. Please, look if you can write some javascript to pass selected product id value to the controller.

PD: Need more information about the extesion used

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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