Magento 产品价格等于 0 显示文本
Magento Product price is equal to 0 display text
如果产品价格等于零“0”,我需要替换或隐藏产品列表页面上的添加到购物车按钮。
喜欢这里:http://www.lighting-furniture-design.com/luxury-lighting/ceiling-suspensions/deep-sky-2565.html
我的演示站点在这里:http://www.sllv2.lighting-design-led.com/luminaire-de-luxe.html
请帮助我。
谢谢
您可以将以下 if else 包裹在添加到购物车按钮周围
<?php if ($_product->getFinalPrice() == 0) : ?>
<h2>On demand</h2>
<?php else: ?>
// Your add to cart button here
<?php endif; ?>
如果要在价格为零时替换按钮的文本。将文件 addtocart.phtml 复制到您的主题中。将 buttonTitle 更改为以下。它将检查价格,因此您可以更改文本。
<?php $buttonTitle = ( ($_product->getFinalPrice() > 0) ?
Mage::helper('core')->quoteEscape($this->__('Add to Cart')) :
"your text" );
?>
如果产品价格等于零“0”,我需要替换或隐藏产品列表页面上的添加到购物车按钮。
喜欢这里:http://www.lighting-furniture-design.com/luxury-lighting/ceiling-suspensions/deep-sky-2565.html
我的演示站点在这里:http://www.sllv2.lighting-design-led.com/luminaire-de-luxe.html
请帮助我。
谢谢
您可以将以下 if else 包裹在添加到购物车按钮周围
<?php if ($_product->getFinalPrice() == 0) : ?>
<h2>On demand</h2>
<?php else: ?>
// Your add to cart button here
<?php endif; ?>
如果要在价格为零时替换按钮的文本。将文件 addtocart.phtml 复制到您的主题中。将 buttonTitle 更改为以下。它将检查价格,因此您可以更改文本。
<?php $buttonTitle = ( ($_product->getFinalPrice() > 0) ?
Mage::helper('core')->quoteEscape($this->__('Add to Cart')) :
"your text" );
?>