2016-11-23 63 views

回答

0

使用我想幫助你

$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; 
    } 
} 
相關問題