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,以及这一过程背后的逻辑和技术细节。 ### Magento处理不同头部Header的核心概念 #### 1. **布局(Layout)系统** Magento的布局系统是其核心特性之一,它允许...
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权威指南 #### 书籍概述 《Magento权威指南》是由Adam McCombs与Robert Banh共同编著的一本深入探讨Magento电商平台的技术手册。该书由Apress出版社于2009年出版发行,旨在为读者提供一个全面、系统的...
Magento是一款强大的开源电子商务平台,它提供了丰富的功能和高度的可定制性。在Magento中创建自定义页面是一项常见的任务,这通常涉及到对系统架构的理解、模板文件的编辑以及URL的配置。在这个实例中,我们将深入...
Magento是一款强大的开源电子商务平台,它的后台管理系统非常灵活且可扩展。在Magento的后台菜单中插入动态菜单是一项常见的自定义需求,这有助于商家根据自身业务需求定制管理界面。本篇文章将详细解析如何在...
### Magento 全面指南知识点概览 #### 一、引言 《Magento全面指南》是电子商务平台Magento的权威参考书籍,由Adam McCombs与Robert Banh共同编写。本书不仅适用于初学者,对于有一定经验的开发者和技术人员也同样...
Ajax-Magento-ajax-add-to-cart.zip,[模块magento 1]magento ajax添加到购物车-ajoter vos produits au panier en ajax/感谢ajax将您的产品添加到购物车,ajax代表异步javascript和xml。它是多种web技术的集合,包括...
### Magento 限时促销插件——Price Countdown #### 一、插件概述 Magento是一款非常流行的电子商务平台,提供了丰富的功能和高度可定制性,使得商家能够根据自己的需求搭建理想的在线商店。其中,限时促销是吸引...
这里,`/path/to/source/magento/`是源站点的Magento根目录,`/path/to/destination/`是目标服务器的目录。 在新服务器上安装MySQL,并导入先前备份的数据库: ```bash mysql -u [new_username] -p[new_password] ...
这篇博客“Magento:后台添加预览按钮 View product in frontend from Magento admin”主要探讨了如何通过自定义开发来实现这一功能,让管理员能够快速检查商品在网站前台的显示状态。 在Magento中,通常管理员需要...
标签"cart shopping"指向了Magento的核心功能之一——购物车系统。Magento的购物车支持多产品添加、数量调整、优惠券应用、税费计算等功能,为顾客提供便捷的在线购物体验。同时,它还提供了结账流程的自定义,可以...
Ajax-magento2-ajax-cart-quick.zip,magento 2 ajax购物车扩展插件提供舒适的购物体验。客户可以很容易地选择可配置的选项并在弹出窗口中编辑项目,而不会浪费重新加载页面的时间。,ajax代表异步javascript和xml。它...
9. **Magent对比**:Interspire Shop Cart常被提及与Magento比较,Magento是另一款流行的开源电商解决方案。两者在功能、扩展性和社区支持上各有优势,选择哪一个取决于具体业务需求。 10. **二次开发**:对于懂PHP...
“HOW TO SETUP ADVANCED PROFILE IN MAGENTO.pdf”文档详细阐述了如何在Magento中设置高级导入导出配置。这份指南通常会涵盖以下步骤: 1. 登录Magento后台,找到“System”菜单下的“Data Transfer”选项。 2. ...