作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想在 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') ?>
关于magento-1.8 - Magento : How to add promo code form on one page checkout page?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28759782/
我是一名优秀的程序员,十分优秀!