Product & category import in xml format

  • Posts: 10
  • Thank you received: 0
10 years 6 months ago #154985

Hello,
I have to add functionality of importing product & categories in xml format in hika shop.
I have done with layouts & all. but in code when I select xml file & echo it itis giving me blank file & give warning for selecting a file & process stops there.

Can anyone help me???? It's quite urgent task for me.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 6 months ago #154993

Hi,

We would need to know what exact modifications you have done to be able to help you.

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

  • Posts: 10
  • Thank you received: 0
10 years 6 months ago #155111

I have done with UI & flow till selecting the xml file & getting content from that xml file. but now the problem is hoe to insert those product or categories in database tables by checking its depth & all. I have the format of that xml which is attached with it.
Now I just want to insert those rows in db.

Attachments:
Last edit: 10 years 6 months ago by harvi.

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

  • Posts: 13201
  • Thank you received: 2322
10 years 6 months ago #155128

Hi,

You can see the structure of the table #__hikashop_product to see how it's managed.
The entries are simple, the only thing is if the products have variants, so you have to put the main product in the table, get its id, and use it for the variants as the product_parent_id.

You will have too to fill the table #__hikashop_product_category, it's only a correspondence table, you just have to set the product_id and the category _id to create a relation.

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

  • Posts: 10
  • Thank you received: 0
10 years 6 months ago #155366

Hi,

Can you pl tell me in which tables I have to made entries in order to insert new variant of any product.
Variants are fixed that it will be either size or color.
Pl. reply ASAP. It's very urgent for me.

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

  • Posts: 10
  • Thank you received: 0
10 years 6 months ago #155368

Hi

I have done for category xml import but in that I have to import category images also.So can anyone tell me where can I insert images for category...

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

  • Posts: 10
  • Thank you received: 0
10 years 6 months ago #155437

In order to insert product variant I have made db entries in following tables :

=> hikashop_characteristic
=> hikashop_variant
=> hikashop_product

db shows the variant entry but I am not getting variant in product display.
So, help me to show variants in product display.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 6 months ago #155448

Hi,

It means that you're missing some entries in these tables.
You need :
one entry for the characteristic in the hikashop_characteristic table
one entry for each value of the characteristic in the hikashop_characteristic table with their characteristic_parent_id pointing to the characteristic_id of the characteristic entry.
one entry in the hikashop_product table for the main product
one entry for each variant of the product in the hikashop_product table with their product_parent_id pointing to the product_id of the main product entry.
one entry linking the characteristic with the main product in the hikashop_variant table
one entry linking the default value of the characteristic with the main product in the hikashop_variant table
one entry linking each value of the characteristic with its corresponding variant in the hikashop_variant table

The following user(s) said Thank You: harvi

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

  • Posts: 10
  • Thank you received: 0
10 years 6 months ago #155519

Hi,

I have done all the entries those you explain but still I am not getting variants in product display.
Here I have attached screenshots for all related tables with main product & variant entries. Just check it & tell me where i am missing the thing. product #1001 is main product & product #1000482 is variant for main product #1001.
@ Admin panel on product view it is showing the variant with its value(Showing proper variant of main product) but
@ front on product view it is showing Color "No values found".

Attachments:
Last edit: 10 years 6 months ago by harvi.

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

  • Posts: 10
  • Thank you received: 0
10 years 6 months ago #155528

Hi,
Can anyone tell me where images for categories & products are stored?(in which table?)

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 6 months ago #155553

Hi,

In the screenshot www.hikashop.com/media/kunena/attachments/32517/h702fbec.png you're missing a link between the characteristic value "colorato" and the variant of your product with the id 1000482

The images are stored in the hikahsop_file table with the file_ref_id being the id of the product/category. Make sure that the file_type is set to the correct type as the table also stores product files.

The following user(s) said Thank You: harvi

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

  • Posts: 10
  • Thank you received: 0
10 years 6 months ago #155734

Hi nicolas,

Thanks for your help. It works for me.

Now I have to import images for variants. Different image for different color.
I have two variants Color & Size.
For each color (regardless the “size”) a Product-Variation-Image can be available.

I am not getting hoe to do it. Can you anyone tell me how can I do it?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 6 months ago #155739

You do not have two variants. You have two characteristics.
Variants are the combination of all the possible values of each characteristic.
Si if you have 3 values (red blue green) for the first characteristic and 2 values (big small) for the second, that will give you 6 variants that you can edit via the button "manage variants" of your product.
And thus, in the 2 variants for red, you want your red image, in the 2 variants for blue, you want your blue image and in the 2 variants for green, you want your green image.

So in the hikashop_file table, with that example, you would need 6 entries, one for each variant.

The following user(s) said Thank You: harvi

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

Time to create page: 0.093 seconds
Powered by Kunena Forum