3.4. Import Product Data
To start import your data make sure you prepared the correct file with all required fields in it.
Here's a list of data that import file may include, along with a detailed description of those fields:
- "Product ID". This is an internal database field, it should be of numeric type only and must have unique values across the entire table.
Note: the value from the selected file will not be imported from the file or changed at your store as it should be assigned automatically by shopping cart itself (other database tables can have references to this field pointing to specific products).
- "Price" (Regular Price). It is the base cost of the products that does not include any taxes, discounts or coupons. Price fields are numeric; no text is permitted - do not include “$” or any other symbols.
- "Stock". This is the amount of your products at your store. If you set "0" quantity or leave the current field blank, the products will be displayed at the front-end as "Out of Stock".
- "Name" - the official name (title) of your products at your store.
In case your file is readable and accessible, you may start importing.
Note: before import implementation, in case you perform it at the first time, we strongly recommend to make a backup of your store database!
Go to Store -> Products - > Import Wizard
1. The first step holds an area to specify the file that is used for importing. Check one of the following checkboxes:
- "Local import file". This means you should indicate the local path to a file from your computer (locally).
- "HTTP URL". If your file is located on the webserver and you have the necessary access to the web directory, specify the URL external path in the appropriate field.
- "FTP URL". In case your file with data to import is placed on a FTP server, specify your FTP details in the form:
Make sure you have used proper credentials. To check them, go to Settings -> Preferences or press F12 key and choose the FTP section. Click the [Test Connection] button for verifying.
You should get the following message:
Otherwise, please contact your hosting company to clarify your main FTP access details.
In the lower area of the page, there is the field that helps to use previously saved import configurations if any.
To move to next steps of import you can press one of the numbered boxes on the left or use the [Next [Page Down] at the bottom to get to the second step of the process.
2. The "Select fields delimiter and quote characters" page contains some important settings to separate data.
Take into account the checkbox below:
Keep it selected if your file to import contains the field names in the first row (see an illustration above). In other cases, it should be unselected.
3. "Field link" is the most important step of the whole import process and requires to assign the columns from a file to the relevant fields in your store database.
Or select the field on the left and double-clicks on the corresponding columns on the right to make it assigned to the selected position.
Use the top toolbar to facilitate the linking process.
On the "Linking" step do not forget to assign the images related to your export data. For this, choose the "Featured Image" position from the database fields list and link with the corresponding field from your source file.
In this case, your media files will be imported with the other data from a file.
You can import attributes assigned to products, as well, which can be transferred from the columns of a file. This is possible if attributes were created in the lower grid on the "Products" page and can be used for variations generating:
These positions will not be displayed in the Attributes section of Store Manager:
Therefore, on the "Assignment" step of import current field values will be missed and cannot be imported!
To be able to link all attributes to the corresponding fields of your store database, create an additional column by pressing the button with plus on the top toolbar.
This opens the form, where you should specify the necessary attribute value and click the [OK] button.
The additional field will be added to the columns listing in the left pane and will be mapped automatically to the relevant field from a file with all data values in it.
Press the button with minus to remove selected variation attribute from the list (available only for a taxonomy type!).
- [Add Custom SQL] gives an opportunity to create and use the extended expression formula for your data during importing. Note: you should have some SQL skills to generate a proper query.
Check this chapter about the current option's functionality and application.
Use the [Help] button at the top for more details on expression special SQL syntax with provided examples.
To delete previously created SQL commands, use the option for removal.
On the right pane, you can see an area for "Skip Rules" creation
Fill the form which appears:
- Specify the rule’s type value - from resource file, from store database or from the expression.
- Indicate the value that will be used for your rule.
- Clarify the equation sign between two parts of the rule.
When you use the expression formula, you should specify the value to which this expression will be used. You can take if from the store database or from a file’s data.
To make a formula for data generating, open the Expression Editor and create the necessary formula. With the simple expression, you can increase/decrease products price after import, combine some values positions in the relevant fields of store database, send items in "Out of Stock" mode automatically provided that their quantity become "0" after importing and more.
For example, if you want to merge the columns with the Description and Product Name (Title) use the CONCAT function and press the [Insert...] button on the toolbar to select the necessary fields value.
Your expression should be as follows:
To check the correctness of this formula press [Execute...]. You will get the result in a lower pane of the editor form.
Press [OK] to go back to the linking step and proceed with the import process.
If the main actions on this step are done, you can go to the final page of import - "Options".
4. The "Options" step of importing contains the main import methods list:
The [Show advanced options] button on the right displays the base date/time formats and value’s separators.
The lower part of the options area includes the following fields:
- "Multiple values separator". Leave default or set your own separator, which is used to demarcate the values between each other in the file to import
- "Multiple records separator" serves for separation records in the import file. Leave it by default.
- Next two fields allow restricting the volume of importing.
- Indicate direction where your media files are placed in (in case the file contains products with images):
- Image names that already exist on FTP with the same names allows to choose an action to add these illustrations to your products data:
- "Use existing image" - keep previously assigned images after importing without uploading the ones from a file to import.
- "Upload and replace" - replace existing illustrations from a file with the same names, preloading them on a server.
- "Upload image and generate new name" - upload illustrations on FTP with the new post names generation.
For example, a product has an image named "cheescake-1". After importing, when the certain variant is checked, you will get the same image but the name will be regenerated to "cheescake-1-1" etc.
Please take a note, for SKU field you can use numbers and letters, randomly created in your opinion and the ID - it is only numerical designation, which is automatically generated by the program during data creation and cannot contain any letters.
- Choose SKU or ID position in parent column depending on one you have in your source file.
- If the attribute positions are present in the file to import, do not forget to select one of the following actions before starting:
Provided that your store has products with variations choose the relevant identifier for existing variations in the "Advanced Options" step from the proposed list: Parent column, ID or SKU.
Specify the condition by which the wizard will consider a column with variations - the Post Type column or any Variation Attribute column.
Attention! The import process will start, after you press the [Import] button!
If all settings are made correctly, continue the procedure. If you see any errors or warnings on the "Import Preview" step, return to the previous step and try to change settings.
The last window of WooCommerce Import Wizard displays results and errors, if any emerged in the course of the import process.
To use these configuration settings in the future, save them directly to the wizard or to a separate file by clicking the corresponding button below.
< - To use these configuration settings in future, save them directly to the wizard or to a separate file with the [Save configuration] button.
You can also remove selected configuration or clear all configuration list with one-mouse-click on the corresponding option from the drop-down menu.
The [Finish] button allows to exit the Wizard and check the data after import at your store front-end.