Only 1 product adding to order when creating orders programatically in magento 2Set created_at when...

Co-worker team leader wants to inject the crap software product of his friends into our development. What should I say to our common boss?

Draw arrow on sides of triangle

Excess Zinc in garden soil

Silly Sally's Movie

What Happens when Passenger Refuses to Fly Boeing 737 Max?

Do I need to leave some extra space available on the disk which my database log files reside, for log backup operations to successfully occur?

Is a lawful good "antagonist" effective?

Best mythical creature to use as livestock?

Decoding assembly instructions in a Game Boy disassembler

If the Captain's screens are out, does he switch seats with the co-pilot?

The three point beverage

validation vs test vs training accuracy, which one to compare for claiming overfit?

How do anti-virus programs start at Windows boot?

What is the blue range indicating on this manifold pressure gauge?

Rejected in 4th interview round citing insufficient years of experience

What has been your most complicated TikZ drawing?

What injury would be of little consequence to a biped but terrible for a quadruped?

Make a transparent 448*448 image

Provisioning profile doesn't include the application-identifier and keychain-access-groups entitlements

Ban on all campaign finance?

My adviser wants to be the first author

How to make readers know that my work has used a hidden constraint?

Is "history" a male-biased word ("his+story")?

Force user to remove USB token



Only 1 product adding to order when creating orders programatically in magento 2


Set created_at when programatically creating a Magento ordermagento programatically order createUpdate product price before placing orderIs Quote Necessary when creating order Programaticallymagento 2.2.4 : Create orders programmaticalyMagento 2.2 Create Order for customer from frontend As Sales RepPossibility of creating order programatically without quoteHow to speed up creating orders programmatically in Magento 2?Magento 2 How to disable price from orders, customer account and order view if custom module is enabled?Magento 2 Main Configurable Products Duplicated in Order Info When Configurations are Ordered













0















I am in a process of creating orders programatically in magento 2.
below is my code.



<?php
namespace Eight65mediaMpowerSyncHelper;
use MagentoFrameworkAppHelperAbstractHelper;
class Data extends AbstractHelper{

protected $scopeConfig;
protected $loggerInterface;

public function __construct(
PsrLogLoggerInterface $loggerInterface,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoFrameworkAppHelperContext $context,
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoCatalogModelProduct $product,
MagentoCatalogModelProductFactory $productFactory,
MagentoQuoteApiCartRepositoryInterface $cartRepositoryInterface,
MagentoQuoteApiCartManagementInterface $cartManagementInterface,
MagentoCustomerModelCustomerFactory $customerFactory,
MagentoCustomerApiCustomerRepositoryInterface $customerRepository,
MagentoSalesModelOrder $order
) {

$this->logger = $loggerInterface;
$this->_scopeConfig = $scopeConfig;
$this->_productFactory = $productFactory;
$this->_storeManager = $storeManager;
$this->_product = $product;
$this->cartRepositoryInterface = $cartRepositoryInterface;
$this->cartManagementInterface = $cartManagementInterface;
$this->customerFactory = $customerFactory;
$this->customerRepository = $customerRepository;
$this->order = $order;
}


public function createMageOrder($orderData) {
$store=$this->_storeManager->getStore();
$websiteId = $this->_storeManager->getStore()->getWebsiteId();
$customer=$this->customerFactory->create();
$customer->setWebsiteId($websiteId);
$customer->loadByEmail($orderData['email']);// load customet by email address
if(!$customer->getEntityId()){
//If not avilable then create this customer
$customer->setWebsiteId($websiteId)
->setStore($store)
->setFirstname($orderData['shipping_address']['firstname'])
->setLastname($orderData['shipping_address']['lastname'])
->setEmail($orderData['email'])
->setPassword($orderData['email']);
$customer->save();
}

$cartId = $this->cartManagementInterface->createEmptyCart(); //Create empty cart
$quote = $this->cartRepositoryInterface->get($cartId); // load empty cart quote
$quote->setStore($store);
// if you have allready buyer id then you can load customer directly
$customer= $this->customerRepository->getById($customer->getEntityId());
$quote->setCurrency();
$quote->assignCustomer($customer); //Assign quote to customer

//add items in quote
foreach($orderData['items'] as $item){
echo "+ ".$item['product_id']."</br>";
$product = $this->_product->load($item['product_id']);
//$product->setPrice($item['price']);
$quote->addProduct($product, intval($item['qty']));
}

//Set Address to quote
$quote->getBillingAddress()->addData($orderData['shipping_address']);
$quote->getShippingAddress()->addData($orderData['shipping_address']);

// Collect Rates and Set Shipping & Payment Method

$shippingAddress=$quote->getShippingAddress();
$shippingAddress->setCollectShippingRates(true)
->collectShippingRates()
->setShippingMethod('freeshipping_freeshipping'); //shipping method
$quote->setPaymentMethod('checkmo'); //payment method
$quote->setInventoryProcessed(false); //not effetc inventory

// Set Sales Order Payment
$quote->getPayment()->importData(['method' => 'checkmo']);
$quote->save(); //Now Save quote and your quote is ready

// Collect Totals
$quote->collectTotals();

// Create Order From Quote
$quote = $this->cartRepositoryInterface->get($quote->getId());
$orderId = $this->cartManagementInterface->placeOrder($quote->getId());
$order = $this->order->load($orderId);

$order->setEmailSent(0);
$increment_id = $order->getRealOrderId();
if($order->getEntityId()){
$result['order_id']= $order->getRealOrderId();
}else{
$result=['error'=>1,'msg'=>'Your custom message'];
}
echo $result['order_id'];
//return $result;
}//end of function create order
}


below is my sample data set



$tempOrder=[
'currency_id' => 'USD',
'email' => 'testmuja@muja.com', //buyer email id
'shipping_address' =>[
'firstname' => 'mujiko', //address Details
'lastname' => 'jikimo',
'street' => 'xxxxx',
'city' => 'xxxxx',
'country_id' => 'US',
'region' => '12',
'postcode' => '43244',
'telephone' => '52332',
'fax' => '32423',
'save_in_address_book' => 1
],
'items'=> [ //array of product which order you want to create
['product_id'=>'1','qty'=>4],
['product_id'=>'10','qty'=>3]

]
];


what my issue is order is creating, but the products are not adding properly.
only 1 product is adding to the order, but first product added to the order with the second product price and qty of the product will be a total products in order.
Ex:



['product_id'=>'1','qty'=>4],
['product_id'=>'10','qty'=>3]


from above product array name of the product_id 1 - Product 1, price 10.00



name of the product_id 10 - product 2, price 20.00



In my order the product is save as product 1 with price of Product 2(20) qty is 7



Any help highly appreciate and almost 3 days tried in several ways and still fail.Please help me.









share



























    0















    I am in a process of creating orders programatically in magento 2.
    below is my code.



    <?php
    namespace Eight65mediaMpowerSyncHelper;
    use MagentoFrameworkAppHelperAbstractHelper;
    class Data extends AbstractHelper{

    protected $scopeConfig;
    protected $loggerInterface;

    public function __construct(
    PsrLogLoggerInterface $loggerInterface,
    MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
    MagentoFrameworkAppHelperContext $context,
    MagentoStoreModelStoreManagerInterface $storeManager,
    MagentoCatalogModelProduct $product,
    MagentoCatalogModelProductFactory $productFactory,
    MagentoQuoteApiCartRepositoryInterface $cartRepositoryInterface,
    MagentoQuoteApiCartManagementInterface $cartManagementInterface,
    MagentoCustomerModelCustomerFactory $customerFactory,
    MagentoCustomerApiCustomerRepositoryInterface $customerRepository,
    MagentoSalesModelOrder $order
    ) {

    $this->logger = $loggerInterface;
    $this->_scopeConfig = $scopeConfig;
    $this->_productFactory = $productFactory;
    $this->_storeManager = $storeManager;
    $this->_product = $product;
    $this->cartRepositoryInterface = $cartRepositoryInterface;
    $this->cartManagementInterface = $cartManagementInterface;
    $this->customerFactory = $customerFactory;
    $this->customerRepository = $customerRepository;
    $this->order = $order;
    }


    public function createMageOrder($orderData) {
    $store=$this->_storeManager->getStore();
    $websiteId = $this->_storeManager->getStore()->getWebsiteId();
    $customer=$this->customerFactory->create();
    $customer->setWebsiteId($websiteId);
    $customer->loadByEmail($orderData['email']);// load customet by email address
    if(!$customer->getEntityId()){
    //If not avilable then create this customer
    $customer->setWebsiteId($websiteId)
    ->setStore($store)
    ->setFirstname($orderData['shipping_address']['firstname'])
    ->setLastname($orderData['shipping_address']['lastname'])
    ->setEmail($orderData['email'])
    ->setPassword($orderData['email']);
    $customer->save();
    }

    $cartId = $this->cartManagementInterface->createEmptyCart(); //Create empty cart
    $quote = $this->cartRepositoryInterface->get($cartId); // load empty cart quote
    $quote->setStore($store);
    // if you have allready buyer id then you can load customer directly
    $customer= $this->customerRepository->getById($customer->getEntityId());
    $quote->setCurrency();
    $quote->assignCustomer($customer); //Assign quote to customer

    //add items in quote
    foreach($orderData['items'] as $item){
    echo "+ ".$item['product_id']."</br>";
    $product = $this->_product->load($item['product_id']);
    //$product->setPrice($item['price']);
    $quote->addProduct($product, intval($item['qty']));
    }

    //Set Address to quote
    $quote->getBillingAddress()->addData($orderData['shipping_address']);
    $quote->getShippingAddress()->addData($orderData['shipping_address']);

    // Collect Rates and Set Shipping & Payment Method

    $shippingAddress=$quote->getShippingAddress();
    $shippingAddress->setCollectShippingRates(true)
    ->collectShippingRates()
    ->setShippingMethod('freeshipping_freeshipping'); //shipping method
    $quote->setPaymentMethod('checkmo'); //payment method
    $quote->setInventoryProcessed(false); //not effetc inventory

    // Set Sales Order Payment
    $quote->getPayment()->importData(['method' => 'checkmo']);
    $quote->save(); //Now Save quote and your quote is ready

    // Collect Totals
    $quote->collectTotals();

    // Create Order From Quote
    $quote = $this->cartRepositoryInterface->get($quote->getId());
    $orderId = $this->cartManagementInterface->placeOrder($quote->getId());
    $order = $this->order->load($orderId);

    $order->setEmailSent(0);
    $increment_id = $order->getRealOrderId();
    if($order->getEntityId()){
    $result['order_id']= $order->getRealOrderId();
    }else{
    $result=['error'=>1,'msg'=>'Your custom message'];
    }
    echo $result['order_id'];
    //return $result;
    }//end of function create order
    }


    below is my sample data set



    $tempOrder=[
    'currency_id' => 'USD',
    'email' => 'testmuja@muja.com', //buyer email id
    'shipping_address' =>[
    'firstname' => 'mujiko', //address Details
    'lastname' => 'jikimo',
    'street' => 'xxxxx',
    'city' => 'xxxxx',
    'country_id' => 'US',
    'region' => '12',
    'postcode' => '43244',
    'telephone' => '52332',
    'fax' => '32423',
    'save_in_address_book' => 1
    ],
    'items'=> [ //array of product which order you want to create
    ['product_id'=>'1','qty'=>4],
    ['product_id'=>'10','qty'=>3]

    ]
    ];


    what my issue is order is creating, but the products are not adding properly.
    only 1 product is adding to the order, but first product added to the order with the second product price and qty of the product will be a total products in order.
    Ex:



    ['product_id'=>'1','qty'=>4],
    ['product_id'=>'10','qty'=>3]


    from above product array name of the product_id 1 - Product 1, price 10.00



    name of the product_id 10 - product 2, price 20.00



    In my order the product is save as product 1 with price of Product 2(20) qty is 7



    Any help highly appreciate and almost 3 days tried in several ways and still fail.Please help me.









    share

























      0












      0








      0








      I am in a process of creating orders programatically in magento 2.
      below is my code.



      <?php
      namespace Eight65mediaMpowerSyncHelper;
      use MagentoFrameworkAppHelperAbstractHelper;
      class Data extends AbstractHelper{

      protected $scopeConfig;
      protected $loggerInterface;

      public function __construct(
      PsrLogLoggerInterface $loggerInterface,
      MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
      MagentoFrameworkAppHelperContext $context,
      MagentoStoreModelStoreManagerInterface $storeManager,
      MagentoCatalogModelProduct $product,
      MagentoCatalogModelProductFactory $productFactory,
      MagentoQuoteApiCartRepositoryInterface $cartRepositoryInterface,
      MagentoQuoteApiCartManagementInterface $cartManagementInterface,
      MagentoCustomerModelCustomerFactory $customerFactory,
      MagentoCustomerApiCustomerRepositoryInterface $customerRepository,
      MagentoSalesModelOrder $order
      ) {

      $this->logger = $loggerInterface;
      $this->_scopeConfig = $scopeConfig;
      $this->_productFactory = $productFactory;
      $this->_storeManager = $storeManager;
      $this->_product = $product;
      $this->cartRepositoryInterface = $cartRepositoryInterface;
      $this->cartManagementInterface = $cartManagementInterface;
      $this->customerFactory = $customerFactory;
      $this->customerRepository = $customerRepository;
      $this->order = $order;
      }


      public function createMageOrder($orderData) {
      $store=$this->_storeManager->getStore();
      $websiteId = $this->_storeManager->getStore()->getWebsiteId();
      $customer=$this->customerFactory->create();
      $customer->setWebsiteId($websiteId);
      $customer->loadByEmail($orderData['email']);// load customet by email address
      if(!$customer->getEntityId()){
      //If not avilable then create this customer
      $customer->setWebsiteId($websiteId)
      ->setStore($store)
      ->setFirstname($orderData['shipping_address']['firstname'])
      ->setLastname($orderData['shipping_address']['lastname'])
      ->setEmail($orderData['email'])
      ->setPassword($orderData['email']);
      $customer->save();
      }

      $cartId = $this->cartManagementInterface->createEmptyCart(); //Create empty cart
      $quote = $this->cartRepositoryInterface->get($cartId); // load empty cart quote
      $quote->setStore($store);
      // if you have allready buyer id then you can load customer directly
      $customer= $this->customerRepository->getById($customer->getEntityId());
      $quote->setCurrency();
      $quote->assignCustomer($customer); //Assign quote to customer

      //add items in quote
      foreach($orderData['items'] as $item){
      echo "+ ".$item['product_id']."</br>";
      $product = $this->_product->load($item['product_id']);
      //$product->setPrice($item['price']);
      $quote->addProduct($product, intval($item['qty']));
      }

      //Set Address to quote
      $quote->getBillingAddress()->addData($orderData['shipping_address']);
      $quote->getShippingAddress()->addData($orderData['shipping_address']);

      // Collect Rates and Set Shipping & Payment Method

      $shippingAddress=$quote->getShippingAddress();
      $shippingAddress->setCollectShippingRates(true)
      ->collectShippingRates()
      ->setShippingMethod('freeshipping_freeshipping'); //shipping method
      $quote->setPaymentMethod('checkmo'); //payment method
      $quote->setInventoryProcessed(false); //not effetc inventory

      // Set Sales Order Payment
      $quote->getPayment()->importData(['method' => 'checkmo']);
      $quote->save(); //Now Save quote and your quote is ready

      // Collect Totals
      $quote->collectTotals();

      // Create Order From Quote
      $quote = $this->cartRepositoryInterface->get($quote->getId());
      $orderId = $this->cartManagementInterface->placeOrder($quote->getId());
      $order = $this->order->load($orderId);

      $order->setEmailSent(0);
      $increment_id = $order->getRealOrderId();
      if($order->getEntityId()){
      $result['order_id']= $order->getRealOrderId();
      }else{
      $result=['error'=>1,'msg'=>'Your custom message'];
      }
      echo $result['order_id'];
      //return $result;
      }//end of function create order
      }


      below is my sample data set



      $tempOrder=[
      'currency_id' => 'USD',
      'email' => 'testmuja@muja.com', //buyer email id
      'shipping_address' =>[
      'firstname' => 'mujiko', //address Details
      'lastname' => 'jikimo',
      'street' => 'xxxxx',
      'city' => 'xxxxx',
      'country_id' => 'US',
      'region' => '12',
      'postcode' => '43244',
      'telephone' => '52332',
      'fax' => '32423',
      'save_in_address_book' => 1
      ],
      'items'=> [ //array of product which order you want to create
      ['product_id'=>'1','qty'=>4],
      ['product_id'=>'10','qty'=>3]

      ]
      ];


      what my issue is order is creating, but the products are not adding properly.
      only 1 product is adding to the order, but first product added to the order with the second product price and qty of the product will be a total products in order.
      Ex:



      ['product_id'=>'1','qty'=>4],
      ['product_id'=>'10','qty'=>3]


      from above product array name of the product_id 1 - Product 1, price 10.00



      name of the product_id 10 - product 2, price 20.00



      In my order the product is save as product 1 with price of Product 2(20) qty is 7



      Any help highly appreciate and almost 3 days tried in several ways and still fail.Please help me.









      share














      I am in a process of creating orders programatically in magento 2.
      below is my code.



      <?php
      namespace Eight65mediaMpowerSyncHelper;
      use MagentoFrameworkAppHelperAbstractHelper;
      class Data extends AbstractHelper{

      protected $scopeConfig;
      protected $loggerInterface;

      public function __construct(
      PsrLogLoggerInterface $loggerInterface,
      MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
      MagentoFrameworkAppHelperContext $context,
      MagentoStoreModelStoreManagerInterface $storeManager,
      MagentoCatalogModelProduct $product,
      MagentoCatalogModelProductFactory $productFactory,
      MagentoQuoteApiCartRepositoryInterface $cartRepositoryInterface,
      MagentoQuoteApiCartManagementInterface $cartManagementInterface,
      MagentoCustomerModelCustomerFactory $customerFactory,
      MagentoCustomerApiCustomerRepositoryInterface $customerRepository,
      MagentoSalesModelOrder $order
      ) {

      $this->logger = $loggerInterface;
      $this->_scopeConfig = $scopeConfig;
      $this->_productFactory = $productFactory;
      $this->_storeManager = $storeManager;
      $this->_product = $product;
      $this->cartRepositoryInterface = $cartRepositoryInterface;
      $this->cartManagementInterface = $cartManagementInterface;
      $this->customerFactory = $customerFactory;
      $this->customerRepository = $customerRepository;
      $this->order = $order;
      }


      public function createMageOrder($orderData) {
      $store=$this->_storeManager->getStore();
      $websiteId = $this->_storeManager->getStore()->getWebsiteId();
      $customer=$this->customerFactory->create();
      $customer->setWebsiteId($websiteId);
      $customer->loadByEmail($orderData['email']);// load customet by email address
      if(!$customer->getEntityId()){
      //If not avilable then create this customer
      $customer->setWebsiteId($websiteId)
      ->setStore($store)
      ->setFirstname($orderData['shipping_address']['firstname'])
      ->setLastname($orderData['shipping_address']['lastname'])
      ->setEmail($orderData['email'])
      ->setPassword($orderData['email']);
      $customer->save();
      }

      $cartId = $this->cartManagementInterface->createEmptyCart(); //Create empty cart
      $quote = $this->cartRepositoryInterface->get($cartId); // load empty cart quote
      $quote->setStore($store);
      // if you have allready buyer id then you can load customer directly
      $customer= $this->customerRepository->getById($customer->getEntityId());
      $quote->setCurrency();
      $quote->assignCustomer($customer); //Assign quote to customer

      //add items in quote
      foreach($orderData['items'] as $item){
      echo "+ ".$item['product_id']."</br>";
      $product = $this->_product->load($item['product_id']);
      //$product->setPrice($item['price']);
      $quote->addProduct($product, intval($item['qty']));
      }

      //Set Address to quote
      $quote->getBillingAddress()->addData($orderData['shipping_address']);
      $quote->getShippingAddress()->addData($orderData['shipping_address']);

      // Collect Rates and Set Shipping & Payment Method

      $shippingAddress=$quote->getShippingAddress();
      $shippingAddress->setCollectShippingRates(true)
      ->collectShippingRates()
      ->setShippingMethod('freeshipping_freeshipping'); //shipping method
      $quote->setPaymentMethod('checkmo'); //payment method
      $quote->setInventoryProcessed(false); //not effetc inventory

      // Set Sales Order Payment
      $quote->getPayment()->importData(['method' => 'checkmo']);
      $quote->save(); //Now Save quote and your quote is ready

      // Collect Totals
      $quote->collectTotals();

      // Create Order From Quote
      $quote = $this->cartRepositoryInterface->get($quote->getId());
      $orderId = $this->cartManagementInterface->placeOrder($quote->getId());
      $order = $this->order->load($orderId);

      $order->setEmailSent(0);
      $increment_id = $order->getRealOrderId();
      if($order->getEntityId()){
      $result['order_id']= $order->getRealOrderId();
      }else{
      $result=['error'=>1,'msg'=>'Your custom message'];
      }
      echo $result['order_id'];
      //return $result;
      }//end of function create order
      }


      below is my sample data set



      $tempOrder=[
      'currency_id' => 'USD',
      'email' => 'testmuja@muja.com', //buyer email id
      'shipping_address' =>[
      'firstname' => 'mujiko', //address Details
      'lastname' => 'jikimo',
      'street' => 'xxxxx',
      'city' => 'xxxxx',
      'country_id' => 'US',
      'region' => '12',
      'postcode' => '43244',
      'telephone' => '52332',
      'fax' => '32423',
      'save_in_address_book' => 1
      ],
      'items'=> [ //array of product which order you want to create
      ['product_id'=>'1','qty'=>4],
      ['product_id'=>'10','qty'=>3]

      ]
      ];


      what my issue is order is creating, but the products are not adding properly.
      only 1 product is adding to the order, but first product added to the order with the second product price and qty of the product will be a total products in order.
      Ex:



      ['product_id'=>'1','qty'=>4],
      ['product_id'=>'10','qty'=>3]


      from above product array name of the product_id 1 - Product 1, price 10.00



      name of the product_id 10 - product 2, price 20.00



      In my order the product is save as product 1 with price of Product 2(20) qty is 7



      Any help highly appreciate and almost 3 days tried in several ways and still fail.Please help me.







      magento2.2 orders programmatically





      share












      share










      share



      share










      asked 7 mins ago









      MujahidhMujahidh

      1,40012036




      1,40012036






















          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%2f265833%2fonly-1-product-adding-to-order-when-creating-orders-programatically-in-magento-2%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%2f265833%2fonly-1-product-adding-to-order-when-creating-orders-programatically-in-magento-2%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

          “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

          How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

          變成蝙蝠會怎樣? 參考資料 外部連結 导航菜单Thomas Nagel, "What is it like to be a...