Magento - Get Custom Option Value details from Option Value ID

前端 未结 4 1715
余生分开走
余生分开走 2021-02-02 15:31

I have some intriguing questions related to Custom Options of Product:-

  1. Is there any difference between Options & Custom Options? This is because I have foun

4条回答
  •  生来不讨喜
    2021-02-02 16:24

    $session= Mage::getSingleton('checkout/session');
    $getotal = Mage::helper('checkout')->getQuote()->getGrandTotal();
    foreach($session->getQuote()->getAllItems() as $item)
    {
    $options = Mage::getModel('catalog/product')->load($item->getProduct()->getId())->getProductOptionsCollection();
        foreach ($options as $o) 
        { 
            $title = $o->getTitle();
            $values = $o->getValues();
    
            foreach($values as $v)
            {
            $mydata = $v->getPrice();                           
            }
    
        }
    }
    

    You can use this code in order to get price set for custom options for products in shopping cart.

提交回复
热议问题