Magento – How to get the product id and SKU code of the product selected

magento-1notify-meproductproduct-attributesku

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.

Best Answer

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