我已通过以下代码将顶部链接中的文本“我的购物车”更改为“我的购物袋”。
public function addCartLink()
{
$parentBlock = $this->getParentBlock();
if ($parentBlock && Mage::helper('core')->isModuleOutputEnabled('Mage_Checkout')) {
$count = $this->getSummaryQty() ? $this->getSummaryQty()
: $this->helper('checkout/cart')->getSummaryCount();
if ($count == 1) {
$text = $this->__('My Shopping Bag (%s)', $count);
} elseif ($count > 0) {
$text = $this->__('My Shopping Bag (%s)', $count);
} else {
$text = $this->__('My Shopping Bag');
}
$parentBlock->removeLinkByUrl($this->getUrl('checkout/cart'));
$parentBlock->addLink($text, 'checkout/cart', $text, true, array(), 50, null, 'class="top-link-cart"');
}
return $this;
}
现在,我想将标签应用于购物车数量。所以,我的购物袋 0.0(数量)应该是红色的。所以我该怎么做?