2014-08-28 62 views
0

我们正在使用安装了onepagecheckout的主题。但是,由于我们结帐的一些要求,我们无法使用它并正在使用默认的magento结帐。除了我们没有优惠券形式之外,这一切都很好。当我在local.xml文件中查找时,以下不存在magento 1.9 onepage checkout中没有表单 - 未使用主题OnePageCheckout

<reference name="content"> 
      <block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/> 
       </reference> 

for checkout_cart_index。它仍然存在于base/layout/checkout.xml文件中。 在local.xml中它并呼吁

<block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="onepagecheckout/onepage/coupon.phtml"/> 
在onepagecheckout_index_index

结帐/车/ coupon.phtml文件不存在。但该块没有在结帐页面上被调用。

如何将优惠券块添加回magento结帐?

我刚才看到上面的代码将块放在购物车页面上,而不是结账页面。我如何将它添加到结帐的评论部分?

回答

1

如果我理解你正确,那么你想在你的“订单评论”中添加一个“优惠券代码块”在一个页面结帐。默认magento“折扣优惠券代码块”是在购物车页面。 要添加块,只需在“template \ checkout \ onepage \ review.phtml”中调用该块即可。请将以下代码粘贴到上述文件中。

<?php echo $this->getLayout()->createBlock('checkout/cart_coupon')->setTemplate('checkout/cart/coupon.phtml')->toHtml(); ?> 

这将带来优惠券块在您的订单审查。

希望这可能有所帮助。

+0

这不适用于1.9 rwd主题。它不输出块,除非我也需要在xml checkout.xml中声明它? – 2017-08-17 14:02:22

+0

@ aton1004 - 谢谢。这对我来说工作得很好 – sujivasagam 2017-11-29 06:52:22