Logo Wyomind Magento workshop

Add-ons for Magento®

Mass Product Import & Update allows you to update and import products massively in Magento in record time through CSV or XML files available from your website's server, or any remote server through FTP or HTTP.

26 Reviews
expand

Mass Product Import & Update allows you to update or import massively products in Magento in a record time thanks to CSV and XML files available from your website's server, from remote servers through FTP or HTTP.

Mass Product Import & Update allows to create and/or update the below product attributes for all store views or specific store views:

  • All system attributes (SKU, type, attribute set, visibility, status)
  • All product attributes created within Magento (input, dropdown, yes/no, multi select, text...)
  • All product image attributes (image gallery, base image, thumbnail, small images...)
  • All stock attributes (qty, availability, backorder, manage stock, low stock notification…)
  • Categories associated with products
  • Prices, special prices, special price dates, tax class…

How to configure Mass Product Import & Update

To use Mass Product Import & Update, you first have to go in:
SystemConfigurationWyomindMass Product Import & Update

Configure Mass Product Import & Update in a general way

Email reporting

Mass Product Import & Update includes a reporting tool that notifies you each time a profile runs, and if so an error happens.

For more details about the cron tasks, look at the below section: 
Configure the cron tasks in a profile

Enable reporting

Allows you to define whether you want to enable the reporting or not.

Send the reports to

Allows you to specify the email addresses to which the report must be sent. 

For several email addresses, you must use the comma as separator.

Report title

Allows you to define the title of the emails sent by the reporting tool

Settings

Mass Product Import & Update also includes a log file that you can enable. 

Enable log file

Allows you to activate the log file available under the var/log directory. The file is named Wyomind_MassStockUpdate.log.
The log file will be written only if the primary log file is active in:
System Configuration Advanced  Developer  Logs settings

Create an import profile in Mass Product Import & Update

To update Magento products or to create new products, you have to first create a new profile from:
SystemImport/ExportMass PRODUCT IMPORT & Update

There, you should find some sample profiles that you can edit. To create a new profile, click on Create a new profile .

Black box

The black-box is a tool that will help you configure your mapping seamlessly. It is composed of 3 major features. 

Input Data

To get a preview of the input data, click on Input data .

Output Data

Clicking on Output data  will give you a preview of the data as they'll be updated. 

Library

The library allows you to check what are the values you can use for each attribute.  

You will also find some examples to help you. 

Settings

In this section, you will be able to define the source of the data.

Profile setting

  • Profile name
    Only alphabetic and numbers are allowed + hyphens (-) and underscores (_).
    Profile's name must be unique.
  • Profile Method
    You can choose the action that the profile will trigger:

    Update products only
    Import new products only
    Update products and import new products

  • SQL mode
    When SQL mode is enabled, no data are updated or imported. Running the profile will only produce a SQL file. This file could be executed directly in your database manager.

If you activate SQL mode, you'll need to fill in several fields:

  • SQL file path
    is where the SQL file will be generated (relative to Magento root folder).
  • SQL file name
    is the name of the SQL file to generate.


You can then click Input data from the blackbox to see your source file. 

File location

This section allows you to specify where the source data file is stored. You have many options:

  • Magento File System
    The file is stored in the Magento root directory or a subdirectory of the Magento root directory.
  • FTP server
    The file is stored on a remote server available from FTP or SFTP
  • Url
    The file is stored on a remote server available from HTTP or HTTPS.
    If you're using the authentication, add the login and password directly in the corresponding fields.
  • Dropbox
    The file is stored in a dropbox. You can generate your token from your Dropbox account https://www.dropbox.com/developers/apps
  • Webservice
    The file can be stored in any web services.

Note you can drag and drop files from your desktop. Only TXT, CSV or XML files are allowed.

File Type

Allows you to specify the file type used for the update, XML or CSV.

  • File type
    You have the choice between CSV and XML files.

For CSV files, define: 

  • Field separator
    Define the field separator.
  • Field enclosure
    Select the field enclosure. 

For XML files, define:

  • Xpath to products
    In case of an update from an XML file, fill in the XPath that targets the products. The Xpath is case sensitive.

    File sample
    <Import>
       <PRODUCTS>
          <product>
             <name>Product A</name>
             <sku>001A</sku>
             <qty>864</qty>
          </product>
          <product>
             <name>Product B</name>
             <sku>002B</sku>
             <qty>594</qty>
          </product>
       </PRODUCTS>
    </Import>
    The XPath that targets the products in the above file is /Import/PRODUCTS/product

  •  XML structure
    You have two options; the Automatic detection or the Predefined structure. The automatic detection fits for simple files made of only one nesting level such as the above file sample.
  • Predefined structure
    If you've selected the Predefined structure, you have the possibility to define your own file structure. When the structure of your file is quite complex, the info may be dispatched in deep nodes and sometimes in tag attributes such as url="something". 

    Below is an example of complex file where you need a predefined structure:
    <offers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1">
       <offer price="165.07" msrp="189.00" availability="3">
          <name><![CDATA[Amazing product]]></name>
          <images>
             <img url="https://www.example.com/path/to/product/image/1.jpg" />
             <img url="https://www.example.com/path/to/product/image/2.jpg" />
          </images>
          <videos />
          <categories>
             <category><![CDATA[Category A]]></category>
             <category><![CDATA[Category B]]></category>
             <category><![CDATA[Category C]]></category>
          </categories>
          <description><![CDATA[Amazing product description]]></description>
          <attributes>
             <attibute name="sku"><![CDATA[XYZ]]></attibute>
             <attibute name="ean"><![CDATA[123456789]]></attibute>
             <attibute name="tax"><![CDATA[VAT 20%]]></attibute>
          </attributes>
       </offer>
    </offers>
    The XPath that targets the products in the above file is /offers/offer
    The JSON syntax you need to use is:
    { 
    "sku":"/offer/attributes/attribute[@name='sku']",
    "ean":"/offer/attributes/attribute[@name='ean']",
    "price":"/offer/@price",
    "msrp":"/offer/@msrp",
    "tax":"/offer/attributes/attribute[@name='tax']",
    "name":"/offer/name",
    "description":"/offer/description",
    "category_1":"/offer/categories/category[1]",
    "category_2":"/offer/categories/category[2]",
    "category_3":"/offer/categories/category[3]",
    "image_1":"/offer/images/img[1]/@url",
    "image_2":"/offer/images/img[2]/@url"
    }

DIRECTIONS FOR USE IN THE PREDEFINED XML STRUCTURE FIELD

  • Use a valid Json string made of a key/value list that define the column names and the Xpath associated to the columns.
  • Use to access the attribute values. For example: @price.
  • Use [@attribute=value] to access a node from which the attribute is value. For example: [@name='ean'].
  • Use [number] to access another node that has the same name. For example: category

Advanced Settings

System Settings

  • The first line is a header
    For CSV files, you need to specify when the first line is a header.
  • Filter lines
    Leave empty to export all lines:
    e.g:
    means all lines will be imported

    Type the numbers of the lines you want to import, making sure to separate each line or range with a comma (,):
    e.g: 2,4,6,8,10 
    means lines 2,4,6,8,10 will be imported

    Use a dash (-) to denote a range of lines:

    e.g: 8-10
    means lines 8,9,10 will be imported

    Use a plus (+) to import all lines from a line number:
    e.g: 4+
    means all lines from line 4 will be imported

Note you can combine all those options. For example 2,6-10,15+ means line 2,6,7,8,9,10,15,16,17,... will be imported.

  • Automatic action for missing products
    Define what to do for each product that is missing from the data file. You have several options:
    Do Nothing
    Disable the product
    Delete permanently the product
    Mark the product as out of stock
  • Target
    When a product is imported using Mass Product Import & Update, it is associated with the profile. If you've selected an action for missing products, you'll need to choose a target: 
    Only products related to current profile: products that are imported/updated with the same profile.
    Only products not related to current profile: all the products that are not created/updated by the profile.
    All products

Stock Settings

Automatic stock status update:
You can choose to automatically update the stock status (in stock / out of stock).

Image Settings

Indicates the path to the directory in which the images to import are stored.
  • Images location
    Http server (url)
    Magento File System
    Ftp server

Depending on what you've selected as the images location, you'll need to fill in several fields. 

For the FTP server: 

  • Use SFTP
  • Use active mode
  • Host
  • Login
  • Password

For the FTP Server and the Magento file System:

  • Path to images directory

Category Settings

 Mass Product Import & Update allows you to create categories on the fly. 
  • Create categories on the fly
    Yes or N
    o
  • New categories active by default
    Yes or No
  • New categories included in menu by default
    Yes or No
  • Category tree auto-detection
    To automatically detect the category tree.
    You need to use the complete path to the category. The category levels must be separated with slashes: A/B/C.
    For example, instead of "Shirts", you should write:
    Default Category/Men/Shirts
    When the Category tree auto-detection is disabled, the category is added to the root category defined in New categories are children of.
  • New categories are children of
    Choose the parent category.

When the categories associated with the products are updated, then all previous products and categories associations are deleted. 

For more details about the configuration of the category attribute, please have a look to our documentation

Configurable Product Settings

Create parent of configurable products on the fly 
You can also manage configurable products selecting Yes. 

The aim of that option is to allow you to create a configurable product on the fly that includes the simple products.

When that option is on Yes, in the Mapping & Rules tab, you can find for each Target attribute dropdown an option for the configurable products to create on the fly.

For example, if in a file you have:

TShirt TShirt-L-R Large red
TShirt TShirt-L-B Large blue
TShirt TShirt-XL-R Xlarge red
TShirt TShirt-XL-B Xlarge blue

You will then be able to link the products of the file per groups in configurable products.

DIRECTIONS FOR USE

  • The simple products and the configurable one to create on the fly must be created at the same time. It's not possible to update the simple products and create the configurable on the fly.
  • You need to precise the SKU of the parent product (Configurable Products > Parent SKU).
  • You need to precise the attributes that can vary (Configurable Products > Configurable Attributes = list of attribute codes separated with comma).
  • All the attributes needed for the products creation must be mapped (sku, attribute set...) for the simple products and for the configurable one (so you must have the data in the source file or create lines of mapping with custom values).

Note that if you want to update or import a product whether it is a configurable or not, you need to use standard attributes.

Mapping & Rules

In this section you can map each column of the source file with one of the Magento attributes.

Column Mapping

Each column can be mapped with one of the stock attributes. Note that at any time, you can preview the input and output data in the black box directly.
  • Target Attribute 
    Select the target attribute from the ones available in your system (the first line is where you define the identifier of your products). You can find all the attributes grouped by type in our documentation.
  • Data source
    In the Data source, you can define the attribute source that matches with the target attribute from your source file.
  • Custom value
    Sometimes, some columns can be missing. For example, when updating all stocks, the file does not necessarily include all stock attributes (backorders, minimum quantity in the cart...). In that case, you can choose custom value in the Data source and apply a default value.

QUICK OVERVIEW OF THE INTERFACE

  1. Add as many columns as you want by clicking on . In many cases, the update file may contain more columns than necessary; you don't need to add these columns and match them. 
  2. Delete  a row easily.
  3. Change the order of each row using the drag and drop.
  4. Deactivate a line while conserving the settings by clicking on the link  symbol.
  5. Add your own custom script </> .  These scripts can be previewed in the output. Check How to use the API
    Note that when there is a script filled in </>  is underlined.
  6. Apply the color of your choice to the row.
  7. Apply a label to the row.
  8. Define to which storeview(s) you want to apply these settings by clicking APPLY TO DEFAULT VALUE 
  9. Define to which product(s) you want to apply these settings by clicking APPLY TO THE CURRENT PRODUCT ONLY .
  10. Preview your file by clicking INPut Data .
  11. Find all the attributes grouped by type in the Library .
  12. Check the data as they'll be updated by clicking Output Data .

Scheduled tasks

You can schedule the profile to be executed for all days of the week and with a minimum interval of 30 minutes between each execution.For a good working of the scheduled tasks in Mass Product Import & Update, the main cron task in Magento must be configured properly.

Run a Mass Product Import & Update profile

You have several ways to run your profiles. 

From the profiles grid

To run the profile from the grid, you just need to click on RUN Profile  in the action menu on the right column. Then the status will be updated with a progress bar.

From the profile page

Open the profile and then click on RUN Profile NOW . Once the import/update process has ended, a message appears with details about how many products have been updated/imported and how many products have been ignored. 

With the cron tasks

When the scheduled tasks are configured for the profile, then the profile will be automatically run at the day and the time selected.

For a good working of the scheduled tasks in Mass Product Import & Update, the main cron task in Magento must be configured properly.

For more details about how to configure the cron tasks in Magento, you can have a look to the official Magento user guide: 
http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html

You will receive an email each time the cron task is run if you have enabled the reporting in:
system configuration Mass Product Import & Update

To configure the reporting, have a look to: Email reporting

With the Command Lines Interface

Mass Product Import & Update includes command lines available from any shell console.

php -f shell/wyomind_massproductimport.php -- [options]

The parameters to use are:

  • -h 
    Short alias for help
  • --run id1,id2,...,idN 
    Generate profile from the given list
  • --sql  id1,id2,...,idN   
    Execute the sql file generated by the profile from the given list
  • --list
    List all profiles

SQL option usage

Updating or importing products massively may keep your server busy sometimes, especially when the update or the import includes a large number of products and/or many attributes.

For better performances Mass Product Import & Update split the process into two distinct steps:

  1. Source file analysis: the data is collected and the SQL queries for the update/import are built. 
  2. The SQL file execution: the data base is updated with the new data. This step may be executed asynchronously when shell option is enabled.

Generate the SQL file

If you prefer to generate the SQL file without executing it, you must enable the SQL mode in your profile configuration. 

Then run the profile by clicking on RUN NOW 

Execute the SQL file

Once the file is generated in the working directory (see Settings), you only need to update the database with the generated file from the command line as follows: 

mysql -h host -p DbPassword -u DbLogin DatabaseName < path/to/mysql/file.sql

You can also use the command line: 

php -f shell/wyomind_massproductimport.php --sql id1

Attribute specifications to import or to update

System attributes 

The below attributes are required when importing new products

If these attributes are not available in the mapping then the imported products will be visible neither in the front-end or the back-end.

The system attributes have a global scope and cannot be updated/imported specifically for each store view.

Sku

The unique identifier of the product to update or to import

Attribute set

The attribute set to apply to the product.

You can either use the attribute set name (case insensitive) or the attribute set ID.

To know the attribute sets available in your system, go to:
Catalog AttributesManage attributE Sets

Type

The product type:
  • simple,
  • configurable,
  • grouped,
  • bundle,
  • virtual,
  • downloadable
  • or any custom product type

You must use the product type name (case insensitive).

Website

The website(s) to which belongs the product.

You can either use the website name (case insensitive) or the website ID.

To know the names and  the ids of the websites available in your system, go to:
systemManage stores

Tax Class

The product tax class.

You must either use the tax class name (case insensitive) or the tax class ID of the product.

To know the names and the ids of the tax classes available in your system, go to:
SalesTaxPRoduct tax classes

Visibility

The product visibility: 
  • Not visible Individually (1),
  • Catalog (2),
  • Search (3),
  • Catalog & Search (4)

You can either use the visibility name (case insensitive) or the numerical value associated.

Status

The status of the product:
  • enabled
  • disabled

You can use any of the below values:

  • enabled / disabled
  • enable / disable
  • true / false
  • yes / no
  • 1 / 0

Products attributes

All attributes created in your stores and/or any attributes that are listed in another section are available in the product attributes section.

Text or textarea attribute

The text or textarea attributes accept any value without any restriction.

Yes/no attribute

The yes/no attributes can be updated with any of the below values:
  • enabled / disabled
  • enable / disable
  • true / false
  • yes / no
  • 1 / 0

Drop-down or multi-select attributes

The drop-down attributes can be updated either with the option label or with the option id.

The multi-select attributes can be updated either with a list of option labels or a list of option ids separated with a comma.

To know the labels and ids of the drop-down and multi-select attributes, go to:
Catalog AttributesManage attributE edit attributE Manager label / option

Date attributes

The date attributes must be formatted as follows: YYYY-MM-DD hh:mm::ss.
If the dates are misformatted in the update/import source file, then you must use your own custom script. 

Price attributes

The price attributes must be formatted with a dot as decimal separator.

You may need to use customer group ids, for example when importing Tier Prices. Below is the list of the codes to use: 

  • *: All groups
  • 0: Not logged in
  • 1: General
  • 2: Wholesale
  • 3: Retailer
  • 4: VIP Member
  • 5: Private Sales Member
If the prices are misformatted in the update/import source file, then you must use your own custom script. 

Stock attributes

All attributes related to the stock management in Magento are available in this section.

All these attributes must be updated with numeric values or boolean values.

Boolean values

Boolean values must be updated with one of the below values:
  • 1 / 0
  • yes / no
  • true / false
  • enable / disable
  • enabled / disabled
  • in stock / out of stock

Numeric values

 Numeric values must be updated with one of the below types:
  • Integer number (no white space)
  • Float number (decimal separated by a dot)

If the values are misformatted in the update/import source file, then you must use your own custom script. 

Advanced Inventory attributes

All attributes related to the stock management in Advanced Inventory are available in this section.

All these attributes must be updated with numeric values or boolean values.

Boolean values

Boolean values must be updated with one of the below values.
  • 1 / 0
  • yes / no
  • true / false
  • enable / disable
  • enabled / disabled
  • in stock / out of stock

Numeric values

 Numeric values must be updated with one of the below types
  • Integer number (no white space)
  • Float number (decimal separated by a dot)

If the values are misformatted in the update/import source file, then you must use your own custom script. 

Images attributes

All attributes related to the image management are available in this section.

The images source directory must be defined in the Image tab.

Image Gallery

The images to insert in the image gallery must be listed in the Image Gallery field as the relative path to the image source directory specified in the Images tab. 

Each image path must be separated by one of the below characters:

  • | (pipe)
  • , (comma)
  • ; (semi-colon)

Example

directory_1/directory_2/image-A.png;directory_1/directory_2/image_2.png;directory_3/image-XYZ.png;

You can optionally associate a label with each image by using the * (star) prefix and the label of the image.

Example

directory_1/directory_2/image-A.png*image A;directory_1/directory_2/image_2.png*image B;directory_3/image-XYZ.png*image XYZ;

Base Image, Thumbnail, Small Image

You can associate a specific image from the Image gallery to any image attribute.

By default the image attribute available in Magento are:

  • Base Image: image that appears on the product page
  • Small Image: image that appears on the category page
  • Thumbnail: image that appears on the cart, on the checkout, on the customer account...

If you have created your own image attributes in your stores, these attributes will be visible in this section.
When importing/updating the image attributes, Mass Product Import & Update will add the image to the image gallery automatically. The image source directory must be then specified in the Images tab.

Category attributes

The categories associated with the products can be imported/updated when at least one column of the mapping section is selected with the category value. 

The names or IDs of your categories can be used. They must be separated with comma. 

The categories will be created or not according to the parameters you have defined in Advanced settings.

Configurable product attributes

With Mass Stock Import & Update you can create configurable product on the fly and create relationship between children and parents.

Parent SKU

When updating/creating a simple product, you can add the configurable product reference so that the simple products will be automatically associated to the configurable product. 

Parent SKU
The child product must be updated/created with the configurable attributes required by the configurable product, example: color and size.

Children SKUs

When updating/creating a configurable product, you can add the children references so that the simple products will be automatically associated to the configurable product.

List of the children SKUs separated by commas

Configurable attributes

When creating/updating a configurable product, the configurable attributes must be specified.

Attribute code or attribute IDs separated by commas

If you don't provide these attributes when creating a new configurable products, then they will not appear on the front-end

Downloadable product attributes

With Mass Stock Import & Update you can import or update downloadable products.

Links title

Title of the downloadable resource.

Samples title

Title of the downloadable resource.

Link urls

Link to the file (relative or absolute path) and optional file's name separated by a pipe (|). 

For example:
http://www.example.com/filename.ext | My downloadable file

Sample urls

Link to the file (relative or absolute path) and optional file's name separated by a pipe (|).  

For example:
http://www.example.com/filename.ext | My downloadable file

PHP API for Mass Product Import & Update

Mass Product Import & Update allows you to fully customize and control the data output by using PHP scripts in different ways.

API coding standards 

For each line in the Mapping & Rules tab of your profile, you can add your own custom script based on a PHP syntax.

To add your custom script, click on </> at the end of the line you want to edit. You can then update on the file the value of each column.

Note that the </> button may be hidden by the blackbox. 

Opening and closing tags

Every script must include the opening PHP tag <?php. Note that it is not necessary to use the closing tag. 

<?php /* Your custom script */ return $self;​

Outputting a value

return
Any value that you want to output in your profile, must be returned with the return instruction.

$this object

$this->skip() or return false (boolean false)
To ignore the pending line (all the columns of the line).

$this->skipRow() or $this->skip() or return false;
To ignore the pending cell as well as all the following cells.

$this->skipCell() or return true;
To ignore the pending cell.

Variable $cell

You can call any column of the source file using $cell. It is an array that indexes each column numerically (1,2,3,...) and with a key corresponding to the name of the column header ("name","description","price"...).

$cell["name of the column"] or $cell[INDEX]

For example:

return $cell["description"]. " ".$cell["name"]

Note it is better to use associative keys. In that case, if the column order changes in the file, your scripts will still be valid.

Variable $self

$self
to retrieve the current value of the column and manipulate the data:

<?php return $self;

For example:

<?php return strtolower($self);

Examples of use

Below are some examples of use with the PHP API. 

Change the separator

Transform a number with a floating value separated with a dot instead of a comma.

For example:

<?php return number_format(str_replace(",",".",$self),2,".",""); ?>

Change a text to lowercase or capital letters

Change a text in lowercase and add a capital letter as the first letter of each word.

For example:

<?php return ucwords(strtolower($self)); ?>

Retrieve images

Retrieve only one image from a list of images. 

For example:

<?php return array_pop(explode(",",$self)); ?>

Group several columns

Put together several columns to create a description.

For example:

<?php return $self." ".$cell["product_name"].", starting at $".$cell["price"]; ?>

Define the visibility of a product

Define the visibility of a product depending on a column value.

For example:

<?php 

switch($self){
   case "parent":
      return "Catalog, Search";
   break;
   default:
      return "Not visible individually";
}
?>

Map value to other ones

Map values to other ones.

For example:

<?php 

if($self=="something"){
   return "something else";
}
else if($self=="foo"){
   return "bar";
}
else{
   return "default value";
}
?>