Hello there,
I'm trying to upload my shop inventory from CSV files. I would like to have a number of products, describing their specifications, and then add packaging variants with price information. E.g. as a product I may have chocolate, and as variant I may sell chocolate bars and chocolote boxes.
I've run several trials to get this working, but only with a D-tour it leads to success. In order to understand what's going on, I created some test cases to show things.
Test case 1:
The products to import
product_name;product_code;product_type;product_parent_id;package;price_value
chocolate;;main;;;
chocolate-bar;;variant;chocolate;bar;3
chocolate-bottle;;variant;chocolate;bottle;4
chocolate-box;;variant;chocolate;box;5
And this is what happens:
ACTION: Import OK ->
4 products found : 4 new products imported, 0 invalid product code, 0 already existing products
INSPECT: phpMyAdmin shows four products in the table #__hikashop_product
INSPECT: Variants recognized in the back-end, with correct pricing
INSPECT: All variants appear, prices are not updated when selecting a variant, no suffix is displayed for the variant in the product name.
ACTION: Product -> Manage variants ->
Before configuring the variant of your product, you need to first create one or several characteristics with the menu Products->Characteristics, and then add one or several characteristics to your product
INSPECT: Variants are removed from the front-end; product is free
INSPECT: phpMyAdmin shows only one product in the table #__hikashop_product; all variants are gone
INSPECT: in the back-end, all variants are gone as well.
Test case 2:
The file to import the main product:
product_name;product_code;product_type;product_parent_id;package;price_value
candy;;main;;;
And the file to import all variants somewhat later:
product_name;product_code;product_type;product_parent_id;package;price_value
candy-bar;;variant;candy;bar;3
candy-bottle;;variant;candy;bottle;4
candy-box;;variant;candy;box;5
And this is what happens:
ACTION: Import main product,
OK -> 1 products found : 1 new products imported, 0 invalid product code, 0 already existing products
ACTION: Product -> Add characteristics
INSPECT: Three additional products without name are found in phpMyAdmin, all child of the just imported product
INSPECT: Three variants are shown in the back-end
INSPECT: Three variants are shown in the front-end, suffixes are displayed for the variant in the product name. No variant has a price, which is in-line with expectations.
ACTION 2: Import variants, OK ->
3 products found : 3 new products imported, 0 invalid product code, 0 already existing products
INSPECT: Three additional variants with name are now found in phpMyAdmin, making in total 6 variants
INSPECT: The newly imported variants are orphans
INSPECT: The newly imported variants don show in the back-end
INSPECT: No price information is available in the front-end
Test case 3
The file to import the main product
product_name;product_code;product_type;product_parent_id;package;price_value
cookie;;main;;;
The file to import the variants later:
product_name;product_code;product_type;product_parent_id;package;price_value
cookie;;main;;;
cookie-bar;;variant;cookie;bar;3
cookie-bottle;;variant;cookie;bottle;4
cookie-box;;variant;cookie;box;5
Note that the variant file this time also contains the main product
Then this is what happens:
ACTION: Import main product, OK ->
1 products found : 1 new products imported, 0 invalid product code, 0 already existing products
ACTION: Product -> Add characteristics
ACTION: Product -> Manage variants -> delete all
INSPECT: Three additional products without name are found in phpMyAdmin, all child of the just imported product
INSPECT: Three variants are shown in the back-end, having no names
INSPECT: Three variants are shown in the front-end, suffixes are displayed for the variant in the product name. No variant has a price, which is in-line with expectations.
ACTION 2: Import variants, OK ->
4 products found : 3 new products imported, 0 invalid product code, 1 already existing products
INSPECT: The variants are updated with the newly read information, as shown in phpMyAdmin
INSPECT: The back-end shows the correct structure
INSPECT: The front-end displays the variants with variant price and package suffix in the title --> SUCCESS
Test case 4
The file for the product and variants, actually the same as test case 1:
product_name;product_code;product_type;product_parent_id;package;price_value
winegum;;main;;;
winegum-bar;;variant;winegum;bar;3
winegum-bottle;;variant;winegum;bottle;4
winegum-box;;variant;winegum;box;5
And here are the test results:
ACTION: Import OK ->
4 products found : 4 new products imported, 0 invalid product code, 0 already existing products
ACTION: Product -> Manage variants ->
Before configuring the variant of your product, you need to first create one or several characteristics with the menu Products->Characteristics, and then add one or several characteristics to your product
ACTION: Product -> add characteristics
ACTION: Product -> Manage variants -> select and delete all
INSPECT: Unnamed variants still exists in the back-end
ACTION 2:Import again, same file, OK ->
4 products found : 3 new products imported, 0 invalid product code, 1 already existing products
INSPECT: Everything is fine --> SUCCESS
Conclusions
- To import variants, the file must also name the main product. Having the main product already loaded is not sufficient
- The way to load variants is to first create these using "add characteristics", then delete all created variants, then load the variants.
Can someone help here?
Thanks and regards,
Paul
-- HikaShop version -- : 2.3.0 Business edition
-- Joomla version -- : 3.2.3
-- PHP version -- : 5.5.9-1 Ubuntu
-- Browser(s) name and version -- : Chrome