Helper/Order.php
private function setShippingMethod($quote, $transaction)
    {
        if ($quote->isVirtual()) {
            return;
        }

        $shippingAddress = $quote->getShippingAddress();
        $shippingAddress->setCollectShippingRates(true);

        $shippingMethod = $transaction->order->cart->shipments[0]->reference;

        $shippingAddress->setShippingMethod($shippingMethod)->save();
    }
private function setShippingMethod($quote, $transaction)
    {
        if ($quote->isVirtual()) {
            return;
        }

        $shippingAddress = $quote->getShippingAddress();
        $shippingAddress->setCollectShippingRates(true);

        $shippingMethod = $transaction->order->cart->shipments[0]->reference;

        $shippingAddress->setShippingMethod($shippingMethod)->save();
    }
private function setShippingMethod ( $ quote , $ transaction ) { if ( $ quote -> isVirtual ( ) ) { return ; } $ shippingAddress = $ quote -> getShippingAddress ( ) ; $ shippingAddress -> setCollectShippingRates ( true ) ; $ shippingMethod = $ transaction -> order -> cart -> shipments [ 0 ] -> reference ; $ shippingAddress -> setShippingMethod ( $ shippingMethod ) -> save ( ) ; }
Set quote shipping method from transaction data

@param Quote $quote
@param $transaction

@throws \Exception
Set quote shipping method from transaction data