- Posts: 45
- Thank you received: 0
CSV Import of variants not as expected
- paulvanharen
-
Topic Author
- Offline
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
And this is what happens:
ACTION: Import OK ->
INSPECT: phpMyAdmin shows four products in the table #__hikashop_product4 products found : 4 new products imported, 0 invalid product code, 0 already existing products
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 ->
INSPECT: Variants are removed from the front-end; product is freeBefore 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: 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:
And the file to import all variants somewhat later:
And this is what happens:
ACTION: Import main product,
ACTION: Product -> Add characteristicsOK -> 1 products found : 1 new products imported, 0 invalid product code, 0 already existing products
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 ->
INSPECT: Three additional variants with name are now found in phpMyAdmin, making in total 6 variants3 products found : 3 new products imported, 0 invalid product code, 0 already existing products
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
The file to import the variants later:
Note that the variant file this time also contains the main product
Then this is what happens:
ACTION: Import main product, OK ->
ACTION: Product -> Add characteristics1 products found : 1 new products imported, 0 invalid product code, 0 already existing products
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 ->
INSPECT: The variants are updated with the newly read information, as shown in phpMyAdmin4 products found : 3 new products imported, 0 invalid product code, 1 already existing products
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:
And here are the test results:
ACTION: Import OK ->
ACTION: Product -> Manage variants ->4 products found : 4 new products imported, 0 invalid product code, 0 already existing products
ACTION: Product -> add characteristicsBefore 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 -> Manage variants -> select and delete all
INSPECT: Unnamed variants still exists in the back-end
ACTION 2:Import again, same file, OK ->
INSPECT: Everything is fine --> SUCCESS4 products found : 3 new products imported, 0 invalid product code, 1 already existing products
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
Please Log in or Create an account to join the conversation.
Here is how your CSV should be:
Please Log in or Create an account to join the conversation.
- paulvanharen
-
Topic Author
- Offline
- Posts: 45
- Thank you received: 0
Thanks for your help. Test case 1 is now indeed working.
If I apply the same fix to test case 2, it is still malfunctioning. Would you have any suggestion to fix test case 2, or is that simply not possible?
Thanks again, Paul
Please Log in or Create an account to join the conversation.
You can't import pieces of a product in different CSV files.
So the test case 2 won't work.
As you can see in my previous message, and as explained in the import documentation, the product and the variants must both be in the CSV so that the product data is valid
Please Log in or Create an account to join the conversation.
"product_parent_id";"product_name";"product_code";"product_type";"product_manufacturer_id";"product_keywords";"categories";"price_value";"price_currency_id";"options";"capienza";"specifiche";"canali";"regolazione"
"Manfrotto_MB 401N";;"Manfrotto_MB 401N_6";"variant";61;"Manfrotto_MB 401N";;64,14;"EUR";;;"Specifiche";;
;"Manfrotto Pro V Zaino nero medio";"Manfrotto_MB LB050-5BB";"main";61;"Manfrotto_MB LB050-5BB";"Accessori;Borse";;;;;"Specifiche";;
where specifiche is a characteristic and Specifiche is the variant.
After import i get the relation between the main and the variant but in the administration panel of the product the characteristic field is empty. If I try to add the specifiche characteristic then everithing appears with the right values. How I get this field filled after import?
Please Log in or Create an account to join the conversation.
It's better to create the characteristics with the desired variants and then import the products with the variant value set.
So thanks to create the characteristic via Product > Characteristics and then import the desired product.
hikashop.com/support/support/documentati...hikashop-import.html
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.