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
Send the reports to
For several email addresses, you must use the comma as a separator.
Report title
Settings
Mass Product Import & Update also includes a log file that you can enable.
Enable log file
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
Output Data
Library
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 (_).
The 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.
File location
This section allows you to specify where the source data file is stored and what is the file path (including the file name and extension). You have many options:
- Magento File System
The file is stored in the Magento root directory or a subdirectory of the Magento root directory.
File path relative to the Magento root folder.
You can use regular expression in the file name when it is set on Magento File System. - FTP server
The file is stored on a remote server available from FTP or SFTP.
File path relative to the FTP user root folder. - URL
The file is stored on a remote server available from HTTP or HTTPS.
The file path is the URL of the file.
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
The file path is the URL of the dropbox service - Webservice
The file can be stored in any web service.
The file path is the URL of the web service.
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
The XPath that targets the products in the above file is /Import/PRODUCTS/product<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>
- 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:
The XPath that targets the products in the above file is /offers/offer<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 JSON syntax you need to use is:{ "sku":"attributes/attribute[@name='sku']", "ean":"attributes/attribute[@name='ean']", "price":"@price", "msrp":"@msrp", "tax":"attributes/attribute[@name='tax']", "name":"name", "description":"description", "category_1":"categories/category[1]", "category_2":"categories/category[2]", "category_3":"categories/category[3]", "image_1":"images/img[1]/@url", "image_2":"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 defines the column names and the Xpath associated with the columns.
- Use @ to access the attribute values.
@price - Use [@attribute=value] to access a node from which the attribute is value.
[@name='ean'] - Use [number] to access another node that has the same name.
category - Use Xpath axis to represent a relationship to the current node, and locate nodes. For example, select all children/parent of the current node:
child::attributesparent::category
Post Process Action
Allows you to define an action after the profile is processed.
- Action
You have the choice between:
Do Nothing
Delete the import file
Move import file - Move to folder
File path relative to Magento root folder
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
Use regular expressions surrounded by # to indicate a particular group of identifiers to import:e.g: #ABC-[0-9]+#
means all lines with an identifier matching the regular expression 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
- Images location
Http server (URL)
Magento File System
Ftp server
Depending on what you've selected as the location of the images, 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
- Create categories on the fly
Yes or No - 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
- New categories are children of
Choose the parent category.
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 create/update a configurable product from the simple products available in the source file by enabling this option.
When that option is enabled, in the Mapping & Rules tab, you can find for each Target attribute dropdown an option for the configurable products to create on the fly. You have the choice to apply the settings on:
- The current product only
- The configurable product created on the fly only
- Both, configurable product created on the fly and simple product associated
System attributes of the configurable products created on the fly must receive a value either by mapping a field from the source file for the simple product and the configurable product or for the configurable product only.
So that the configurable product and the simples variants are linked, the following attributes must be mapped:
- the SKU of the parent product or the SKU of the children products
- the configurable attributes
- the Options Container attribute, if you create configurable products from a source file ("container1" is the default container in Magento)
Mapping & Rules
In this section, you can map each column of the source file with one of the Magento attributes.
Column Mapping
- 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 a custom value in the Data source and apply a default value.
QUICK OVERVIEW OF THE INTERFACE
- 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.
- Delete a row easily.
- Change the order of each row using the drag and drop.
- Deactivate a line while conserving the settings by clicking on the link symbol.
- 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. - Apply the color of your choice to the row.
- Apply a label to the row.
- Define to which store view(s) you want to apply these settings by clicking APPLY TO DEFAULT VALUE.
- Define to which product(s) you want to apply these settings by clicking APPLY TO THE CURRENT PRODUCT ONLY.
- Preview your file by clicking INPut Data.
- Find all the attributes grouped by type in the Library.
- Check the data as they'll be updated by clicking Output Data.
Scheduled tasks
You can schedule the profile to be executed each day of the week and with an interval of 30 minutes (by default) between each execution.
You can change the cron task interval from:
SystemConfigurationWyomindMass PRODUCT IMPORT & UpdateSettings
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 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
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:
- Source file analysis: the data is collected and the SQL queries for the update/import are built.
- The SQL file execution: the database is updated with the new data. This step may be executed asynchronously when the 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.
Sku
The unique identifier of the product to update or to import.
sku1
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.
bag
15
To know the attribute sets available in your system, go to:
Catalog AttributesManage attributE Sets
Type
The product type.
You must use the product type name (case insensitive).
It can be:
- simple,
- configurable,
- grouped,
- bundle,
- virtual,
- downloadable,
- any custom product type
simple
Website
The website(s) to which belongs the product.
You can either use the website name (case insensitive) or the website ID.
Main Website Store
1
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 can either use the tax class name (case insensitive) or the tax class ID of the product.
Taxable Goods
2
To know the names and the ids of the tax classes available in your system, go to:
SalesTaxPRoduct tax classes
Visibility
The product visibility.
You can either use the visibility name (case insensitive) or the numerical value associated.
- Not visible Individually (1),
- Catalog (2),
- Search (3),
- Catalog & Search (4)
Catalog,Search
4
Status
The status of the product: enabled or disabled
You can use any of the below values:
- enabled / disabled
- enable / disable
- true / false
- yes / no
- 1 / 0
enabled
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.
Your text
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
True
Drop-down or multi-select attributes
The drop-down attributes can be updated either with the option label or with the option id.
4
The multi-select attributes can be updated either with a list of option labels or a list of option ids separated with a comma.
Men, Boys
To know the labels and ids of the drop-down and multi-select attributes, go to:
Catalog AttributesManage attributE edit attributEManager label / option
Date attributes
The date attributes must be formatted as follows:
YYYY-MM-DD hh:mm::ss
2019-06-11 15:09:52
Decimal value
The EAV attributes can be updated with decimal values.
You could for example register a value for the price attribute.
15.45
Integer value
The EAV attributes can be updated with integer values.
You could for example register a value for the weight attribute.
368
Null value
The EAV attributes can now be updated with NULL values.
You could for example register a null value for the price attribute. For this, NULL must be written in uppercase and without any space.
NULL
Prices attributes
Price
The price attribute can be a float number or an integer number.
It must be formatted with a dot as a decimal separator.
15.50
Special price
The special price attribute can be a float number or an integer number.
It must be formatted with a dot as a decimal separator.
10.50
Special price from/to date
The special price from/to date must be formatted with the date and the time GMT as below:
YYYY-MM-DD hh:mm:ss
2019-06-17 11:29:51
Tier price/Group price
The list of tier prices must be separated by ~ as below:
[Group id 1]|[Qty 1]|[Price 1]~[Group Id 2]|[Qty 2]|[Price 2]~...
*|5|9.99~*|10|7.99~...
To import your tier prices as discounts, add % at the end of each value. Otherwise, your tier prices will be imported as an amount:
*|5|10%~*|10|5%~...
Below is the list of the codes to use for the customer groups ids:
- *: All groups
- 0: Not logged in
- 1: General
- 2: Wholesale
- 3: Retailer
- 4: VIP Member
- 5: Private Sales Member
Weee tax
The list of taxes must be separated by ~ as below:
country1|region1|tax1~country2|region2|tax2~...
- Country code
It can be: FR, US, CA, NZ... - Region
Use * for all states - Tax
This is a fixed value
FR|*|13~UK|*|18
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
- 1 / 0
- yes / no
- true / false
- enable / disable
- enabled / disabled
- in stock / out of stock
in stock
Numeric values
- Integer number (no white space)
- Float number (decimal separated by a dot)
10.50
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
- 1 / 0
- yes / no
- true / false
- enable / disable
- enabled / disabled
- in stock / out of stock
yes
Numeric values
- Integer number (no white space)
- Float number (decimal separated by a dot)
1050
Dynamic attributes
You have the possibility to create a dynamic mapping giving you more flexibility in the configuration of your profile. In your source file, for the same column, you can indicate the Magento attribute to map as well as the associated value.
Dynamic attribute
Code of the Magento attribute to map and the associated value.
The syntax to use is:
attribute_code=value
length=150
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.
The syntax to use is:
directory/image-1.png;
directory/image-2.png;
...
Each image path must be separated by one of the below characters:
- | (pipe)
- , (comma)
- ; (semi-colon)
directory_1/directory_2/image-A.png;directory_1/directory_2/image_2.png;directory_3/image-XYZ.png;
You can use the below parameters:
- * (star) prefix + label of the image:
Optional parameter to associate a label with each image.
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 attributes 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.
Category attributes
The categories associated with the products can be imported/updated with new values.
Category mapping
List your category names (case sensitive) or category ids separated with a comma.
category ID 1 [position],category ID 2 [position]...
You can use the below parameter to define the position of the products in the categories:
- position
Default value is empty.
For example, to import your product in position 2 in the category ID 10 and in position 1 in the category ID 13, you can write:
10[2],13[1]
The values will be translated into category paths according to the parameters you have defined in your profile configuration from:
Advanced SettingsCategory Settings
For example, to import products in the New Arrivals (ID: 10) and Dresses & Skirts (ID: 13) categories, from the Mapping & rules tab of your profile configuration, map the Category mapping attribute with a custom value.
In the following field, you could have written:
10,13
If you prefer using the category names, you could have written:
Default Category/Women/New Arrivals,Default Category/Women/Dresses & Skirts
Categories will be created according to what you've defined in the Advanced Settings tab.
Merchandising attributes
The related/up-sell/cross-sell products can be imported/updated with new values.
Related / Cross sell / Up sell products
List of related product SKU's separated by |.
SKU1|SKU2|SKU3...
Configurable product attributes
With Mass Stock Import & Update you can create configurable products on the fly and create a relationships 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
skuparent
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
sku1,sku2,sku3
Configurable attributes
When creating/updating a configurable product, the configurable attributes must be specified using the attribute codes or the attributes IDs separated by commas as below:
Attribute Code 1,Attribute Code 2
size,color
Options Container
The Options Container attribute must be added to your mapping in the case where you create configurable products from a source file as below:
Code of the Container
container1
Downloadable product attributes
With Mass Stock Import & Update you can import or update downloadable products.
Links title
Title of the downloadable resource.
Downloadable file
Samples title
Title of the downloadable resource.
Downloadable sample
Link URLs
Link to the file (relative or absolute path) and optional file's name separated by a pipe (|) as below:
Link | File name
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 (|) as below:
Link | File name
http://www.example.com/filename.ext | My downloadable sample
Grouped product attributes
With Mass Stock Import & Update you can create grouped products and create relationships between children and parents.
Parent SKUs
When updating/creating a grouped product, you can add the parent references so that they will be automatically associated to the grouped product as below:
List of related parent product SKU's separated by commas
For example:
parentsku
Children SKUs
When updating/creating a grouped product, you can add the children references so that they will be automatically associated to the grouped product as below:
List of related children product SKU's separated by commas
For example:
sku1,sku2,sku3
Custom options
With Mass Product Import & Update you can import or update your products' custom options.
Dropdown / Radio / Checkbox / Muli-select
Custom option title and option values separated by * such as:
Title*Option1|Sku Option 1| Price Option 1| Position option 1*Option2|Sku Option 2| Price Option 2| Position option 2*...
For example:
Engraving*Gold engraving|engravingg01|45|1*Silver engraving|engravings02|25|2*...
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.
Opening and closing tags
<?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"]
Variable $self
$self
to retrieve the current value of the column and manipulate the data:
<?php return $self;
For example:
<?php return strtolower($self);
Conditional values
To output values based on different conditions.
For example:
<?php
if ($self > 200) return "0";
else return $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";
}
?>