以下のコードを使用して、トップ リンクのテキストを [マイ カート] から [マイ ショッピング バッグ] に変更しました。
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;
}
次に、ショッピング カートの数量にタグを適用します。そのため、My Shopping Bag 0 のように表示されます。0 (数量) は赤色である必要があります。それで、私は何をすべきですか?