0

I understand and have experimentally confirmed on magento1 version 1.9.1.0, that once you create a bundled product, you cannot change the pricing type (from dynamic to fixed, or vice versa).

I have a bundled product on fixed pricing.

Is there a method call to obtain the dynamic pricing anyway?

It wouldn't be getPrice(), since that will smartly grab the price that the product type that it is set to.

It seems there would be a way. Is re-creating a dynamically priced version of the bundled product the only way?

1

There is no single method, but it's still possible to calculate the would-be dynamic price with code by loading the products for given bundle option ids.

You can retrieve the products with Mage_Bundle_Model_Product_Type::getSelectionsByIds():

$bundle->getTypeInstance()->getSelectionsByIds($selectionIds);

where $selectionIds is an array of selection ids (you can retrieve them from the form inputs on the bundle page, or in case of a bundle that's already configured (like during or after "add to cart"):

$customOption = $bundle->getCustomOption('bundle_selection_ids');
$selectionIds = unserialize($customOption->getValue());

Then sum up the results of $product->getFinalPrice() of all selections (take qtys into account if you have them).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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