Why is variant import so dificult

  • Posts: 16
  • Thank you received: 1
9 years 8 months ago #193216

-- HikaShop version -- : HikaShop Essential: 2.3.5
-- Joomla version -- : 3.4.0
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : Chrome

I am finding it nearly impossible to import very simple variant data using a csv file. I have scoured the forums and found plenty of confusion, but no real answers. Could someone please instruct me clearly and as simply as possible how to upload two size variants, A and B. For testing purposes I have a product with a product_code of 201. It exists already and there also exists a characteristic called Size. I want to add two variants for the size characteristic, A and B and attach it to the product with product_code 201.

Could someone please show me the textarea import code to accomplish this?

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

  • Posts: 12953
  • Thank you received: 1778
9 years 8 months ago #193243

Hello,

Could someone please instruct me clearly and as simply as possible how to upload two size variants, A and B

The solution will just be to manually create your product with some variants through your website, export it through a CSV file, and then use that CSV file as a model to import other products.

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

  • Posts: 16
  • Thank you received: 1
9 years 8 months ago #193352

I have seen that solution posted over and over. I have been trying to do it from that export for two days. I need to know what the mandatory fields are to create a new variant and attach it to an existing characteristic (Size) and then attach it all to a product. I would like to test it using the text area import. So please, what are the mandatory fields? I want to start with the absolute minimum and work up. First, I just want to see a variant added and attached to the correct characteristic and the characteristic attached to the product. It seems so simple ...

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 8 months ago #193377

Hi,

It's not complex if you know what you're doing.
We actually have a ready made example in the import documentation:
www.hikashop.com/support/support/documen...hikashop-import.html
It's actually almost like what you want:
product_code,product_parent_id,Size
201,,A
first_variant,201,A
second_variant,201,B

supposing that your product's code is 201.

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

  • Posts: 16
  • Thank you received: 1
9 years 8 months ago #193586

I guess when you say "know what you are doing" you mean that I should have degree in Hikashop in order to do a basic product import. I think I have figured it out because I do know what I'm doing, despite the complete lack of comprehensive instruction. The link you sent me to I visited as a starting point, two days ago. It should have been the endpoint! I wish it had included these juicy tidbits:

1) The column name "size" is the name of the characteristic that will be attached to the product. This characteristic NEEDS to already exist in the database. That means that you must manually setup any characteristics that you intend to import variants for. If you had a characteristic called "Color", you could include another column named 'color' to include import data for those variants. It should be noted that in addition to manually creating the characteristic itself, you must manually add any variants that you intend to use. If you were using a characteristic called 'color' you might setup red, blue, yellow and green, even though you won't apply all of them to every product. But they must exist if you are going to use them ever in the import.
2) The column names in the first row allow the ability to include columns from the product database for pricing, etc. (ex: you could include a price_value column to set a separate price for each variant
3) The second line (201,,A) attaches the characteristic to the product and sets the default variant
4) Lines 3 and 4 add variants attached to a particular product based on the product_parent_id. (See problems below)
5) The column that is specific to the characteristic ('size' in my example, another example might be 'color') in lines 3 and 4 binds the variant to an existing variant. The existing information will be used in the characteristic display, but you can set some information, price, for instance

These are a few things that would have helped me understand and hopefully they will help someone else understand in case they don't "know what they are doing". Please correct anything I have misstated.

On another note, there seems to be a major flaw in the design of this import structure and it is this: The parent_product_id that is used to connect characteristics and variants to the product is an unknown at the time of the import. It should be keyed on the product_code of the parent, not the product_id. In my instance, the product_code is an identity id anyway, so I can import my products by setting the id. But that is going to cause problems down the road if I import new products. Those ids will have been used up by variants, etc in the products table so I will end up updating those instead of inserting the new products. Maybe you should fix that?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 8 months ago #193680

Hi,

Thank you for your feedback on the import documentation.
I thought there was already a bit explaining that you needed the characteristics/values already in the database. But normally, when you follow the documentation, it says that you need to first create a sample product and export it to see what you get in the exported CSV, so that should already be the case when you do the import. Nevertheless, I've added that information to the documentation. It's better like that than letting people figure it out.
I've also added some other pieces that you suggested.

Regarding your question with the product_parent_id column, which is unknown what you import, you're totally correct. And it could indeed a major issue. That's why the second sentence of the "import products with variants" section of that documentation says:
"You will have to specify in the product_parent_id column the product_code of the main product which must be inserted before the variants in the file."
So you can enter the product_code of the main product in that column and it will work. It's actually how it is in the example of the documentation, and the example I gave you, which both use the product_code of the main product in that product_parent_id column. So the fix is already there.
I would advise that you replace the product ids by the product codes in that field of your CSV in order to avoid any kind of surprise in the future if you import again the CSV.

Again, thank you for your feedback. I might have been a bit harsh in my message but it sounded like yours were at least as harsh as mine regarding the import "almost impossible to use". Sorry for that.

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

  • Posts: 16
  • Thank you received: 1
9 years 8 months ago #193740

You are correct, there was documentation concerning using the product_code in the product_parent_id column. It must have gotten lost as I was turning in circles. I just imported the data using that technique and everything looks great! The new instructions look good as well and hopefully will help someone in the future. Thanks!

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

  • Posts: 41
  • Thank you received: 0
9 years 8 months ago #193889

The more I use Hika Shop the more I believe this was written for programmers, not people who want to do business. Characteristics is idiotic and adding anything doesn't work... OMFG...

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 8 months ago #193904

Several bugs have been reported with characteristics with Joomla 3.4 due to the way the popup system has been modified in that version of Joomla.
We've patched HikaShop since then in order to fix the different issues.
For example:
www.hikashop.com/support/forum/product-c...cs-error/193546.html

The best is that you download again the HikaShop install package from our website and install it on your website. It contains the several fixes that we added in the last few days so that it works properly with the new version of Joomla.

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

  • Posts: 41
  • Thank you received: 0
9 years 8 months ago #194140

Thank you.
But you know... the stinky smell stays and I feel a bit demotivated : /

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 8 months ago #194164

We unfortunately cannot anticipate bugs that will come down the road two months after our release in a version of Joomla which didn't exist at the time.
We've fixed the bugs as soon as we found out about them.

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

Time to create page: 0.090 seconds
Powered by Kunena Forum