Add custom options programmatically to associated products

by Vivek Shahi   Last Updated July 11, 2018 23:09 PM

I have been working on showing custom options of simple product for grouped product. I am done with initial phase of allowing required custom option product and then showing it on frontend. I have modified checkout/cart/add to add products with custom option to cart. This is also working fine. But I see products are being added twice to cart. Once with custom option and another one without custom option. I have debugged app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php . Here, protected function _prepareProduct(Varien_Object $buyRequest, $product, $processMode) is responsible for adding product to cart. I tried adding custom option values of products from here. But couldn't succeed.

Note:- Here I am not trying to create new custom options. I just want to set the values of custom option.

Any help will be appreciated. Thanks in advance.



Related Questions




Product Setup with Fishbowl on Magento 1.9

Updated February 28, 2017 05:09 AM

Custom PHP function (in modified Grouped Product)?

Updated March 28, 2018 18:09 PM