Magento分组产品标签问题 [英] Magento grouped products label question
问题描述
我在Magento中为我的一种产品设置了分层定价.是否可以将以$ 321.60的价格购买2个"改为以$ 321.60的价格购买2-4"和以$ 205.52的价格购买5+"的任何方法?并非总是这些数字(可以是"Buy 3-4"(购买3-4)或类似的数字).
I have tier pricing setup for one of my products in Magento. Is there any way to change the "Buy 2 for $321.60 each" to "Buy 2-4 for $321.60 each" and "Buy 5+ for $205.52 each"? It won't always be these numbers (could be "Buy 3-4" or something).
推荐答案
分层价格的显示逻辑位于app/design/frontend/watercare/default/template/catalog/product/view/tierprices.phtml
The display logic for tier prices is located in app/design/frontend/watercare/default/template/catalog/product/view/tierprices.phtml
将最后一个else
块替换为:
<?php
$_format = 'Buy %1$s for %2$s each';
if($index === count($_tierPrices) - 1)
{
$_format = 'Buy %1$s+ for %2$s each';
}
else
{
$_next = $_tierPrices[$index + 1];
$_qty = $_next['price_qty'] - 1;
if($_qty > 0) $_format = 'Buy %1$s-' . $_qty . ' for %2$s each';
}
echo $this->__($_format, $_price['price_qty'], $_price['formated_price']);
?>
这将确保最后一级的价格始终为{num}+
,之前的价格始终为
2 - {num - 1}
.
This will make sure that the last tier price will always be {num}+
and the ones before it will be
2 - {num - 1}
.
这篇关于Magento分组产品标签问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!