Programmatically add Bundle Products in Magento, using the SKU / ID of Simple Items

后端 未结 3 1209
说谎
说谎 2020-12-09 06:27

I have some simple catalog products in Magento, so I have their SKUs & IDs. Now I want to create a Bundled product using the array elements \"bundle_options\" & \"bu

3条回答
  •  心在旅途
    2020-12-09 07:33

             $MyOptions[0] = array (
                'title' => 'My Bad','default_title' => 'My Bad',
                'delete' => '',
                'type' => 'radio',
                'required' => 0,
                'position' => 0
            );
    

    or

    $optionModel = Mage::getModel('bundle/option') ->addSelection('op111') ->setTitle('op111') ->setDefaultTitle('op111') ->setParentId($product_id) ->setStoreId($product->getStoreId()); $optionModel->save();

提交回复
热议问题