Magento将步骤添加到一页结帐 [英] Magento Adding Step to Onepage Checkout

查看:66
本文介绍了Magento将步骤添加到一页结帐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在单页结帐中添加一个非常基本的步骤(实际上是一个带有一些文本和一个继续按钮的div),但出现了一些错误,因为它们不起作用(我怀疑这是因为它们在1.7.0.2之前创建)时,请按照示例此处(Fontis )此处(Magento论坛). /p>

我还尝试将不同示例和论坛帖子中的内容组合在一起,但是在一周中我一直没有尝试这样做.

我已经向我推荐了一本书,《 Php建筑师使用Magento进行电子商务编程指南》,该书已经购买并且将开始阅读,但是我想知道是否有人可以向我指出正确的方向,以增加新的步骤. 1.7.0.2的一页结帐?

非常感谢您的帮助!

解决方案

我已按照本指南在1.7.0.2中成功完成了此任务:

http://www.excellencemagentoblog.com/magento-onestep-checkout-添加步骤

总而言之,您需要扩展/覆盖Mage_Checkout_Block_Onepage :: getSteps()以在序列中添加新步骤.

创建新步骤的块/模板(在上一步完成时使用Ajax请求加载)您的块类将需要扩展:Mage_Checkout_Block_Onepage_Abstract

您还需要扩展onepagecheckout javascript,因为这可以完成很多繁重的工作.原型库有一个很好的方法.

最后,您将需要扩展控制器类(Mage_Checkout_OnepageController)以覆盖任何现有步骤的响应,返回新步骤的内容(使用ajax加载),并处理任何数据的保存操作(表单字段等)输入您的新步骤.

I'm attempting to add a very basic (literally just a div with some text and a continue button) step to the onepage checkout but have come up short, in that they don't work (i suspect it's because they were created prior to 1.7.0.2), when following the examples here (Fontis), here (inchoo) and here (Magento Forums).

I've also tried to combined bits from different examples and forum posts but i've gotten no where in the week i've been attempting to do this.

I have been recommended the book 'Php Architect's Guide to E-Commerce Programming with Magento' which i've purchased and will begin reading but i was wondering if someone could kindly point me in the right direction in adding a new step to 1.7.0.2's onepage checkout?

Much appreciated for any help!

解决方案

I have done this successfully in 1.7.0.2 following this guide:

http://www.excellencemagentoblog.com/magento-onestep-checkout-add-step

In summary, you need to extend/override Mage_Checkout_Block_Onepage::getSteps() to add your new step in the sequence.

Create your new step's block/template (loaded using an Ajax request when the previous step is completed) Your block class will need to extend: Mage_Checkout_Block_Onepage_Abstract

You also need to extend the onepagecheckout javascript as this does much of the heavy lifting. The Prototype library has a nice way of doing this.

Finally you will need to extend the controller class (Mage_Checkout_OnepageController) to override the responses of any existing steps, return the content of your new step (loaded using ajax), and handle the save action of any data (form fields etc) entered in your new step.

这篇关于Magento将步骤添加到一页结帐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆