How to get Custom Options Programmatically in Magento

前端 未结 7 2194
天涯浪人
天涯浪人 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:55

    I hope it will useful to you for get only Custom Dropdown values in Product page

    Just paste the following code in this file at last

    app/design/frontend/base/default/template/catalog/product/view/options.phtml

    load($this->getProduct()->getId()); //product id
        foreach ($product->getOptions() as $_option) {
            $values = $_option->getValues();
            foreach ($values as $v) {
                print_r($v->getTitle());
                echo "
    "; } } ?>

提交回复
热议问题