简体   繁体   中英

How to get custom option value in magento 1.9.3?

How to get custom option value in magento 1.9.3? my code is below but not working pls help me

 $helper   = Mage::helper('catalog/product_configuration');
 print_r($helper->getCustomOptions());

use below code i think help you

$helper   = Mage::helper('catalog/product_configuration');
$items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems(); 
$wt=0;
foreach($items as $item){  
    $categories_array = $item->getProduct()->getCategoryIds(); 

    $_options = $helper->getCustomOptions($item);
    foreach ($_options as $_option) {
        $value = $this->htmlEscape($_option['value']);
        $weigth=preg_replace("/[^0-9,.]/","", $value);
        echo $wt+= $weigth;
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM