cancel
Showing results for 
Search instead for 
Did you mean: 

Shipping methods based on billing address

Shipping methods based on billing address

Magento  version: 2.3.2

 

Dear Magento Community,

 

For the past few days I've been trying to figure out how to get the shipping methods on the checkout page based on the billing address / billing country. I have tried many things from altering the shipping-rates-service (JS), modified the quotes module and running observers. Nothing seems to give the results I was hoping for.

 

I'm using onestepcheckout/iosc as an extra module, trying to alter those files also did not give the expected results. After some days I'm giving my hopes to the community.

 

The basic idea is: do not use the shipping-address to fetch the available shipping methods, but use the billing address for shipping methods.

 

Of course I'm looking for a solution, but if anyone is able to point me into the right direction, I'm very thankful for any suggestion.

 

Thanks a lot for your time and have a nice day,

 

Frank

2 REPLIES 2

Re: Shipping methods based on billing address

Hey @FrankyW 

 

Please refer the solution at https://magento.stackexchange.com/questions/174052/magento-2-change-the-form-fields-sort-order-in-ch...

 

Using this code, you may be able to customize the onestepcheckout and fulfill your requirements.

 

Hope it helps.

 

---
If you've found my answer useful, please give"Kudos" and "Accept as Solution"

Re: Shipping methods based on billing address

Hey @Meetanshi,

 

Thank you for your reply and for pointing me into a solution.

 

I have tried using the LayoutProcessor, but it did not meet the requirements. I also tried switching the fields by changing the LayoutProcessor's array outcome (replace shippingFields with billingFields, or what ever the array-keys were named). This only swapped the shipping address to the bottom. And unfortunately that is not what I was looking for, though it could be the answer.

 

I'm thinking that I have to try something else by changing the way the Quote is being generated? It's just that part where "if billing-address is filled in, use billing address as shipping address" that I'm trying to build. And I'm not able to find the correct path to look into.

 

Any other suggestions?

 

Thank you again for your reply.