我对Magento中的其中一个产品有定价设置。有没有办法将“每个321.60美元购买2”改为“每个购买321美元2-4美元”和“每个205.52美元购买5美元”?这并不总是这些数字(可能是“买3-4”或什么的)。
0
A
回答
1
对于方法的价格显示逻辑位于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}
。
1
快速修复上面的代码(它在1.7.0.2中对我来说工作不正常) $ _qty对于所有修补程序所在的层将保持不变。
<?php
$_format = 'Buy %1$s for %2$s each';
if($index === count($_tierPrices) - 1)
{
$_format = 'Buy %1$s+ for %2$s each';
}
else
{
$i = $i + 1;
$_next = $_tierPrices[$index + $i];
$_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']);
?>
相关问题
- 1. 更改产品标签Magento
- 2. Magento出口产品问题
- 3. Magento的Configuarble产品问题
- 4. magento产品描述unclosed html标签
- 5. Magento显示空的分组产品
- 6. Magento中的分组产品getFinalPrice行为
- 7. Magento 2分组产品导入
- 8. Magento产品变更结构元标题
- 9. 批量更换magento产品标题
- 10. Magento的产品元标题不填充
- 11. Magento - 获取分组产品的所有关联产品
- 12. Magento:在分组产品中获取产品网址
- 13. Magento产品目录过滤器问题
- 14. Magento缺货产品SEO问题
- 15. Magento产品列表排序问题
- 16. Magento 1.7产品重新导入问题
- 17. 导出产品时出现问题Magento
- 18. Magento产品制造商问题
- 19. Magento - List产品分类
- 20. Magento:将产品(分组)分类到构建它的所有简单产品
- 21. Magento Reindex产品
- 22. 将简单产品链接到列在Magento分组产品下的页面
- 23. 如何检索产品的标签(SQL问题)
- 24. Magento,如何从分组产品中获取价格数组?
- 25. Prestashop - 特色产品标签
- 26. Shopify当前产品标签
- 27. 产品循环标签woocommerce
- 28. 产品带有标签,带标签如何访问关系
- 29. 可以为分组产品创建分组产品?
- 30. Magento的1.7产品图像导入未分配图像产品