Magento – Bundle product with custom options

bundle-productcustom-options

Does anyone know any technical reasons as why bundle products with dynamic pricing cannot have custom options?

Best Answer

It seems like this is a limitation with Magento.

There is a discussion on their forum visible over here:

Custom Options on a Bundle Product

The solution is:

As a quick solution to add Custom Options to bundled products with dynamic prices you may try to tweak prepareProductSave method in app/code/core/Mage/Bundle/Model/Observer.php, namely just comment some code out as follows:

/*
    if ($product->getPriceType() == '0' && !$product->getOptionsReadonly()) {
        $product->setCanSaveCustomOptions(true);
        if ($customOptions = $product->getProductOptions()) {
            foreach (array_keys($customOptions) as $key) {
                $customOptions[$key]['is_delete'] = 1;
            }
            $product->setProductOptions($customOptions);
        }
    }
*/ 

To get rid of “Bundle with dynamic pricing cannot include custom defined options. Options will not be saved.” message you should hack app/design/adminhtml/default/default/template/catalog/product/edit/options.phtml template

//show error message
/*
if ($('price_type')) {
if ($('price_type').value == '0' && $('dynamic-price-warrning')) {
    $('dynamic-price-warrning').show();
}
}
*/ 

Obviously this should only be done via local override (i.e do NOT mess with the core files as they mention) to preserve upgradeability

Related Topic