如何在购物车页面 magento 的特价旁边添加 "final sale"
How to add "final sale" next to special price in cart page magento
我想在购物车页面的特价旁边添加 "final sale" 促销商品。
我添加了
<span class="price-label"><?php echo $this->__('Final Sale') ?></span>
在
template/checkout/cart/item/default.phtml
但我正在为购物车页面中的所有商品进行最终销售。
我只想为销售商品添加最终销售。
我该怎么做?
使用内联翻译。
通过系统 -> 配置 -> 开发人员 -> 内联翻译打开它。
您可以通过单击它并将单词更改为 "Final Sale" 来更改其内容。
您实际上可以通过观察者来做到这一点。要使用的事件是 core_block_abstract_to_html_after
然后你可以得到那个块的 html 与:
$transport = $observer->getTransport();
$html = $transport->getHtml();
// do some stuff here to determine which items you need to edit the label for.
// after editing the label, maybe with DomDocument and xpath, set the new html at the end
// of your observer like so:
$transport->setHtml($html);
我一直使用这种方法,因为我讨厌在更改很小的时候修改模板文件。
我想在购物车页面的特价旁边添加 "final sale" 促销商品。 我添加了
<span class="price-label"><?php echo $this->__('Final Sale') ?></span>
在
template/checkout/cart/item/default.phtml
但我正在为购物车页面中的所有商品进行最终销售。
我只想为销售商品添加最终销售。
我该怎么做?
使用内联翻译。
通过系统 -> 配置 -> 开发人员 -> 内联翻译打开它。
您可以通过单击它并将单词更改为 "Final Sale" 来更改其内容。
您实际上可以通过观察者来做到这一点。要使用的事件是 core_block_abstract_to_html_after
然后你可以得到那个块的 html 与:
$transport = $observer->getTransport();
$html = $transport->getHtml();
// do some stuff here to determine which items you need to edit the label for.
// after editing the label, maybe with DomDocument and xpath, set the new html at the end
// of your observer like so:
$transport->setHtml($html);
我一直使用这种方法,因为我讨厌在更改很小的时候修改模板文件。