Magento产品价格等于0显示文本
如果产品价格等于零“0”,我需要替换或隐藏产品列表页面上的“添加到购物车”按钮 就像这里: 我的演示站点在这里: 请帮帮我Magento产品价格等于0显示文本,magento,price,Magento,Price,如果产品价格等于零“0”,我需要替换或隐藏产品列表页面上的“添加到购物车”按钮 就像这里: 我的演示站点在这里: 请帮帮我 谢谢您可以在“添加到购物车”按钮周围包装以下内容 <?php if ($_product->getFinalPrice() == 0) : ?> <h2>On demand</h2> <?php else: ?> // Your add to cart button here <?php
谢谢您可以在“添加到购物车”按钮周围包装以下内容
<?php if ($_product->getFinalPrice() == 0) : ?>
<h2>On demand</h2>
<?php else: ?>
// Your add to cart button here
<?php endif; ?>
随需应变
//您的添加到购物车按钮在这里
如果要在价格为零时替换botton的文本。复制主题中的addtocart.phtml文件。将按钮改为下方。它将检查价格,因此您可以更改文本
<?php $buttonTitle = ( ($_product->getFinalPrice() > 0) ?
Mage::helper('core')->quoteEscape($this->__('Add to Cart')) :
"your text" );
?>
我投票结束这个问题,因为堆栈溢出是一个问答网站。你的问题不是关于编程。也许你应该把它贴上去?