3. Import Products
This Wizard will help you to update your database by selecting appropriate action.
Pay attention to each Wizard's page to import products to VirtueMart correctly. Import is a rather complicated procedure and it may be destructive if performed incorrectly. Create database backup before importing products especially if you do it the first time.
First of all, prepare a file for Import. Make sure it contains all necessary fields and all data you are going to import is listed in the table. Here's a list of fields that your file for import may include and 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. The value from .csv 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). During the VirtueMart, import ID can be used for identifying products only.
SKU - it's a standard, alphanumeric string that uniquely identifies the product, is assigned to the VirtueMart product by the manufacturer according to the procedure and is used internationally. You should be able to receive the standard code for all your products from your supplier easily. Just contact them with this request. This field should have unique values and may be used for identifying products during the VirtueMart import
Price - the product price should be the cost of the product before tax or shipping. Do not include any rebates, coupons, or bulk discounts. Prices should be whole numbers with a maximum of two decimal places. Price fields are numeric; no text is permitted - do not include “$” or any other symbols.
Category - specify the category your product belongs to. If the product should be imported into subcategory use pipe character "|" to separate parent and subcategory, for example: "Computers|Keyboards", the product will be assigned to Keyboards category. In case you have categories in separate column, please merge them in Excel using the following formula:
| - is category delimiter
B2 - is your parent category column in .csv file and
C2 - is sub category column in .csv file.
If you need to assign the same product to multiple categories, use a double delimiter, like this one: "Computers|Keyboards||Computers|Other" in your .csv file. In this case, the product will be assigned both to Keyboards subcategory and to another subcategory while import. In our case, Pipe is used as category delimiter.
Quantity - you can set product quantity. Please note that if you indicate "0 " or leave this field blank the product will be displayed at your store's front end as "Out of stock".
In Stock - this field acquires "1" or "0" value only. It states availability of the product. For example, the value " 1 " means that product is available in stock. In case it has "0 " value than the product is not available for purchasing and will not be displayed at your Store. In case you skip this column, your products will be not updated. Products that are not listed in .csv file can be set as "Out of Stock" if you enable appropriate option at the last step of import.To set the value as in stock for all products you can specify 1 value for the first product in your .csv file and spread it for all products.
Product image - allows you to import images for the product. You can choose where you would like to upload pictures from - your local computer (in this case you need to have only image names in your .csv file like product_image_1.jpg) or external web URLs (in case you have image URLs from your supplier like http://supplierstore.com/bulkimages/image.jpg). Please note that in order to import images you have to set-up a proper FTP connection.
If your vendor provides you product list in Excel, you can convert your Excel files to the CSV format within the Microsoft Excel or OpenOffice application by using the Save As option. To do this you need to use File -> Save As dialog box which contains a list of alternative file formats. Among the file extensions offered, you can find Text CSV file format. By saving your file into CSV format, Microsoft Excel or OpenOffice will export the first active worksheet with the correct delimiters.
Store Manager for VirtueMart provides an opportunity to import data from files of different formats, such as csv, xml, xls, xlsx, ods, txt.
VirtueMart import from .xml via Store Manager for VirtueMart application is another way to accomplish bulk VirtueMart products upload and keep store content relevant and actual for clientele. Click here to check few XML import tips.
To start VirtueMart Import Products process click on Import/Export Products button, which starts the Import/Export Wizard.
Select "Import" and click "Next >" button to continue.
Enter the file you need to import or use the browse button to select one.
If you want to import a .xml file, after launching Import/Export Wizard you will be guided through pretty much the same steps as in the process of .csv import. Particularly, the procedure is analogical, as basically you just convert .xml data to a .csv file for further VirtueMart import, however, there are some extra steps you need to follow. So, please check out this article for a more detailed description of this procedure: http://virtuemart-manager.com/useful-articles/product-management/virtuemart-xml-import-to-database-tips/.
Next page allows you to choose the data delimiters that separate fields in the file with each other.
Product Import Method
Add and Modify - will add the new product if it is not available in the database yet and modify those products that were found.
Add Only - this option only adds new products.
Modify Only - this option only updates the existing products and do not add new entries, even if the current product was not found.
Just Add - this option may produce product duplicates since Store Manager will not try to find existing products but will only add all products as new
Please, select an indicator, which these products will be identified by name, SKU, id_number, manufacturer etc.
Products Identification Method - It is the topmost option as VirtueMart import will search for a product using selected method of identification. The product will be modified if found, if not - a new VirtueMart product will be added. Let's say you choose Identify Products By Product ID - how it is performed:
1. Import takes the first row of the .csv file and retrieves the value from a .csv column assigned to Product ID field. As you can see above, the Product ID field is assigned to the 1st column from your file and the value is "1"
2. Import tries to find product with ID of 1 in your store:
- If the product was found, it will modify and set all values from .csv columns of the first line to assigned fields (even if you have let's say some Camera or Keyboard saved under the 1st ID, it will set values from your .csv file). Note that this method cannot be used if IDs in your file are different from the ones in your database.
- if a product with ID 1 is not found it will create a VirtueMart new product, assign ID automatically (let's say you already have 983 products in your database, so the ID for this product will be 984) and set all values from assigned columns to that new product.
The same is true for Product Model and Name identification methods, except that model and name can be updated in your database from your .csv file.
Note: It is required to assign .csv columns to key fields depending on identification method.
Important Note! Source .csv file can contain multiple records with identical data for identification values (for example same model number for multiple products). All these products (with same ID or Model) will be considered as one. Currently imported to shopping cart product will overwrite previously imported with the same key field values. Note that sometimes one of the key fields may be blank. Obviously, blank fields contain the same value for all records, thus only one product will be updated.
Import Price Method
Add and Modify - adds new price or modifies existing one
Replace Existing Prices - modifies products' prices - the old values changes to the new ones, which are specified in the imported file.
Add Only - adds only a new value of product's price.
Looking at the specified categories' path in the imported file you can choose the following method for categories' identification:
- Full Category Path;
- Category Name Only;
- Category ID.
If there's no "category name" column (in .csv) or it is not assigned, all products will be imported to a category specified as Default. If default category is not specified and there's no other way to determine which category products should be imported into, the program will create "Default category" and place all new products there.
Default manufacturer is set almost in the same way as for category, except that VirtueMart product may not have manufacturer at all - it is not important. Also, you can uncheck the option in case you do not want to create new manufacturer if currently imported does not exist in the database.
Upload images - Enable the option in order to upload images to your server via FTP. Please make sure that you have specified correct FTP details in Tools -> Preferences -> FTP tab.
Default Images Path - Can be used only for images or product descriptions in combination with "Is External" option. If image name or description file name are incomplete i.e. they do not contain full path including drive letter or "http:// prefix along with domain name (for images only), this default path will be added to image or description file path. If image name ( or description) contains the full path, then this option may be ignored, unless you checked "Keep file path" option (for images only). You can specify local directory path here or HTTP directory URL ("http://www.someimagestorage.com/images/products/ ).
After Import Actions
You can check one of the proposed after import actions or create your own, pressing the 'Add New' button. Custom SQL Editor will be opened where using the toolbar you have an opportunity to create your own SQL query and verify its correctness by pressing 'Execute SQL' button. For assistance, you can also use 'Help' button in the right corner of the window.
New update of Store Manager for VirtueMart contains an additional field for images which are importing at the current import stage:
If a file to import has the names of the images identical to already existing on FTP, you should set the further action for such illustrations below:
- Use existing image - the products data except of images will be imported to the store.
- 'Upload and replace' - the existing products images will be rewritten on the illustrations from a file; the previously assigned images will be removed.
- Upload image and generate new name - keep the pre- added images and upload the new illustrations from a file, by rewriting their names. Such action helps to keep the names of images as unique and upload all illustrations from a file to FTP.
To continue click 'Next' button.
You can use Expression Editor to create expressions to perform arithmetic calculations as well as to set values for specific columns or fields. This feature is used for faster updates.
To use Expression, you have to choose the column of .csv file for which you want to change the value and in the field, Expression indicate the formula.
To create an Expression use:
[FIELD_VALUE], representing the current field value from your database
[CSV_COL(INDEX)] , retrieving value from .csv file from the specified column in the INDEX parameter
CONCAT([CSV_COL(INDEX1)], '|', [CSV_COL(INDEX2)], '|' , ... , [CSV_COL(INDEXN)]) , merging values from .csv file from the specified column in the INDEX parameter, can be used to specify full category tree required for import
In case you want to see data listed in columns from your .csv file, click on button.
This page of Import Wizard includes Base Formats and separators. They can be set by default.
At Import Preview page you can see how the .csv file was processed using VirtueMart import settings, which you specified at the previous steps. Check whether all the columns that you want to be imported are filled with data: some of them may be blank. That means that either you haven't assigned .csv column or it is empty in the source (.csv) file. Columns that were not assigned will not be imported whereas empty values will overwrite the existing ones.
Save Import Configuration
All import settings can be stored under some configuration. You can load it next time you decide to import products to VirtueMart from a file with similar formatting, column names etc.
Use the corresponding options to leave current settings in the wizard list or transfer it to a separate file:
Attention! The import process will start, when you press "Import" button! Proceed only if all the settings are made, otherwise, press "Back" button and check settings once more!
In the last window of VirtueMart, Import Products Wizard will be shown if any errors occurred during the import process.
Most frequent import errors are date, time and number conversion issues, caused by invalid format settings (specified on the previous pages) or improperly assigned column (i.e. if you assign column containing category ID to parent_category database field).
Date/time conversion errors might be ignored whereas other errors like this one (Could not find the image: image_name.gif) has to be fixed.
If you need assistance with import configuration, we'll gladly help you to setup everything correctly for an additional fee. Please contact us at http://virtuemart-manager.com/support-center for details.
Here are some related articles on VirtueMart Product Import: