Magento get cart single item price incl. tax

前端 未结 6 2220
傲寒
傲寒 2021-02-14 15:45

I have a pretty weird issue, I hope someone can help me with this.

Here are the major config settings that influence my problem:

  • Catalog prices in admin pa
6条回答
  •  死守一世寂寞
    2021-02-14 16:10

    show the quantity of a cart in my header

    if ($parentBlock = $this->getParentBlock()) {
    $count = $this->helper('checkout/cart')->getSummaryCount();
    if( $count == 1 ) {
    echo $text = $this->__('My Cart (%s item)', $count);
    } elseif( $count > 0 ) {
    echo $text = $this->__('My Cart (%s items)', $count);
    } else {
    echo $text = $this->__('My Cart (0 items)');
    }
    }
    

    show the total price of a cart in my header

    $grandTotal = $this->helper('checkout/cart')->getQuote()->getGrandTotal();
    echo $text .= $this->__(' Total: %s', $this->helper('core')->formatPrice($grandTotal, false));
    

提交回复
热议问题