Show Total Pricing On Header

Last modified by jharoonalishah on Thu, November 6, 2008 02:05
Source|Old Revisions  |  Back To Group

I am going to show the total price above the links in the header section shows in the figure. You can found the link view file in location (if you are developing on your local machine)

http://localhost/your_magento_root_directory/app/design/frontend/your_interface/your_theme/template/page/template/links.pthml

Okay now that you have links.phtml file open create an object of class Mage_Checkout_Block_Cart_Sidebar

$priceObj = new Mage_Checkout_Block_Cart_Sidebar();

Now the $priceObj will hold all the necessary methods to show the price.

First we well save the the total quantity been purchased by the users in a variable called $cartQty and total price in $cartTotal.

$cartQty = $priceObj→getSummaryCount(); $cartTotal = $priceObj→getSubtotal();

Finally show them in a nicely styled div tag.

One final tip. if you want to format the price use a helper method like this

Mage::helper(’checkout’)→formatPrice($cartTotal);

It will format price nice and clean.

Keep watching for more wiki.

Have a nice day.

jharoonalishah@yahoo.com




 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs