Initialise magento 2 products import script

This tutorial explains how to initialise magento 2 products import script. Please click here to veiw the full code with detailed explanation. The code reads data from the CSV and bulk import the products programmatically.

import_magento_2_products_programmatically

Please also refer the tutorial that explains how to delete products and categories programmatically.

<?php
define('DS', DIRECTORY_SEPARATOR); 
use \Magento\Framework\App\Bootstrap;

include('../app/bootstrap.php');
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$app_state = $objectManager->get('\Magento\Framework\App\State');
$app_state->setAreaCode('frontend');

$productsData = getProducts();
importSimpleProducts( $productsData , $objectManager );

Share this Tutorial