Breadcrumbs

Home / Support Center / Documentation / DJ-Catalog2 / DJ-Catalog2 CSV Import guidelines

Top Menu

Content

DJ-Catalog2 CSV Import guidelines

1. General information

  1. CSV file has to be UTF-8 (without BOM) encoded.
  2. Only CSV files with ',' (comma) or ';' (semicolon) separators and single or double-quoted (' or ") text limiters/enclosures are supported.
  3. CSV file must contain column headers, e. g. 'name', 'description'.
  4. Order of columns within CSV file is not important.
  5. All ID columns (e.g. product ID, category ID, group ID, etc.) should contain valid IDs (pointing to values that already exist in the database). Be carefull, as those values are not being validated.
  6. If you want to import images and/or attachments they has to be uploaded before, via FTP, repectively to:
    • /media/djcatalog2/import/images/
    • /media/djcatalog2/import/files/
  7. Depending on which type of data (product, category, producer) you want to import, you can choose default values for some columns (if they are not provided in CSV file). For example, if you do not provide cat_id value (or column, at all) for a product, then chosen 'Default Category' will be used instead.
  8. Some server settings may not allow you to import large amount of data and the import process may be stopped in the middle. If you exceed 'maximum execution time' or 'memory limit', try importing data in smaller portions - for example 50-100 products at a time.
  9. Please make a back-up of your website, before importing, especially if you use import function to update existing records in your database.

2. Product import

List of valid column names and their description:

Column nameRequiredNotice 
idNoIf provided, has to point to existing product. Product will be updated then with the provided data for CSV file.
If ID is empty (or 0), a new product will be created.
 
nameYesShould be unique within product's category, because based on product's name, an alias is being generated. Therefore there cannot be two products with the same alias. 
aliasNo--- 
group_idNoID of product's field group. 
parent_idNoID of product's parent (default: 0). 0 - means that product does not have parent 
cat_idNoID of product's category. 
producer_idNoID of product's producer. 
skuNoSKU of a product 
descriptionNoFull description. Can contain HTML code. 
intro_descNoShort description. Can contain HTML code. 
priceNoRegular price. Should be a valid floating point number or an integer. Dot should be used as decimal point, e.g. 1099.95 
special_priceNoDiscount price. Should be a valid floating point number or an integer. Dot should be used as decimal point, e.g. 1099.95 
tax_rule_idNoID of VAT rule assigned to a product (default: 0) 
stockNoDecimal number (e.g 12.1234) representing current stock level 
on_stockNoInteger [0,1,2], where 0 = no, 1 = yes, 2 = always 
availableNoInteger [0,1] - whether product can be added to cart 
unit_idNoID of measurement unit 
addressNoName of the street or other address details (Location related field) 
cityNoCity name (Location related field) 
postcodeNoPostcode / ZIP (Location related field) 
countryNoID of the country 
stateNoID of the state 
phoneNoPhone number (Location related field) 
mobileNoMobile phone number (Location related field) 
faxNoFax number (Location related field) 
websiteNoURL of the website (Location related field) 
emailNoContact e-mail address, needs to be empty or valid e-mail address (Location related field) 
latitudeNoGeographical latitude coordinate, decimal degrees (Location related field) 
longitudeNoGeographical longitude coordinate, decimal degrees (Location related field) 
metatitleNometa-title. 
metakeyNometa-keywords. 
metadescNometa-description. 
publishedNoState [0/1]. 0 = un-published, 1 = published. 
featuredNoFeatured product flag [0/1]. 0 = not featured, 1 = featured. 
orderingNoInteger number indicating product's order within its category. 
createdNoCreation date in Date-Time format: [RRRR-MM-DD HH:MM:SS] or [RRRR-MM-DD]. 
created_byNoID of the Joomla! user who should be the owner of the product. 
imagesNoComma-separated list of file names that should be located in /media/djcatalog2/import/images/ directory. For example: image1.jpg,image2.jpg,image3.jpg 
filesNoComma-separated list of file names that should be located in /media/djcatalog2/import/files/ directory. For example: chart1.pdf,manual.pdf 

Please note that the list of valid columns depends on component version. Usually when there is a new attribute added into the component then by default it will also be accepted during import. You can examine the structure of #__djc2_items table in order to find out which columns are supported by the table.

Example 1

namedescriptionintro_descpricespecial_pricefeaturedimagesfiles
Crystal vaseVery beautiful crystal vase from XVI century.Nice crystal vase.1200.0099.951vase1.jpg, vase2.jpg 
TV set40", Full HD LCD television setReal must-have2999.002699.950tv40.jpgmanual.pdf, chart.xls

Example 2

Notice that some records doesn't have any values in 'id' column - these will be new products in the database.
Also, 'cat_id' and 'producer_id' are IDs of already existing categories and producers.
idcat_idproducer_idnameprice
2424Updated product599.00
2525Updated product #2499
 26New product #11999
 26New product #2300.00

3. Category import

List of valid column names and their description:

Column nameRequiredNotice
idNoIf provided, has to point to existing category. Category will be updated then with the provided data for CSV file.
If ID is empty (or 0), a new category will be created.
nameYesShould be unique within category's parent category, because based on category name, an alias is being generated. Therefore there cannot be two sibling categories with the same alias.
aliasNo---
descriptionNoFull description. Can contain HTML code.
metatitleNometa-title.
metakeyNometa-keywords.
metadescNometa-description.
publishedNoState [0/1]. 0 = un-published, 1 = published.
orderingNoInteger number indicating category's order within its parent category.
createdNoCreation date in Date-Time format: [RRRR-MM-DD HH:MM:SS] or [RRRR-MM-DD].
created_byNoID of the Joomla! user who should be the owner of the category.
imagesNoComma-separated list of file names that should be located in /media/djcatalog2/import/images/ directory. For example: image1.jpg,image2.jpg,image3.jpg

Example 3

Notice that all ID columns are empty. This script will only add new categories, assuming that there already exists a category with ID=1.
idparent_idnamedescriptionimages
 1CarsAll available cars.cars.jpg
 1MotorbikesFull range of our motorcycles.bikes.jpg
 1TrucksThe biggest 18-wheelers.truck.png

4. Producer import

List of valid column names and their description:

Column nameRequiredNotice
idNoIf provided, has to point to existing producer. Producer will be updated then with the provided data for CSV file.
If ID is empty (or 0), a new producer will be created.
nameYesShould be unique, because based on producer's name, an alias is being generated. Therefore there cannot be two producers with the same alias.
aliasNo---
descriptionNoFull description. Can contain HTML code.
metatitleNometa-title.
metakeyNometa-keywords.
metadescNometa-description.
publishedNoState [0/1]. 0 = un-published, 1 = published.
orderingNoInteger number indicating producer's order.
createdNoCreation date in Date-Time format: [RRRR-MM-DD HH:MM:SS] or [RRRR-MM-DD].
created_byNoID of the Joomla! user who should be the owner of the category.
imagesNoComma-separated list of file names that should be located in /media/djcatalog2/import/images/ directory. For example: image1.jpg,image2.jpg,image3.jpg

Example 4

Following example will add 3 new producers and update 2 existing ones (IDs 1 & 2).
idnamedescriptionimages
1Car manufacturer 1Lorem ipsum dolor sit amet...cf1.jpg,cf2.jpg
2Car manufacturer 2Lorem ipsum dolor sit amet...cf3.jpg,cf4.jpg
 Car manufacturer 3Lorem ipsum dolor sit amet...cf5.jpg
 Car manufacturer 4Lorem ipsum dolor sit amet... 
 Car manufacturer 5Lorem ipsum dolor sit amet...cf6.png,cf7.jpg

Check the video with this tutorial:

 


Found this article interesting? Subscribe for more.
Subscribe to the Telegram bot / Subscribe to the Messenger Bot
Or share this article with your friends.

 
 

Footer Menu