magento 结帐:更改运费
设想: 在结账时使用设计解析的变量更改运费。 我需要使用 phtml checkout 发送的一些变量来更改最终运费。
例如。
Shipping method 1: cost 33$
Shipping method 2: cost 23$
Shipping method 3: cost 10$
special packaging checkbox (y/n) + 10$ (set it as yes for this example)
assicuration:
我已经手动插入了此复选框,只是在设计中,但我需要增加最终价格并添加一个简单的标签,其中包括发货
总额应该是
shipment total 20$
Scenario:
Change shipping price using variable parsed by design during checkout.
I need to change the final shipping price using some variables sent by phtml checkout.
Eg.
Shipping method 1: cost 33$
Shipping method 2: cost 23$
Shipping method 3: cost 10$
special packaging checkbox (y/n) + 10$ (set it as yes for this example)
assicuration:
I've inserted manually this checkbox, just in design but I need to increment final price and add a simple label that include this on shipment
total should be
shipment total 20$
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为此,您需要编写自己的运输模块。 此处有一篇 wiki 文章,其中包含说明,否则关于这个过程有很多很好的博客文章。我建议您使用现有的 Magento 运输模块之一(例如
Mage_Shipping_Model_Carrier_Flatrate
)作为示例,然后扩展collectRates
方法来测试变量的值。In order to do this, you will need to write your own Shipping Module. There is a wiki article here with instructions, otherwise there are many good blog posts on the process. I would recommend that you use one of the existing Magento shipping modules (e.g.
Mage_Shipping_Model_Carrier_Flatrate
) as an example and then just extend thecollectRates
method to test for the value of your variable.