Magento - How to get cart items total in header.phtml

前端 未结 7 1312
孤街浪徒
孤街浪徒 2021-02-05 12:11

I am using Magento eCommerce and I have modified my header.phtml via the Blank template. Code, this is my code but it shows blank.

 

        
7条回答
  •  野性不改
    2021-02-05 12:50

    You can find your cart template here:

    YOURSITE/app/design/frontend/YOURTHEME/default/template/checkout/cart/minicart.phtml
    

    Within a span with the class of .count you'll see this snippet:

    
    

    Replace it with this snippet and you'll get the grand total displayed instead:

    helper('checkout')->formatPrice(Mage::getSingleton('checkout/cart')->getQuote()->getGrandTotal()); ?>
    

提交回复
热议问题