简体   繁体   中英

magento checkout: change shipping price

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$

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 (eg Mage_Shipping_Model_Carrier_Flatrate ) as an example and then just extend the collectRates method to test for the value of your variable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM