magento购物车页面加入数量总计
2010-08-25 16:36:53.0
打开magento的购物车页面,发现没有数量总计,我记得好像有的....
不知道是不是哪次给删除掉了...
我们找到
template/checkoout/cart/totals.phtml
发现有这样一段php代码
<?php echo $this->renderTotals('footer'); ?>
本来想跑这个block中去加的..一进去就出不来了,这是我最怨恨magento的地方....
然后再网上淘到一个magento的帮助类可以获取购物车页面的商品总量
Mage::helper('checkout/cart')->getCart()->getSummaryQty()
能得到购物车中的商品数量就OK了。。
最后的代码是
<tfoot>
<?php echo $this->renderTotals('footer'); ?>
<tr>
<td colspan="1" class="a-right cart-points-total_earned">
<div class="caption">总数</div>
</td>
<td class="a-right cart-points-total_earned" style="">
<span class="price" style="text-align: center;">
<?php echo Mage::helper('checkout/cart')->getCart()->getSummaryQty();?> </span>
</td>
</tr>
</tfoot>
终于能显示购物车商品总数了
文章作者:POPO4J
本文地址:http://www.popo4j.com/magento/magento__cart_page_adding_the_number_of_total.html
版权所有 © 转载时必须以链接形式注明作者和原始出处!