简体   繁体   中英

Magento Onepage Checkout - Recalculate Shipping Quote

I've got two independent extensions installed in Magento - one to calculate FedEx shipping costs via their API, and another to select the desired delivery date. These two currently don't talk to each other, which means the FedEx shipping quotes always assume the package will be shipped the night you place the order.

The quote is being generated immediately before the Shipping Method renders. When it does render, the delivery date block is also loaded in. This means the user is selecting a delivery date AFTER the quotes have been generated.

I essentially need some way to save the date and reload the Shipping Method tab, so that it regenerates the quotes using the provided date.

What is the best approach to making this work? I'm hoping I can do this without drastic changes to onepage - basically use as much of the existing JS and controller logic as possible.

you clearly have both steps tied together, your solution could be to try and ask the delivery date in address step (billing or shipping) and then making it available and understandable for your FedEx extension. Other possibility is to attach event listener to date field and on change will submit the data and reload the shipping method block

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