How to import categories from another component

  • Posts: 3
  • Thank you received: 0
10 years 10 months ago #140634

-- HikaShop version -- : 2.2.3
-- Joomla version -- : 3.2.1

I try to import a list of categories from DJ-Catalog2 to hikashop.
I have a CVS file with all the categories and import it to the SQL directly because I didn't find a category import (just product).
I understand that my "top" categories shoud have the 'category_parent_id' = 2 (product)
the 'category_type' = 'product'

I don't know how to initialize the value of:
- category_left
- category_right
- category_depth
- category_namekey (I put a unique name, BUT saw that it is a 'random' one!?)
- category_created, category_modified - Is this a timestamp?

any help will be appreciated.
I can think about two solutions:
1. Corect the CSV file
2. Have a PHP script to do it

Thanks in advance.

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

  • Posts: 12953
  • Thank you received: 1778
10 years 10 months ago #140673

Hi,
I think that hte best solution will probably be to
- Create some products and categories manually
- Export them through a CSV file
- Edit this CSV file so that you'll be able to add your products and categories in it
- Import your CSV file back

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

  • Posts: 3
  • Thank you received: 0
10 years 10 months ago #140747

Yes, I did it... BUT it does not explain how the attributes I mentioned get the values...
It seems that I have to digg it from the code :-(

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

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

If you import the categories yourself via mysql, the simplest is to leave empty the category_depth category_right and category_left columns and click on the "reduild" button of the categories listing of HikaShop in order to fill them all automatically following the binary tree algorithm in order to increase performances.

The namekey indeed random. Its only purpose is to be unique.

The category_created, category_modified fields are indeed timestamps.

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

Time to create page: 0.066 seconds
Powered by Kunena Forum