Importing categories

  • Posts: 299
  • Thank you received: 2
9 years 9 months ago #190632

-- url of the page with the problem -- : www.bil-filtertjanst.se
-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.29
-- Browser(s) name and version -- : Chrome v 40.0.2214.93 m (64-bit)
-- Error-message(debug-mod must be tuned on) -- : no error message just blank page

HI,
I am about to start a webshop selling filters for cars and other trucks and machines.
THere are a lot of different products as their catalog are around 800 pages of products.
All to be in HikaShop webshop.
Only the categories has to be hundreds...
Now I want to import all categories from an excel file that is saved as a semi colon separated csv file UTF-8.
There are one main category Volvo BM and then the rest is sub categories on the second level.
Just wanted to try two levels first. The end will be like thre levels of categories and then products in the third category level.
Like this:
Machine / Machine model / Motor type
The files looks like this:

categories
Volvo BM;24
Volvo BM;25
Volvo BM;35
Volvo BM;36
Volvo BM;55
Volvo BM;320
Volvo BM;400
Volvo BM;430

etc etc.

But I can't get it working...
Is the file set up the wrong way or what can be wrong?
I have tried both with loading the csv file and to copy all in the txt file and pasting it into the text import field...
Still no go...
Any help is appreciated.

Thanks
Micke

Last edit: 9 years 9 months ago by LAMF.

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

  • Posts: 193
  • Thank you received: 76
9 years 9 months ago #190675

Create csv file with 2 columns:
parent_category and categories

For example if your categories looks like
Volvo BM > 430 > Diesel,
your csv file will looks like:

"parent_category";"categories"
"product_category";"Volvo BM"
"Volvo BM";"430"
"430";"Diesel"

Last edit: 9 years 9 months ago by korzo.
The following user(s) said Thank You: LAMF

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

  • Posts: 299
  • Thank you received: 2
9 years 9 months ago #190740

Ok, thanks!

I think I get it.I have set it up like this:

parent_category;categories
product_category;Volvo BM
Volvo BM;24
Volvo BM;25
Volvo BM;35
This would give me categories like:
Volvo BM > 24
> 25
> 35
Or am I wrong?
I have like at least 100 categories under Volvo BM (models of Volvo BM) then I will start adding different filters and oils under each model.
So primary I will just need Volvo BM > 24, Volvo BM 25 etc...
So if I want to add a new Machine category after Volvo BM I just set the csv file up like:
parent_category;categories
product_category;Valmet Valtra
Valmet Valtra;20
Valmet Valtra;35
Valmet Valtra;359
....
and so on....?

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

  • Posts: 299
  • Thank you received: 2
9 years 9 months ago #190742

Hi again,
I tried to set it up like this:

parent_category;categories
product_category;Volvo BM
Volvo BM;24
Volvo BM;25
Volvo BM;35
Volvo BM;36
Volvo BM;55
Volvo BM;320
Volvo BM;400
Volvo BM;430
Volvo BM;350 Boxer
Volvo BM;470 Bison
MAde th file in notepad and saved as UTF-8 and csv.
IMported it n HikaShop and the categories was indeed created but only Volvo BM > 350 Boxer and Volvo BM > 470 BisonWhy wasn't the subcategories 24,25,35 etc created?

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

  • Posts: 193
  • Thank you received: 76
9 years 9 months ago #190744

You are right.
Categories with only numbers in name are ignored.
Looks like a bug. I will take a look and let you know.

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

  • Posts: 299
  • Thank you received: 2
9 years 9 months ago #190748

I added a space after the ones with only numbers and now they weren't ignored but when I did my first attempt like this:

parent_category;categories
product_category;Volvo BM
Volvo BM;24
Volvo BM;25
Volvo BM;35
Volvo BM;36
Volvo BM;55
Volvo BM;320
Volvo BM;400
Volvo BM;430
Volvo BM;350 Boxer
Volvo BM;470 Bison
it turned out like this in the categories listing with double Volvo BM categories, see image:

So maybe I should not add the product_category;Volvo BM line....

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

  • Posts: 193
  • Thank you received: 76
9 years 9 months ago #190749

It turns out you can't import categories with numeric names.

In administrator\components\com_hikashop\helpers\import.php on line 831

if(!is_numeric($v) || !empty($product->categories_namekey)){

where $v is category name.

Change line 831 to
if(!empty($v) || !empty($product->categories_namekey)){

for categories import, than change it back.
I'm not sure about implications of this change for products import.

The following user(s) said Thank You: LAMF

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

  • Posts: 299
  • Thank you received: 2
9 years 9 months ago #190750

Ok thanks a lot!

Last edit: 9 years 9 months ago by LAMF.

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

  • Posts: 29
  • Thank you received: 0
  • Hikaserial Subscription Hikashop Business
9 years 9 months ago #190781

Hi,
...is there any way to import Category Description ?

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

  • Posts: 299
  • Thank you received: 2
9 years 9 months ago #190810

Yes that would be very good to know.
Also I don't quite get it.
First I imported catgories on three levels
Volvo BM > A-Serien > A20
Volvo BM > A-Serien > A20C
etc.
Like this:

parent_category;categories
Volvo BM;A-Serien
A-Serien;A20
A-Serien;A20C
A-Serien;A25
A-Serien;A25B
It works fine.
Then just to try I wanted to add some products like this:
product_code;product_name;product_manufacturer_id;product_weight;product_weight_unit;price_value;price_currency_id;parent_category;categories
18002;Transmissionsfilter;12;0.39;kg;356.00;SEK;Volvo BM;A-Serien;A20
18003;Transmissionsfilter;12;0.37;kg;396.00;SEK;Volvo BM;A-Serien;A20C
18004;Fuelfilter;12;0.30;kg;256.00;SEK;Volvo BM;A-Serien;A25
18005;Transmissionsfilter;12;2.35;kg;796.00;SEK;Volvo BM;A-Serien;A43
But what happens is that only the first product 18002 Transmissionsfilter.... is added and directly under the Volovo BM > A-Serien category. The other 3 products are ignored and an error message comes up like this:

You need 9 'arguments' per line

What have I done wrong?
Isn't it possible to add a product under a third level category?

Last edit: 9 years 9 months ago by LAMF. Reason: more info added

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

  • Posts: 193
  • Thank you received: 76
9 years 9 months ago #190812

Products in your CSV have one more column than header.
If your categories have unique names(e.g. you don't have several A20 categories), you don't have to set parent_category if category already exists.
Values should be enclosed in quotes, otherwise semicolon is as column separator.

Your last 3 values in each line are wrong.

"Volvo BM";"A-Serien;A20"
Will create 2 categories:
Volvo BM > A-Serien
Volvo BM > A20
If you want to create/add product to category A20 under A-Serien category, it should be
"parent_category";"categories"
"A-Serien";"A20"

Last edit: 9 years 9 months ago by korzo.

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

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

@korzo : thx for the explanations

@Pajerchin:
Not via the interface of HikaShop.
What you can do is export the data of the hikashop_category table of your database via phpmyadmin and fill in the descriptions in that CSV and then import back the CSV in your database via phpmyadmin.
Please open a new thread for new questions.

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

Time to create page: 0.062 seconds
Powered by Kunena Forum