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

#   Fields in #\_\_hikashop\_category, left and right?

##

- **[shpuser](/forum/user/30542-shpuser "View shpuser's Profile")**
- [![shpuser's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/cat.png)](/forum/user/30542-shpuser "View shpuser's Profile") Topic Author
- [ Offline](/forum/user/30542-shpuser)

Less More

- Posts: 97
- Thank you received: 0
-
-

12 years 1 month ago [\#173884](#173884) by [shpuser](/forum/user/30542-shpuser "View shpuser's Profile")  *[Fields in #\_\_hikashop\_category, left and right?](/forum/31-development/872008-fields-in-hikashop-category-left-and-right#173884 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 3.3.4  I import categories with a custom script and everything is ok. but i try to add a product to this cateogry then is category path wrong:http://prntscr.com/4s0zwi, i seen in database, in the table for cateogries are two fields and they are everytime different: &quot;category&#95;left and category&#95;right&quot;, which type of values how i to generate to have true category path? At the moment are my all values on: 0   prntscr.com/4s0zcu")* was created by *[shpuser](/forum/user/30542-shpuser "View shpuser's Profile")*

-- HikaShop version -- : 2.3.3
-- Joomla version -- : 3.3.4

I import categories with a custom script and everything is ok. but i try to add a product to this cateogry then is category path wrong:http://prntscr.com/4s0zwi, i seen in database, in the table for cateogries are two fields and they are everytime different:
"category_left and category_right", which type of values how i to generate to have true category path?
At the moment are my all values on: 0 [ prntscr.com/4s0zcu](http://prntscr.com/4s0zcu)

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

12 years 1 month ago -  12 years 1 month ago [\#173888](#173888) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Fields in #\_\_hikashop\_category, left and right?](/forum/31-development/872008-fields-in-hikashop-category-left-and-right#173888 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 3.3.4  I import categories with a custom script and everything is ok. but i try to add a product to this cateogry then is category path wrong:http://prntscr.com/4s0zwi, i seen in database, in the table for cateogries are two fields and they are everytime different: &quot;category&#95;left and category&#95;right&quot;, which type of values how i to generate to have true category path? At the moment are my all values on: 0   prntscr.com/4s0zcu")*

Hi,

Left/Right is coming from the "b tree" algorithm, also use in Joomla for they tree structures.
It's not related to HikaShop.

[ en.wikipedia.org/wiki/B-tree](http://en.wikipedia.org/wiki/B-tree)

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Last edit: 12 years 1 month ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile").

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

- **[shpuser](/forum/user/30542-shpuser "View shpuser's Profile")**
- [![shpuser's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/cat.png)](/forum/user/30542-shpuser "View shpuser's Profile") Topic Author
- [ Offline](/forum/user/30542-shpuser)

Less More

- Posts: 97
- Thank you received: 0
-
-

12 years 1 month ago [\#174411](#174411) by [shpuser](/forum/user/30542-shpuser "View shpuser's Profile")  Replied by *[shpuser](/forum/user/30542-shpuser "View shpuser's Profile")* on topic *[Fields in #\_\_hikashop\_category, left and right?](/forum/31-development/872008-fields-in-hikashop-category-left-and-right#174411 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 3.3.4  I import categories with a custom script and everything is ok. but i try to add a product to this cateogry then is category path wrong:http://prntscr.com/4s0zwi, i seen in database, in the table for cateogries are two fields and they are everytime different: &quot;category&#95;left and category&#95;right&quot;, which type of values how i to generate to have true category path? At the moment are my all values on: 0   prntscr.com/4s0zcu")*

Ok. many thanks, can you please give me a guide, which values have i to insert, are they a auto values as primary key? A read this but technical i have no idea...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3MjAwOC1maWVsZHMtaW4taGlrYXNob3AtY2F0ZWdvcnktbGVmdC1hbmQtcmlnaHQ/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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

12 years 1 month ago [\#174412](#174412) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Fields in #\_\_hikashop\_category, left and right?](/forum/31-development/872008-fields-in-hikashop-category-left-and-right#174412 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 3.3.4  I import categories with a custom script and everything is ok. but i try to add a product to this cateogry then is category path wrong:http://prntscr.com/4s0zwi, i seen in database, in the table for cateogries are two fields and they are everytime different: &quot;category&#95;left and category&#95;right&quot;, which type of values how i to generate to have true category path? At the moment are my all values on: 0   prntscr.com/4s0zcu")*

Hi,

HikaShop has a built-in function to regenerate all the left/right/level fields of all the categories. It's done when you click on the "rebuild" button of the categories listing in the backend.
So you could simply call that same code from your script.
You can look at the rebuild() function of administrator/components/com_hikashop/controllers/category.php

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

- **[shpuser](/forum/user/30542-shpuser "View shpuser's Profile")**
- [![shpuser's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/cat.png)](/forum/user/30542-shpuser "View shpuser's Profile") Topic Author
- [ Offline](/forum/user/30542-shpuser)

Less More

- Posts: 97
- Thank you received: 0
-
-

12 years 1 month ago [\#174497](#174497) by [shpuser](/forum/user/30542-shpuser "View shpuser's Profile")  Replied by *[shpuser](/forum/user/30542-shpuser "View shpuser's Profile")* on topic *[Fields in #\_\_hikashop\_category, left and right?](/forum/31-development/872008-fields-in-hikashop-category-left-and-right#174497 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 3.3.4  I import categories with a custom script and everything is ok. but i try to add a product to this cateogry then is category path wrong:http://prntscr.com/4s0zwi, i seen in database, in the table for cateogries are two fields and they are everytime different: &quot;category&#95;left and category&#95;right&quot;, which type of values how i to generate to have true category path? At the moment are my all values on: 0   prntscr.com/4s0zcu")*

I implemented it in my script, works well, thank you...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3MjAwOC1maWVsZHMtaW4taGlrYXNob3AtY2F0ZWdvcnktbGVmdC1hbmQtcmlnaHQ/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.082 seconds

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