[Skip to main content](#vessel-content)

#   How to import categories from another component

##

- **[ydl](/forum/user/30805-ydl "View ydl's Profile")**
- [![ydl's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30805-ydl "View ydl's Profile") Topic Author
- [ Offline](/forum/user/30805-ydl)

Less More

- Posts: 3
- Thank you received: 0
-
-

12 years 9 months ago [\#140634](#140634) by [ydl](/forum/user/30805-ydl "View ydl's Profile")  *[How to import categories from another component](/forum/37-import-export-csv-xls/865204-how-to-import-categories-from-another-component#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 &quot;top&quot; categories shoud have the 'category&#95;parent&#95;id' = 2 (product) the 'category&#95;type' = 'product'  I don't know how to initialize the value of: - category&#95;left - category&#95;right - category&#95;depth - category&#95;namekey (I put a unique name, BUT saw that it is a 'random' one!?) - category&#95;created, category&#95;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.")* was created by *[ydl](/forum/user/30805-ydl "View ydl's Profile")*

-- 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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjUyMDQtaG93LXRvLWltcG9ydC1jYXRlZ29yaWVzLWZyb20tYW5vdGhlci1jb21wb25lbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

12 years 9 months ago [\#140673](#140673) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[How to import categories from another component](/forum/37-import-export-csv-xls/865204-how-to-import-categories-from-another-component#140673 "-- 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 &quot;top&quot; categories shoud have the 'category&#95;parent&#95;id' = 2 (product) the 'category&#95;type' = 'product'  I don't know how to initialize the value of: - category&#95;left - category&#95;right - category&#95;depth - category&#95;namekey (I put a unique name, BUT saw that it is a 'random' one!?) - category&#95;created, category&#95;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.")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjUyMDQtaG93LXRvLWltcG9ydC1jYXRlZ29yaWVzLWZyb20tYW5vdGhlci1jb21wb25lbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[ydl](/forum/user/30805-ydl "View ydl's Profile")**
- [![ydl's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30805-ydl "View ydl's Profile") Topic Author
- [ Offline](/forum/user/30805-ydl)

Less More

- Posts: 3
- Thank you received: 0
-
-

12 years 9 months ago [\#140747](#140747) by [ydl](/forum/user/30805-ydl "View ydl's Profile")  Replied by *[ydl](/forum/user/30805-ydl "View ydl's Profile")* on topic *[How to import categories from another component](/forum/37-import-export-csv-xls/865204-how-to-import-categories-from-another-component#140747 "-- 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 &quot;top&quot; categories shoud have the 'category&#95;parent&#95;id' = 2 (product) the 'category&#95;type' = 'product'  I don't know how to initialize the value of: - category&#95;left - category&#95;right - category&#95;depth - category&#95;namekey (I put a unique name, BUT saw that it is a 'random' one!?) - category&#95;created, category&#95;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.")*

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 ![:-(](/media/kunena/emoticons/4.png ":-(")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjUyMDQtaG93LXRvLWltcG9ydC1jYXRlZ29yaWVzLWZyb20tYW5vdGhlci1jb21wb25lbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86293
- Thank you received: 14271
-
-

12 years 9 months ago [\#140762](#140762) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to import categories from another component](/forum/37-import-export-csv-xls/865204-how-to-import-categories-from-another-component#140762 "-- 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 &quot;top&quot; categories shoud have the 'category&#95;parent&#95;id' = 2 (product) the 'category&#95;type' = 'product'  I don't know how to initialize the value of: - category&#95;left - category&#95;right - category&#95;depth - category&#95;namekey (I put a unique name, BUT saw that it is a 'random' one!?) - category&#95;created, category&#95;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.")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjUyMDQtaG93LXRvLWltcG9ydC1jYXRlZ29yaWVzLWZyb20tYW5vdGhlci1jb21wb25lbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.104 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
