How to get Custom Options Programmatically in Magento

前端 未结 7 2206
天涯浪人
天涯浪人 2020-12-09 05:20

I have a couple products at checkout that I need to be able to get all of the custom options that are selected for them through code.

Any help is much appreciated! <

7条回答
  •  不知归路
    2020-12-09 05:37

    You can try this code in template/checkout/cart/item/default.php:

    if($Product->hasOptions)
                {
                    $optionsArr = $Product->getOptions();
                     foreach ($optionsArr as  $optionKey => $optionVal)
                    {
                              $optStr.= "";
                        }
       echo($optStr ); 
                }
    

提交回复
热议问题