If you go to pretty much any e-commerce site you will see in the header your quick cart details, these will consist of how many items are in your basket and how much your current total is. By default Magento only shows you how many items are currently in your basket and no total. As a store owner you want to give your customers as much detail as possible and knowing how much they are spending on your site is something the customer may want to know without having to go to their basket to see their current total.
The solution below shows you how to add the price total of the basket to your basket details; this is a really easy and quick solution. Firstly navigate toyourtemplatename/page/html/header.phtml and copy the code below to where you want it displayed.
<?php $count = $this->helper('checkout/cart')->getSummaryCount(); //get total items in cart $total = $this->helper('checkout/cart')->getQuote()->getGrandTotal(); //get total price echo $this->__(' Total: %s', $this->helper('core')->formatPrice($total, false)); ?>
That’s it, you will now be able to add products to your site and see the basket totals update in your header. Don’t forget to refresh your cache if you don’t see this code working.
相关推荐
magento处理不同的头部header
Chapter 3, Enabling Performance in Magento 2, explains how to configure different types of caching options. In Magento 2, the Full Page Cache (FPC) can be handled by Varnish to give your store a ...
Chapter 3, Enabling Performance in Magento 2, explains how to configure different types of caching options. In Magento 2, the Full Page Cache (FPC) can be handled by Varnish to give your store a ...
Ajax-magento2-ajax-cart.zip,ajax add to cart for extension magento 2提供了通过ajax弹出窗口将产品添加到购物车的主要功能。它通过允许客户从产品列表页面将任何产品类型添加到购物车,显著改善了用户体验。,...
You’ll start by getting a general understanding of what Magento is, why and how you should use it, and whether it is possible and feasible to migrate from an old web store to Magento 2. As you work ...
magento入门原版书.。。The Definitive Guide to Magento.pdf
Apress.The.Definitive.Guide.to.Magento.Dec.2009.pdf Apress于2009重磅推出的Magento上手书籍,原书地址:http://www.apress.com/book/view/9781430272298
Ajax-Magento-ajax-add-to-cart.zip,[模块magento 1]magento ajax添加到购物车-ajoter vos produits au panier en ajax/感谢ajax将您的产品添加到购物车,ajax代表异步javascript和xml。它是多种web技术的集合,包括...
Interspire_shopping cart ,国外注明外贸商城软件,傻瓜式PHP程序!懂php程序就可以进行二次开发!同magento(麦进斗)等国外商城软件同类!
Ajax-magento2-ajax-cart-quick.zip,magento 2 ajax购物车扩展插件提供舒适的购物体验。客户可以很容易地选择可配置的选项并在弹出窗口中编辑项目,而不会浪费重新加载页面的时间。,ajax代表异步javascript和xml。它...
NULL 博文链接:https://justcoding.iteye.com/blog/1886183
NULL 博文链接:https://justcoding.iteye.com/blog/1711166
magento数据结构分析 magento数据字典
magik shoes magento 模板, magento 1.7 模板
magento的SMTP插件magento的SMTP插件magento的SMTP插件
magento 限时促销插件,实现倒计时等功能
深入理解Magento 由精东博客下载下来制作成pdf
Get a hands-on introduction to custom shipping and payment methods ☆ 出版信息:☆ [作者信息] Branko Ajzele [出版机构] Packt Publishing [出版日期] 2013年09月25日 [图书页数] 128页 [图书语言] 英语...
magento2-custom-header