Magento 2 - The shipping method is missing. Select the shipping method and try againconfigure Magento 2.3 with Will-Call only shipping methodMissing file from static Magento 2Magento2 : Error The “Is New” attribute value is empty. Set the attribute and try againmagento 2 - display shipping method logoHow to Unset the shipping method from quote in magento 2?Magento 2 how to show shipping method between shipping address and payment?Magento 2 : Product options date saved less then select date while add to cartDHL Shipping Method not show on checkout pagemagento 2.3.0 shipping method based coupon code not working in cart pageSet Shipping Method Programatically

Does the sensor of a dslr count the number of photons that hits it?

How to factor a fourth degree polynomial

As a supervisor, what feedback would you expect from a PhD who quits?

Why do airports remove/realign runways?

What is the maximum amount of diamond in one Minecraft game?

Howto display unicode character u2026 in terminal mode in emacs

Passwordless authentication - how invalidate login code

Why does this function pointer assignment work when assigned directly but not with the conditional operator?

Groups where no elements commute except for the trivial cases

Tiny URL creator

How do I check that users don't write down their passwords?

Does the Milky Way orbit around anything?

How did the IEC decide to create kibibytes?

Taking advantage when HR forgets to communicate the rules

Attach a visible light telescope to the outside of the ISS

Is reasonable to assume that the 食 in 月食/日食 can be interpreted as the sun/moon being "eaten" during an eclipse?

Wouldn't putting an electronic key inside a small Faraday cage render it completely useless?

Is there a minimum amount of electricity that can be fed back into the grid?

Bringing coumarin-containing liquor into the USA

Wearing special clothes in public while in niddah- isn't this a lack of tznius?

Why do people prefer metropolitan areas, considering monsters and villains?

Alternative to Willpower in Fighting Cravings

Any way to meet code with 40.7% or 40.44% conduit fill?

Initializing variables in an "if" statement



Magento 2 - The shipping method is missing. Select the shipping method and try again


configure Magento 2.3 with Will-Call only shipping methodMissing file from static Magento 2Magento2 : Error The “Is New” attribute value is empty. Set the attribute and try againmagento 2 - display shipping method logoHow to Unset the shipping method from quote in magento 2?Magento 2 how to show shipping method between shipping address and payment?Magento 2 : Product options date saved less then select date while add to cartDHL Shipping Method not show on checkout pagemagento 2.3.0 shipping method based coupon code not working in cart pageSet Shipping Method Programatically






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I am trying to set the Shipping Method Programatically on place Order using Below code . But I am Getting Error



For your Reference I am Using https://github.com/magestat/magento2-split-order/
Code



message: "The shipping method is missing. Select the shipping method and try again."



/**
* Places an order for a specified cart.
*
* @param QuoteManagement $subject
* @param callable $proceed
* @param int $cartId
* @param string $payment
* @return mixed
* @throws LocalizedException
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
* @see MagentoQuoteApiCartManagementInterface
*/
public function aroundPlaceOrder(QuoteManagement $subject, callable $proceed, $cartId, $payment = null)

$currentQuote = $this->quoteRepository->getActive($cartId);
// Separate all items in quote into new quotes.
$quotes = $this->quoteHandler->normalizeQuotes($currentQuote);
if (empty($quotes))
return $result = array_values([($proceed($cartId, $payment))]);

// Collect list of data addresses.
$addresses = $this->quoteHandler->collectAddressesData($currentQuote);
/** @var MagentoSalesApiDataOrderInterface[] $orders */
$orders = [];
$orderIds = [];
$orderSrNo = 1;
$this->checkoutSession->setOrderSrNO($orderSrNo);
foreach ($quotes as $items)
/** @var MagentoQuoteModelQuote $split */
$split = $this->quoteFactory->create();
// Set all customer definition data.
$this->quoteHandler->setCustomerData($currentQuote, $split);
$this->toSaveQuote($split);
// Map quote items.
foreach ($items as $item)
// Add item by item.
$item->setId(null);
$split->addItem($item);

$this->quoteHandler->populateQuote($quotes, $split, $items, $addresses, $payment);
// Dispatch event as Magento standard once per each quote split.
$this->eventManager->dispatch(
'checkout_submit_before',
['quote' => $split]
);

$this->helperData->writeLogger('$split->getShippingAddress()->getShippingMethod()');
$this->helperData->writeLogger(json_encode($split->getShippingAddress()->getShippingMethod()));
$split->getShippingAddress()->setShippingMethod('freeshipping_freeshipping');
$split->getShippingAddress()->setCollectShippingRates(true);


$this->toSaveQuote($split);
$order = $subject->submit($split);
$orders[] = $order;
$orderIds[$order->getId()] = $order->getIncrementId();
$orderSrNo++;
$this->checkoutSession->unsOrderSrNO();
$this->checkoutSession->setOrderSrNO($orderSrNo);

if (null == $order)
throw new LocalizedException(__('Please try to place the order again.'));


$currentQuote->setIsActive(false);
$this->toSaveQuote($currentQuote);
$this->quoteHandler->defineSessions($split, $order, $orderIds);
$this->eventManager->dispatch(
'checkout_submit_all_after',
['orders' => $orders, 'quote' => $currentQuote]
);
return $this->getOrderKeys($orderIds);

/**
* Save quote
*
* @param MagentoQuoteApiDataCartInterface $quote
* @return MyModuleSplitOrderPluginSplitQuote
*/
private function toSaveQuote($quote)

$this->quoteRepository->save($quote);
return $this;

/**
* @param array $orderIds
* @return array
*/
private function getOrderKeys($orderIds)

$orderValues = [];
foreach (array_keys($orderIds) as $orderKey)
$orderValues[] = (string) $orderKey;

return array_values($orderValues);










share|improve this question
























  • can you post your whole code

    – fmsthird
    Jun 27 at 11:26











  • @fmsthird - I have Updated my Question. THanks

    – Sairaj Gadekar
    Jun 27 at 12:32

















3















I am trying to set the Shipping Method Programatically on place Order using Below code . But I am Getting Error



For your Reference I am Using https://github.com/magestat/magento2-split-order/
Code



message: "The shipping method is missing. Select the shipping method and try again."



/**
* Places an order for a specified cart.
*
* @param QuoteManagement $subject
* @param callable $proceed
* @param int $cartId
* @param string $payment
* @return mixed
* @throws LocalizedException
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
* @see MagentoQuoteApiCartManagementInterface
*/
public function aroundPlaceOrder(QuoteManagement $subject, callable $proceed, $cartId, $payment = null)

$currentQuote = $this->quoteRepository->getActive($cartId);
// Separate all items in quote into new quotes.
$quotes = $this->quoteHandler->normalizeQuotes($currentQuote);
if (empty($quotes))
return $result = array_values([($proceed($cartId, $payment))]);

// Collect list of data addresses.
$addresses = $this->quoteHandler->collectAddressesData($currentQuote);
/** @var MagentoSalesApiDataOrderInterface[] $orders */
$orders = [];
$orderIds = [];
$orderSrNo = 1;
$this->checkoutSession->setOrderSrNO($orderSrNo);
foreach ($quotes as $items)
/** @var MagentoQuoteModelQuote $split */
$split = $this->quoteFactory->create();
// Set all customer definition data.
$this->quoteHandler->setCustomerData($currentQuote, $split);
$this->toSaveQuote($split);
// Map quote items.
foreach ($items as $item)
// Add item by item.
$item->setId(null);
$split->addItem($item);

$this->quoteHandler->populateQuote($quotes, $split, $items, $addresses, $payment);
// Dispatch event as Magento standard once per each quote split.
$this->eventManager->dispatch(
'checkout_submit_before',
['quote' => $split]
);

$this->helperData->writeLogger('$split->getShippingAddress()->getShippingMethod()');
$this->helperData->writeLogger(json_encode($split->getShippingAddress()->getShippingMethod()));
$split->getShippingAddress()->setShippingMethod('freeshipping_freeshipping');
$split->getShippingAddress()->setCollectShippingRates(true);


$this->toSaveQuote($split);
$order = $subject->submit($split);
$orders[] = $order;
$orderIds[$order->getId()] = $order->getIncrementId();
$orderSrNo++;
$this->checkoutSession->unsOrderSrNO();
$this->checkoutSession->setOrderSrNO($orderSrNo);

if (null == $order)
throw new LocalizedException(__('Please try to place the order again.'));


$currentQuote->setIsActive(false);
$this->toSaveQuote($currentQuote);
$this->quoteHandler->defineSessions($split, $order, $orderIds);
$this->eventManager->dispatch(
'checkout_submit_all_after',
['orders' => $orders, 'quote' => $currentQuote]
);
return $this->getOrderKeys($orderIds);

/**
* Save quote
*
* @param MagentoQuoteApiDataCartInterface $quote
* @return MyModuleSplitOrderPluginSplitQuote
*/
private function toSaveQuote($quote)

$this->quoteRepository->save($quote);
return $this;

/**
* @param array $orderIds
* @return array
*/
private function getOrderKeys($orderIds)

$orderValues = [];
foreach (array_keys($orderIds) as $orderKey)
$orderValues[] = (string) $orderKey;

return array_values($orderValues);










share|improve this question
























  • can you post your whole code

    – fmsthird
    Jun 27 at 11:26











  • @fmsthird - I have Updated my Question. THanks

    – Sairaj Gadekar
    Jun 27 at 12:32













3












3








3








I am trying to set the Shipping Method Programatically on place Order using Below code . But I am Getting Error



For your Reference I am Using https://github.com/magestat/magento2-split-order/
Code



message: "The shipping method is missing. Select the shipping method and try again."



/**
* Places an order for a specified cart.
*
* @param QuoteManagement $subject
* @param callable $proceed
* @param int $cartId
* @param string $payment
* @return mixed
* @throws LocalizedException
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
* @see MagentoQuoteApiCartManagementInterface
*/
public function aroundPlaceOrder(QuoteManagement $subject, callable $proceed, $cartId, $payment = null)

$currentQuote = $this->quoteRepository->getActive($cartId);
// Separate all items in quote into new quotes.
$quotes = $this->quoteHandler->normalizeQuotes($currentQuote);
if (empty($quotes))
return $result = array_values([($proceed($cartId, $payment))]);

// Collect list of data addresses.
$addresses = $this->quoteHandler->collectAddressesData($currentQuote);
/** @var MagentoSalesApiDataOrderInterface[] $orders */
$orders = [];
$orderIds = [];
$orderSrNo = 1;
$this->checkoutSession->setOrderSrNO($orderSrNo);
foreach ($quotes as $items)
/** @var MagentoQuoteModelQuote $split */
$split = $this->quoteFactory->create();
// Set all customer definition data.
$this->quoteHandler->setCustomerData($currentQuote, $split);
$this->toSaveQuote($split);
// Map quote items.
foreach ($items as $item)
// Add item by item.
$item->setId(null);
$split->addItem($item);

$this->quoteHandler->populateQuote($quotes, $split, $items, $addresses, $payment);
// Dispatch event as Magento standard once per each quote split.
$this->eventManager->dispatch(
'checkout_submit_before',
['quote' => $split]
);

$this->helperData->writeLogger('$split->getShippingAddress()->getShippingMethod()');
$this->helperData->writeLogger(json_encode($split->getShippingAddress()->getShippingMethod()));
$split->getShippingAddress()->setShippingMethod('freeshipping_freeshipping');
$split->getShippingAddress()->setCollectShippingRates(true);


$this->toSaveQuote($split);
$order = $subject->submit($split);
$orders[] = $order;
$orderIds[$order->getId()] = $order->getIncrementId();
$orderSrNo++;
$this->checkoutSession->unsOrderSrNO();
$this->checkoutSession->setOrderSrNO($orderSrNo);

if (null == $order)
throw new LocalizedException(__('Please try to place the order again.'));


$currentQuote->setIsActive(false);
$this->toSaveQuote($currentQuote);
$this->quoteHandler->defineSessions($split, $order, $orderIds);
$this->eventManager->dispatch(
'checkout_submit_all_after',
['orders' => $orders, 'quote' => $currentQuote]
);
return $this->getOrderKeys($orderIds);

/**
* Save quote
*
* @param MagentoQuoteApiDataCartInterface $quote
* @return MyModuleSplitOrderPluginSplitQuote
*/
private function toSaveQuote($quote)

$this->quoteRepository->save($quote);
return $this;

/**
* @param array $orderIds
* @return array
*/
private function getOrderKeys($orderIds)

$orderValues = [];
foreach (array_keys($orderIds) as $orderKey)
$orderValues[] = (string) $orderKey;

return array_values($orderValues);










share|improve this question
















I am trying to set the Shipping Method Programatically on place Order using Below code . But I am Getting Error



For your Reference I am Using https://github.com/magestat/magento2-split-order/
Code



message: "The shipping method is missing. Select the shipping method and try again."



/**
* Places an order for a specified cart.
*
* @param QuoteManagement $subject
* @param callable $proceed
* @param int $cartId
* @param string $payment
* @return mixed
* @throws LocalizedException
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
* @see MagentoQuoteApiCartManagementInterface
*/
public function aroundPlaceOrder(QuoteManagement $subject, callable $proceed, $cartId, $payment = null)

$currentQuote = $this->quoteRepository->getActive($cartId);
// Separate all items in quote into new quotes.
$quotes = $this->quoteHandler->normalizeQuotes($currentQuote);
if (empty($quotes))
return $result = array_values([($proceed($cartId, $payment))]);

// Collect list of data addresses.
$addresses = $this->quoteHandler->collectAddressesData($currentQuote);
/** @var MagentoSalesApiDataOrderInterface[] $orders */
$orders = [];
$orderIds = [];
$orderSrNo = 1;
$this->checkoutSession->setOrderSrNO($orderSrNo);
foreach ($quotes as $items)
/** @var MagentoQuoteModelQuote $split */
$split = $this->quoteFactory->create();
// Set all customer definition data.
$this->quoteHandler->setCustomerData($currentQuote, $split);
$this->toSaveQuote($split);
// Map quote items.
foreach ($items as $item)
// Add item by item.
$item->setId(null);
$split->addItem($item);

$this->quoteHandler->populateQuote($quotes, $split, $items, $addresses, $payment);
// Dispatch event as Magento standard once per each quote split.
$this->eventManager->dispatch(
'checkout_submit_before',
['quote' => $split]
);

$this->helperData->writeLogger('$split->getShippingAddress()->getShippingMethod()');
$this->helperData->writeLogger(json_encode($split->getShippingAddress()->getShippingMethod()));
$split->getShippingAddress()->setShippingMethod('freeshipping_freeshipping');
$split->getShippingAddress()->setCollectShippingRates(true);


$this->toSaveQuote($split);
$order = $subject->submit($split);
$orders[] = $order;
$orderIds[$order->getId()] = $order->getIncrementId();
$orderSrNo++;
$this->checkoutSession->unsOrderSrNO();
$this->checkoutSession->setOrderSrNO($orderSrNo);

if (null == $order)
throw new LocalizedException(__('Please try to place the order again.'));


$currentQuote->setIsActive(false);
$this->toSaveQuote($currentQuote);
$this->quoteHandler->defineSessions($split, $order, $orderIds);
$this->eventManager->dispatch(
'checkout_submit_all_after',
['orders' => $orders, 'quote' => $currentQuote]
);
return $this->getOrderKeys($orderIds);

/**
* Save quote
*
* @param MagentoQuoteApiDataCartInterface $quote
* @return MyModuleSplitOrderPluginSplitQuote
*/
private function toSaveQuote($quote)

$this->quoteRepository->save($quote);
return $this;

/**
* @param array $orderIds
* @return array
*/
private function getOrderKeys($orderIds)

$orderValues = [];
foreach (array_keys($orderIds) as $orderKey)
$orderValues[] = (string) $orderKey;

return array_values($orderValues);







magento2.3






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 27 at 12:31







Sairaj Gadekar

















asked Jun 27 at 11:20









Sairaj GadekarSairaj Gadekar

3131 silver badge11 bronze badges




3131 silver badge11 bronze badges












  • can you post your whole code

    – fmsthird
    Jun 27 at 11:26











  • @fmsthird - I have Updated my Question. THanks

    – Sairaj Gadekar
    Jun 27 at 12:32

















  • can you post your whole code

    – fmsthird
    Jun 27 at 11:26











  • @fmsthird - I have Updated my Question. THanks

    – Sairaj Gadekar
    Jun 27 at 12:32
















can you post your whole code

– fmsthird
Jun 27 at 11:26





can you post your whole code

– fmsthird
Jun 27 at 11:26













@fmsthird - I have Updated my Question. THanks

– Sairaj Gadekar
Jun 27 at 12:32





@fmsthird - I have Updated my Question. THanks

– Sairaj Gadekar
Jun 27 at 12:32










0






active

oldest

votes














Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f279913%2fmagento-2-the-shipping-method-is-missing-select-the-shipping-method-and-try-a%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f279913%2fmagento-2-the-shipping-method-is-missing-select-the-shipping-method-and-try-a%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?