I want to reorder a product programmatically. For this I'd followed the answer: Magento - Programmatically reorder. But I'm getting error message
Please specify a shipping method.
Why isn't it setting the shipping method used earlier?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
Still don't know why isn't it setting the shipping method used last time but below is the code I needed to add in order to make this work:
$reorder->getQuote()->getShippingAddress() ->setShippingMethod($order->getShippingMethod()) ->setCollectShippingRates(true) ->collectShippingRates() ->collectTotals() ->save();