cancel
Showing results for 
Search instead for 
Did you mean: 

how to fix "The shipping method is missing" exception in order creation programmatically ?

SOLVED

how to fix "The shipping method is missing" exception in order creation programmatically ?

Hi,

 

Magento Version: 2.3.0

 

https://webkul.com/blog/create-quote-and-order-programmatically-in-magento2/


If I place an order using the above code with UPS shipping method then it will throw an exception like below
"The shipping method is missing. Select the shipping method and try again."
It is working well with offline shipping methods like "Flat Rate, Free Shipping".

Please suggest me how can I fix it?

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: how to fix "The shipping method is missing" exception in order creation programmatical

Yes,

Actually I do not add the product into the cart but directly fetch from the table and make it array to pass into order array.

And the same as fetching the shipping method from the table and select from it.

As per my client requirement, I need to create order programmatically not throw cart and checkout process.

It works well if I add the product into the cart and select the ups shipping method from checkout.

But I need all functionality using coding.

View solution in original post

5 REPLIES 5

Re: how to fix "The shipping method is missing" exception in order creation programmatical

Hello @yagnik_solanki1 

 

Do below thing, into browser add product and add your zip code, it will provide all shipping method.

 

from developer tool you will find shipping method code, 

 

from value usps_1 so you need to find it, add into your code

 

Hope it will work 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: how to fix "The shipping method is missing" exception in order creation programmatical

Thanks for the reply,

 

I tried your solution but it still throws the same error mention into my question.


Re: how to fix "The shipping method is missing" exception in order creation programmatical

Hello @yagnik_solanki1 

 

are you trying same product and same shipping method as web browser giving?

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: how to fix "The shipping method is missing" exception in order creation programmatical

Yes,

Actually I do not add the product into the cart but directly fetch from the table and make it array to pass into order array.

And the same as fetching the shipping method from the table and select from it.

As per my client requirement, I need to create order programmatically not throw cart and checkout process.

It works well if I add the product into the cart and select the ups shipping method from checkout.

But I need all functionality using coding.

Re: how to fix "The shipping method is missing" exception in order creation programmatical


@yagnik_solanki1 wrote:

Hi,

 

Magento Version: 2.3.0

 

https://webkul.com/blog/create-quote-and-order-programmatically-in-magento2/


If I place an order using the above code with UPS shipping method then it will throw an exception like below
"The shipping method is missing. Select the shipping method and try again."
It is working well with offline shipping methods like "Flat Rate, Free Shipping".


@yagnik_solanki1 wrote:

Hi,

 

Magento Version: 2.3.0

 

https://webkul.com/blog/create-quote-and-order-programmatically-in-magento2/


If I place an order using the above code with UPS shipping method then it will throw an exception like below
"The shipping method is missing. Select the shipping method and try again."
It is working well with offline shipping methods like "Flat Rate, Free Shipping".

Please suggest me how can I fix it?

Thanks in advance.


how do i fix it

Please suggest me how can I fix it?

Thanks in advance.