如何在类别视图(MAGENTO)中隐藏基本价格?

时间:2013-02-10 17:17:23

标签: magento categories options configurable

我设置了一个带有自定义选项的简单产品,但我想从类别页面(列表或网格模式)隐藏基本价格。 我怎么能这样做?

我强调了我想删除的“价格”: http://i.stack.imgur.com/VBMzs.png

这里有我的price.phtml代码:http://pastebin.com/JGjSQDB7

2 个答案:

答案 0 :(得分:1)

jQuery(document).ready(function () {
    jQuery('.price-box').each(function () {
        if (jQuery(this).find(jQuery('.minimal-price-link')).length > 0) {
            jQuery(this).find('.regular-price').hide();
        }
    })
})

答案 1 :(得分:0)

由于您安装了jQuery,因此可以执行以下操作:

jQuery(document).ready(function () {
    jQuery('.price-box').each(function () {
        if (jQuery(this).find(jQuery('.minimal-price-link')).length > 0) {
            jQuery(this).find('.regular-price').hide();
        }
    })
})

这会单独循环显示.price-box,并会有条理地隐藏.regular-price,具体取决于该给定框中.minimal-price-link的可用性。