Juno Wiki & Help‎ > ‎

Product Import CSV

If there is an error in the image import thart product may not import so it advisable to import the images as a seperate csv

Here's how to make a product import CSV from data sent to us by clients, and a list of what each of the headers does and how to use it properly...

Example headers in the CSV
  • store - This should always be "admin" and has to be there everytime
  • websites - Unless its a multistore this should always be "base"
  • attribute_set - Unless there's multiple attribute sets this should always be Default
  • tax_class_id - Unless you're not using VAT this should always tend to be Taxable Goods
  • type - Generally speaking, this will always be either simple or configurable. For an explanation of both, see below
  • status - Enabled or Disabled, if not specified, default should be Enabled
  • visibility - If you have a simple product that is associated to a configurable, the simple should be "Not Visible Individually". If you have a plain simple product or a configurable one it should be "Catalog, Search". If requested for the product to be viewable in the catalog but not search it's "Catalog" if just search then "Search"
  • is_in_stock - in stock (default) = 1 out of stock (only if requested) = 0
  • sku - This is a code associated to the product, this has to be unique for each product. ALWAYS must be unique! and have no spaces in them
  • name - This is the products name
  • color - If the product has a colour associated to it, put it here
  • categories - These are the categories for that product. A slash ( / ) indicates that there's a sub-folder, and the product should go in the sub folder. A comma ( , ) indicates that its a separate category, so if there's multiples you use that
  • associated - This is used for "configurable" products only. Its a comma separated list of all the associated simple products
  • config_attributes - This is used for "configurable" products only. Its also a comma separated list of all the attributes that the simple products have which makes them unique (color, size, shape, flavour, model etc)
  • manufacturer - Not needed, but some companies like to indicate the manufacturer of the product they sell
  • image, small_image, thumbnail - These are usually the same image repeated unless specified otherwise. You have to use a slash before the file name ( / ) to indicate the correct file path from media/import.
  • Gallery - this is a comma separated list of all the images associated with this product, if there's only one this field can remain blank
  • Price - Products price. Don't put any currency symbols (£,$ etc) just the number, decimals are fine
  • cost - This is how much the product costs the company. This can be useful for some companies
  • weight - How much the product weighs. Don't put the value of the weight at the end (i.e. KG, lbs, etc) just put the value, decimals are fine
  • description - Products main description
  • short_description - a brief overview description of the product
  • qty - How many of the products are in stock
  • related - Any related products, this should be a comma separated list of their SKU's
  • upsell - as above but upsells
  • crosssell - as above but cross sells

Headers you can use, that aren't in the example and what they do

  • category_ids - If you've already imported categories, and simply want to update the products you can use the category ID's. This is a great feature if you know the ID of the category as it removes the risk of inputting incorrect text (typos', extra spaces etc)
  • meta_title - If you want to specify a specific meta title, you can use this header to do so
  • meta_description - As above but meta description
  • url_key / url_path - you can specify the URL you want to use here, not the base URL (www.mysite.com) just what comes after the slash so "myproduct" - This can be nice if you want to include a keyword that you don't want to include in your products name.
  • image_label, small_image_label, thumbnail_label - You can use custom names for the label of the image, can be good to not have to use standard file name
  • min_qty - Helpful if you always want a specific quantity of a product
  • use_config_min_qty - If you've changed the above, set this to 0
  • is_qty_decimal - Helpful if you're selling a percentage of a product
  • manage_stock - If you have a constant supply of stock, this can be set to 0 if not 1

Custom Attributes

If you have custom attributes (i.e. if you sell bulbs and you want an attribute for bulb wattage) you can add them here, you do however need to add the attribute into the admin before you do so. If you want spaces between you should use underscores ( _ ) and name them in a way so you'll know exactly what they are later

The difference between Simple, Configurable and Bundle Products

Configurable products are essentially the "master" product for a group of simple products. An example of this might be if you have ten t-shirts, 2 colours and 5 sizes - Instead of listing 10 products, you can create a configurable product which contains each of the 10 products but displays it as one product with options.

Simple products are as they are named, simple products. Its just one product, and although you can set custom options (explained below) it doesn't have any real variables. If you're making simple products for a configurable you have to make one product for each eventuality. For example, if you have a t-shirt in red, green, blue, yellow and white and have each of those in sizes small to extra large you'll need to make a product for each (i.e. small red, small green, small blue, small yellow, small white, medium red, medium green etc etc). If you're product doesn't have any options, for example if you're selling a specific thing like a smart phone case you just need to set the one simple product

Bundle Products - Bundle products are used if you have multiple products you're selling in a bundle, for example if you sell computer parts but if you sell whole computers too you may want to give the customer the option to customise a PC themselves using your parts and you can do this via Bundle.

Custom Options

Custom options are pretty complicated to set up via CSV so it's easier to do in the admin. This is if you have a simple product that can be customised but you have the same quantity of the product regardless. For example, if you sell custom t-shirts which you print as they're ordered if you may use a simple product with a custom option instead of making multiple simples for a configurable. This has quite limited potential for use though and it's almost always better to use configurable / simple even though the initial set up may be slightly longer.


Gallery import issue

Now, what you need to do is open the file
app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php

and go to around line 773 and find

$addedFilesCorrespondence = $mediaGalleryBackendModel->addImagesWithDifferentMediaAttributes(
            $product,
            $arrayToMassAdd, Mage::getBaseDir('media') . DS . 'import',
            false,
            false
        );

and check for the following additional code

if (isset($importData['media_gallery']) && !empty($importData['media_gallery'])) {

            $x = explode(',', $importData['media_gallery']);
            foreach ($x as $file) {
                $imagesToAdd[] = array('file' => trim($file));
            }

            $mediaGalleryBackendModel->addImagesWithDifferentMediaAttributes(
                $product,
                $imagesToAdd, Mage::getBaseDir('media') . DS . 'import',
                false,
                false
            );
        }

if it dosnt exit try in app/code/local/Mage/Catalog/Model/Convert/Adapter/Product.php. If the file dosnt exist copy it from app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php.

If the additional code isnt in app/code/local/Mage/Catalog/Model/Convert/Adapter/Product.php then add it in. DO NOT EDIT CORE CODE


ċ
Example.csv
(4k)
simon.newbold@junowebdesign.com,
Jun 2, 2012, 3:14 AM
ċ
paulo_example.csv
(1k)
Paul Millband,
Feb 13, 2015, 2:56 AM
Comments