Tutorial on CSV import with Variants

  • Posts: 96
  • Thank you received: 14
12 years 11 months ago #37749

Ok, i sorted it this way:

0) I've chosen to make the csv imports category by category, I mean, in my case I have created first the category tree with a csv import that look like this:

parent_category,categories
;category-1
category-1;subcategory-1
category-1;subcategory-2
category-1;subcategory-3
;category-2
category-2;subcategory-a
category-2;subcategory-b
category-2;subcategory-c

it looks like this in my spreadsheet



This will create "category-1" and "category-2" each one with tree subcategories in it.

Next I manualy create a caracteristic containing all the possible variants each product on the subcategory-1 could have from the caracteristand menu in the hikashop admin pannel, lets say:

main caracteristic:

caracteristic-x

and caracteristic-x have variants:

cyan
magenta
yellow
black
red
green
blue


I know (in my case and the way i'm organizing my products) that in subcategory-1 there will be only products that could have variants based on caracteristic-x so now that I've prepared the caracteristic I can call it in my csv with its own column, then i create a csv very similar to this one:

product_parent_id;product_name;product_description;product_quantity;product_code;product_type;categories;price_value;price_currency_id;images;category-x
0;FirstProduct;The best product on the planet!;-1;sku-123;main;subcategory-1;15.5;EUR;imagecyan.jpg;cyan
sku-123; ; ;-1;sku-123-cyan;variant; ;15,5;EUR;imagecyan.jpg;cyan
sku-123; ; ;-1;sku-123-mage;variant; ;16,5;EUR;imagemagenta.jpg;magenta
sku-123; ; ;-1;sku-123-yell;variant; ;17,5;EUR;imageyellow.jpg;yellow
0;SecondProduct;The best Second product on earth!;-1;sku-456;main;subcategory-1;17,8;EUR;imagered.jpg;red
sku-456; ; ;-1;sku-456-red;variant; ;17,8;EUR;imagered.jpg;red
sku-456; ; ;-1;sku-456-green;variant; ;17,8;EUR;imagegreen.jpg;green
sku-456; ; ;-1;sku-456-blue;variant; ;17,8;EUR;imageblue.jpg;blue

in my spreadsheet looks something like the file attached.

This creates me automaticaly two products inside subcategory-1 with respective variants:

-FirstProduct with cyan, magenta, and yellow caracteristic for chosing from the dropdown menu having each variant its own price, product code and product image
-SecondProduct with red, green and blue caracteristic each one with their image, price and product code.

This way i find very streamlined the process of inserting my products in bunches and considering i'm making a printed catalog tthat must reflect the website structure each category in the website corrisponds to a section in my printed catalog and this way is more easy to automate the layout in indesign using the datamerge tool. (take a look at this tutorial )

:unsure: The only think i need to understand is how to make a product searching based on the product code i've created for each variant, giving that each variant is a product per-se
I hope someone with good heart points me in the right direction. :unsure:

Attachments:
The following user(s) said Thank You: chasaj

Please Log in or Create an account to join the conversation.

  • Posts: 83103
  • Thank you received: 13415
  • MODERATOR
12 years 11 months ago #37901

That's a really nice tutorial !

Having the search plugin works for variant information is not easy if you want to make something compatible with all the possibilities. It's not just two your three lines that can easily be changed in the plugin. I don't see an easy way of doing it properly.

The following user(s) said Thank You: protorob

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum