While saving order programmatically, I am passing table (tablerate_bestway), but it is giving error
'Please specify a shipping method.'
My code to save shipping method
$shippingAddress->setCollectShippingRates(true)
->setShouldIgnoreValidation(true)
->setShippingMethod("tablerate_bestway")
->collectShippingRates();
However, if I pass flatrate_flatrate, it works. How to save tablerate_bestway?
Both, flat_rate and tablerate_bestway enable in Admin.
Solution sample is:
$shippingAddress->removeAllShippingRates()
->setCollectShippingRates(true)
->setShippingMethod('tablerate_bestway')
->setShippingDescription('Table Rate - Best Way');
Add Shipping Description and do not collect shipping charge.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With