Magento Grouped Products – Simple Products with Custom Options

custom-optionsgrouped-productsmagento-1.8products-management

I hope someone can help or knows of an extension that adds the functionality I require.

I have multiple simple products that each have their own custom options.

I then need to add these simple products to a bundled product. Magento out of the box only allows simple products without custom options to be added.

Best Answer

I managed to allow custom options on bundle products by using the following code (it does edit some core files and there are a few paid extensions that achieve similar functionality):

Edit for file 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();
    }
}
*/

I found this in the following thread on Magento's forums: http://www.magentocommerce.com/boards/viewthread/14910/P15/#t208213

I then required defaults to be set for the custom option on bundle products (and other products that used listed options) and used this extension to implement the functionality: https://github.com/magebuzz/Magebuzz_Customoption

Related Topic