如果产品页面上存在分层定价,则隐藏Magento正价 [英] Hide Magento Regular Price if tiered pricing exists on product page

查看:36
本文介绍了如果产品页面上存在分层定价,则隐藏Magento正价的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仅在产品具有分层定价的情况下,我试图弄清楚如何在产品页面上隐藏常规价格.任何提示将不胜感激.

I am trying to figure out how to hide the regular price on a product page only if tiered pricing exists for the product. Any tips would be gratefully appreciated.

我一直在研究以下代码,以便在分层定价时有条件地显示价格,但无法正常工作.

I have been working on the following code to conditionally display price if tiered pricing but just cannot get it to work.

<?php if (count($_tierPrices) == 0): ?> <?php echo $this->getPriceHtml($_product) ?> <?php endif; ?>

<?php if (count($_tierPrices) == 0): ?> <?php echo $this->getPriceHtml($_product) ?> <?php endif; ?>

推荐答案

在catalog/product/view/type/default.phtml

Add a conditional statement in catalog/product/view/type/default.phtml

<?php if (count($this->getTierPrices()) == 0): ?>
<?php echo $this->getPriceHtml($_product) ?>
<?php endif;?>

这篇关于如果产品页面上存在分层定价,则隐藏Magento正价的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆