1

Assume that you are going to add a product which has custom options. So when you add that product to the shopping cart, where will the magento save those custom option's values persistently?

Any suggestions will be appreciated.

4

The selected options are stored in the table:

sales_flat_quote_item_option

When the quote is converted to an order the info_buyRequest data is transferred to the field product_options in the sales_flat_order_item table.

11

Further to the answer provided by Vladimir Kerkhoff,

Example code to retrieve the information:

if ($item instanceof Mage_Sales_Model_Quote_Item) {
            $infoBuyRequest = $item->getOptionByCode('info_buyRequest');
            $buyRequest = new Varien_Object(unserialize($infoBuyRequest->getValue()));
        } else if ($item instanceof Mage_Sales_Model_Order_Item) {
            $buyRequest = new Varien_Object($item->getProductOptions());
}

You can then access the data via the $buyRequest object created.

  • Is there any way to get the price of the custom options selected from the buyrequest ? – Giuseppe Mar 17 '15 at 14:32

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.