I am struggling with a problem regarding placing an order programmatically. I have an extension that creates an order programmatically and does some stuff afterwrds (which is not relevant for my problem here).

Here is the funny thing. When the shipping address destination country is the default location, it works as expected. But if the destination country is Finland for example, I get the exception "The shipping method is missing. Select the shipping method and try again.", even if I definitiely set it, the rates have even been calculated, I checked that. But the order itself won't be submitted.

Does anyone have an idea why? I need help please...

$shippingMethod = $this->_helperData->getConfig('shipping_calculation');
$shippingAddress = $quote->getShippingAddress();

if ($shippingMethod === 'tablerates' ||
   $this->_moduleManager->isDhlInstalled() === false) {
} else {


$quote->getPayment()->importData(['method' => 'checkmo']);
 * Added setTotalsCollectedFlag(false) for testing


//$rates = $shippingAddress->collectShippingRates()
//    ->getGroupedAllShippingRates();

$order = $this->_quoteManagement->submit($quote, $orderData);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.