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.
Solved! Go to Solution.
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.
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
Thanks for the reply,
I tried your solution but it still throws the same error mention into my question.
Hello @yagnik_solanki1
are you trying same product and same shipping method as web browser giving?
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.
@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.