Difference between revisions of "X-Cart:How to export and import products with images"

From X-Cart 4 Classic
Jump to: navigation, search
(When importing data with images, old detail images in the "/images" directory are neither overwritten nor removed. How do I solve the problem?)
(To import products with images)
Line 9: Line 9:
 
==To import products with images==
 
==To import products with images==
  
To import products with images, the CSV file must contain columns !THUMBNAIL and !IMAGE . The simplest way to get a valid file is to export a product with images (see the previous section for instructions on how to do that) and use it as a template.
+
To import products with images, the CSV file must contain columns !THUMBNAIL and !IMAGE. The simplest way to get a valid file is to export a product with images (see the previous section for instructions on how to do that) and use it as a template.
  
 
# Place the directory containing product images to a temporary directory inside X-Cart. For example, you can create a directory in <xcart_dir>/var/tmp . If you are importing products from one X-Cart to another, you can just place the directory export _***, described above, to the specified directory <xcart_dir>/var/tmp .
 
# Place the directory containing product images to a temporary directory inside X-Cart. For example, you can create a directory in <xcart_dir>/var/tmp . If you are importing products from one X-Cart to another, you can just place the directory export _***, described above, to the specified directory <xcart_dir>/var/tmp .
Line 17: Line 17:
 
# Select the required delimiter.
 
# Select the required delimiter.
 
# Click '''Import'''.
 
# Click '''Import'''.
 +
 +
Also, it is possible to auto-generate product thumbnail images from the main product images being imported (in other words, generate thumbnails from the images specified in the !IMAGE column). This can be done by adding !GENERATE_THUMBNAIL column to your CSV file and specifying Y as the value of the column. The !THUMBNAIL column should be omitted in this case.
 +
 +
See also:
 +
* [[X-Cart:CSV_Format_for_Various_Data_Types#Products | CSV Format for Various Data Types. Products]]
  
 
==Troubleshooting==
 
==Troubleshooting==

Revision as of 12:27, 2 October 2012

To export products with images

  1. Go to Tools > Import/Export > Export data section.
  2. Do you wish to export images?: Select Yes.
  3. Data types: Select products.
  4. Click Export.
  5. The required CSV file is generated in X-Cart and a directory containing images is saved to <xcart_dir>/var/tmp/export_*** . The exact name of this directory can be looked up in the Export packs section. You can download this directory using FTP or SSH.

To import products with images

To import products with images, the CSV file must contain columns !THUMBNAIL and !IMAGE. The simplest way to get a valid file is to export a product with images (see the previous section for instructions on how to do that) and use it as a template.

  1. Place the directory containing product images to a temporary directory inside X-Cart. For example, you can create a directory in <xcart_dir>/var/tmp . If you are importing products from one X-Cart to another, you can just place the directory export _***, described above, to the specified directory <xcart_dir>/var/tmp .
  2. On the Import/Export -> Import data page click Import options.
  3. Directory where images are located: enter the absolute(!) path to the directory, where you have placed the images. The absolute path to the X-Cart directory can be looked up on the Summary page in the Environment info section.
  4. Select the required file.
  5. Select the required delimiter.
  6. Click Import.

Also, it is possible to auto-generate product thumbnail images from the main product images being imported (in other words, generate thumbnails from the images specified in the !IMAGE column). This can be done by adding !GENERATE_THUMBNAIL column to your CSV file and specifying Y as the value of the column. The !THUMBNAIL column should be omitted in this case.

See also:

Troubleshooting

When importing data with images, old detail images in the "<xcart_dir>/images" directory are neither overwritten nor removed. How do I solve the problem?

When importing data with images, if in the target directory, e.g., images, X-Cart finds an image with the same name as the image being imported, for instance, "detailed_image_sku17.jpg", it doesn't overwrite or delete the existing image; instead, it appends a suffix like _01, _02, etc. to the image being imported. Thus, in our example, in the images directory we get a new image named "detailed_image_sku17_01.jpg".

To prevent cluttering up the images directory with diplicate images when importing data with images multiple times, please follow these simple steps:

1) Before importing data with new images, rename the images directory; e.g., to images_bkp.
2) Import the data with new images.
This creates a new directory named images, where X-Cart will import the new images.
3) (Optional) Re-slice magnified images (if importing images for magnifier).
4) Copy the content of the images directory to the images_bkp directory (overwriting the old files).
As a result, the old images in the target directory (images_bkp) will be overwritten by the new images from the source directory (images).
5) Remoave the images directory.
6) Rename the images_bkp directory to images.
Note: You can complete step 1, as well as steps 4 through 6 using FTP, SSH or the File Manager in the website's Control Panel.