Fields in #__hikashop_category, left and right?

  • Posts: 97
  • Thank you received: 0
10 years 1 month ago #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:
"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

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 1 month ago #173888

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

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 10 years 1 month ago by Jerome.

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

  • Posts: 97
  • Thank you received: 0
10 years 1 month ago #174411

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 or Create an account to join the conversation.

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
10 years 1 month ago #174412

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 or Create an account to join the conversation.

  • Posts: 97
  • Thank you received: 0
10 years 1 month ago #174497

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

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

Time to create page: 0.063 seconds
Powered by Kunena Forum