【发布时间】:2013-09-20 19:52:24
【问题描述】:
我正在开发我的第一个 magento 网站,但与 opencart 之类的东西有些不同,但我只是想学习新东西,我决定使用 magento 并更加努力地尝试,但是有一件事我卡住了并且是这个,我用这个来调用我的购物车元素:
<div class="cart">
<?php
$count = $this->helper('checkout/cart')->getSummaryCount(); //get total items in cart
$total = $this->helper('checkout/cart')->getQuote()->getGrandTotal(); //get total price
if($count==0)
{
echo $this->__('0 Items: %s',$count);
}
if($count==1)
{
echo $this->__(' Item: %s',$count);
}
if($count>1)
{
echo $this->__(' Items: %s',$count);
}
echo $this->__(' Total: %s', $this->helper('core')->formatPrice($total, false));
?>
</div>
</div>
这会打印出以下内容:
(购物车图标图像)项目:1 总计:24.95 美元
但是没有链接到购物车,有没有办法,使用上面的代码,修改它作为一个链接?
【问题讨论】:
标签: magento hyperlink shopping-cart