0

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?

1 Answer 1

0

ok, the answer came from @APPSeCONNECT

but, to put it on my own use:

$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 access it faster

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.