【发布时间】:2011-02-04 00:24:02
【问题描述】:
我试图做的是设置 3 个不同的单页结帐流程实例,我想最简单的方法是创建 3 个新的 cms 页面,用以下内容覆盖 xml(取自 checkout.xml,请参阅帖子底部的代码)并完成这项工作。
这可以很好地加载所有内容,但是当以访客身份执行这些步骤时,它会触发一些失败重定向(我相信位于 onepage.phtml 中),并且看起来它不明白 /checkout/onepage/saveMethod 是什么(返回403 浏览器错误),我假设因为我真的在 cms 页面的某些实例中而不是结帐页面中,因为某些东西没有在幕后加载。
我希望使用此方法来自定义此过程,因为我觉得它看起来是最干净的方式,无需进行太多更改,但我不太确定这里没有加载什么来完成这项工作以及如何加载它。我试图找到一种方法来通过 xml 调用 mage_checkout 某些东西或其他东西,以让 cms 页面将其识别为结帐并让它工作,但找不到任何东西。
如果有更简单的方法来做到这一点,我的最终目标是拥有 3 组单独的 /template/checkout/onepage/ phtml 模板可以使用,因为它们都将不同,附加到 3 个不同的 url (我打算隐藏默认的 /onepage/ 结帐)。
<!-- Mage_Checkout -->
<remove name="left"/>
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>
<reference name="right">
<action method="unsetChildren"></action>
<block type="checkout/onepage_progress" name="checkout.progress" before="-" template="checkout/onepage/progress.phtml"/>
<block type="livechat/template" before="checkout.progress" name="livechat.chat" template="livechat/chat.phtml"/>
</reference>
<reference name="content">
<block type="checkout/onepage" name="checkout.onepage" template="checkout/onepage.phtml">
<block type="checkout/onepage_login" name="checkout.onepage.login" as="login" template="checkout/onepage/login.phtml"/>
<block type="checkout/onepage_billing" name="checkout.onepage.billing" as="billing" template="checkout/onepage/billing.phtml"/>
<block type="checkout/onepage_shipping" name="checkout.onepage.shipping" as="shipping" template="checkout/onepage/shipping.phtml"/>
<block type="checkout/onepage_shipping_method" name="checkout.onepage.shipping_method" as="shipping_method" template="checkout/onepage/shipping_method.phtml">
<block type="checkout/onepage_shipping_method_available" name="checkout.onepage.shipping_method.available" as="available" template="checkout/onepage/shipping_method/available.phtml"/>
<block type="checkout/onepage_shipping_method_additional" name="checkout.onepage.shipping_method.additional" as="additional" template="checkout/onepage/shipping_method/additional.phtml"/>
</block>
<block type="checkout/onepage_payment" name="checkout.onepage.payment" as="payment" template="checkout/onepage/payment.phtml">
<block type="checkout/onepage_payment_methods" name="checkout.payment.methods" as="methods" template="checkout/onepage/payment/methods.phtml">
<action method="setMethodFormTemplate"><method>purchaseorder</method><template>payment/form/purchaseorder.phtml</template></action>
</block>
</block>
<block type="checkout/onepage_review" name="checkout.onepage.review" as="review" template="checkout/onepage/review.phtml">
<block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>
</block>
</block>
</reference>
【问题讨论】:
-
请解释一下所有这些的意义,以便我们能够真正理解这个问题