- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2018
07:26 AM
09-03-2018
07:26 AM
Hi,
I created one bundle product, in bundle items I created one checkbox option with three products, ids 5,6 and 7.
In the frontend It have some values assigned to them, 13, 14, 15.
I want to get by ajax the product id selected, but I don't know how to do that with the value.
any idea?
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2018
12:42 AM
09-04-2018
12:42 AM
ok, I have the answer:
$product = Mage::getModel('catalog/product')->load($mainProductId); $selections = $product->getTypeInstance(true) ->getSelectionsCollection($product->getTypeInstance(true) ->getOptionsIds($product), $product); foreach ($selections as $selection) { $bundleIds[$selection->getData('selection_id')] = array( 'product_id' => $selection->getId(), 'selection_qty' => $selection->getData('selection_qty') ); }
I put the value of the option in the key of the array to get it easely
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2018
12:42 AM
09-04-2018
12:42 AM
ok, I have the answer:
$product = Mage::getModel('catalog/product')->load($mainProductId); $selections = $product->getTypeInstance(true) ->getSelectionsCollection($product->getTypeInstance(true) ->getOptionsIds($product), $product); foreach ($selections as $selection) { $bundleIds[$selection->getData('selection_id')] = array( 'product_id' => $selection->getId(), 'selection_qty' => $selection->getData('selection_qty') ); }
I put the value of the option in the key of the array to get it easely