我在马根托加了优惠券。
但是添加代码的块并没有出现在结帐或产品页面上。
我尝试过安装这个扩展http://www.magentocommerce.com/magento-connect/discount-coupon-code-checkout-page.html,但是它没有效果。
我是否需要修改XML或PHP来呈现折扣块?
发布于 2014-08-01 12:30:46
默认情况下,它会出现,但是如果您没有它,您的主题可能正在删除它的定义。在主题的布局文件夹中创建一个local.xml,其内容如下:
<checkout_cart_index>
<reference name="checkout.cart">
<block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>
</reference>
</checkout_cart_index>您可以编辑cart.phtml以修改页面中的位置。如果你没有看到:
<?php echo $this->getChildHtml('coupon') ?>您可以在第一步之前尝试编写它。
发布于 2014-10-20 09:13:27
在我的例子中,折扣没有出现在购物车总计表中,我所做的是:在file: /app/design/frontend/base/default/template/checkout/cart/totals.phtml中,我在renderTotals()之前添加了下面的代码
$totals = Mage::getSingleton('checkout/session')->getQuote()->getTotals(); //Total object
if(isset($totals['discount']) && $totals['discount']->getValue()) {
$discount = Mage::helper('core')->currency($totals['discount']->getValue()); //Discount value if applied
} else {
$discount = '';
}
if($discount!=''){
?>
<tr><td class="a-right"><strong>Discount (Festive5):</strong></td><td class="a-right"><?php echo $discount;?></td></tr>
<?php } ?>
<?php echo $this->renderTotals();?>它将显示折扣优惠券代码值。
https://stackoverflow.com/questions/25078312
复制相似问题