我想以编程方式在Magento 1.8 CE的一页结帐页面上添加促销代码表单。这必须在“付款审查”部分下添加。
layout/checkout.xml
为活动主题添加了以下代码段:
<block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>
然后将以下php代码添加到 template/checkout/onepage.phtml
但是它不起作用,请帮忙!
<?php echo $this->getChildHtml('coupon') ?>
在checkout.xml
布局文件中添加如下内容,
<block type="checkout/onepage_review_info" name="root" output="toHtml" template="checkout/onepage/review/info.phtml">
...
<block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>
...
</block>
并将以下代码放入 app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/onepage/review/info.phtml
<?php echo $this->getChildHtml('coupon') ?>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句