skip to Main Content

I have exported Magento-1 Order details into csv file.

I Need to import those order details into Magento2 site via programatically.
I can able to update the order grand total already present in the orders.

Need to create a order programatically,

Here i have mentioned the Order update code

<?php
use MagentoFrameworkAppBootstrap;
include('app/bootstrap.php');
ini_set('display_errors', 1);
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
use MagentoSalesModelOrder;
$orderId = 000000002;
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$order = $objectManager->create('MagentoSalesModelOrder')->load($orderId);
$orderState = Order::STATE_PROCESSING;
$order->setGrandTotal(50.00);
$order->setState($orderState)->setStatus(Order::STATE_PROCESSING);
$order->save();
echo "Order Updated successfully";

Can anyone suggest some ideas for create order via similar method.

Thanks in Advance.

2

Answers


  1. you can just install this tool and configure this
    after that you can select order, catalog, etc to import in your Magento2 store from Magento1

    Login or Signup to reply.
  2. You can use Magento’s default migration tool. Which can not even orders but it will import the products, attributes, attributes set etc. Almost all the data from Magento 1 to Magento 2. You can select what you want to migrate from Magento 1 to Magento 2.

    I had personally used it and it’s really work fine. Below is the URL it may help you.

    http://devdocs.magento.com/guides/v2.0/migration/migration-tool-install.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search