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

#   my wrong category tree

##

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

Less More

- Posts: 10
- Thank you received: 0
-
-

13 years 7 months ago [\#93502](#93502) by [manolo2119](/forum/user/9645-manolo2119 "View manolo2119's Profile")  *[my wrong category tree](/forum/2-general-talk-about-hikashop/79072-my-wrong-category-tree#93502 "Hello, my wrong category tree. The breadcrumbs do not work well.  I saw in a post:  As expected, there was no issue in HikaShop. The problem was the category tree data which was completely screwed up in the database. So the system wasn't able to load the categories properly on your website to calculate the breacrumb. I've fixed the data in the database via a hidden category tree rebuild function and the breadcrumb now works properly on your website as far as I can see.  How I can rebuild category tree?.  Thanks    www.mrodriguez.es  Hikashop 1.5.7 Joomla 2.5.9")* was created by *[manolo2119](/forum/user/9645-manolo2119 "View manolo2119's Profile")*

Hello, my wrong category tree. The breadcrumbs do not work well.

I saw in a post:

As expected, there was no issue in HikaShop. The problem was the category tree data which was completely screwed up in the database. So the system wasn't able to load the categories properly on your website to calculate the breacrumb.
I've fixed the data in the database via a hidden category tree rebuild function and the breadcrumb now works properly on your website as far as I can see.

How I can rebuild category tree?.

Thanks

[ www.mrodriguez.es](http://www.mrodriguez.es)
Hikashop 1.5.7
Joomla 2.5.9

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5MDcyLW15LXdyb25nLWNhdGVnb3J5LXRyZWU/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

13 years 7 months ago [\#93580](#93580) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[my wrong category tree](/forum/2-general-talk-about-hikashop/79072-my-wrong-category-tree#93580 "Hello, my wrong category tree. The breadcrumbs do not work well.  I saw in a post:  As expected, there was no issue in HikaShop. The problem was the category tree data which was completely screwed up in the database. So the system wasn't able to load the categories properly on your website to calculate the breacrumb. I've fixed the data in the database via a hidden category tree rebuild function and the breadcrumb now works properly on your website as far as I can see.  How I can rebuild category tree?.  Thanks    www.mrodriguez.es  Hikashop 1.5.7 Joomla 2.5.9")*

A button will be present in next version of HikaShop to rebuild the category tree automatically.
We're currently working towards the release and we plan on doing it next week.

In the mean time, you would have to add the code: Code:

&lt;?php $class = hikashop_get('class.category'); $database = JFactory::getDBO(); $query = 'SELECT category_left,category_right,category_depth,category_id,category_parent_id FROM #__hikashop_category ORDER BY category_left ASC'; $database-&gt;setQuery($query); $root = null; $categories = $database-&gt;loadObjectList(); $class-&gt;categories = array(); foreach($categories as $cat){ $class-&gt;categories[$cat-&gt;category_parent_id][]=$cat; if(empty($cat-&gt;category_parent_id)){ $root = $cat; } } $class-&gt;rebuildTree($root,0,1); ?&gt;

in a view file via the menu Display-&gt;Views and display that view so that the code gets executed and that the category tree gets rebuilt.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5MDcyLW15LXdyb25nLWNhdGVnb3J5LXRyZWU/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 10
- Thank you received: 0
-
-

13 years 7 months ago [\#93654](#93654) by [manolo2119](/forum/user/9645-manolo2119 "View manolo2119's Profile")  Replied by *[manolo2119](/forum/user/9645-manolo2119 "View manolo2119's Profile")* on topic *[my wrong category tree](/forum/2-general-talk-about-hikashop/79072-my-wrong-category-tree#93654 "Hello, my wrong category tree. The breadcrumbs do not work well.  I saw in a post:  As expected, there was no issue in HikaShop. The problem was the category tree data which was completely screwed up in the database. So the system wasn't able to load the categories properly on your website to calculate the breacrumb. I've fixed the data in the database via a hidden category tree rebuild function and the breadcrumb now works properly on your website as far as I can see.  How I can rebuild category tree?.  Thanks    www.mrodriguez.es  Hikashop 1.5.7 Joomla 2.5.9")*

I do not think I understand correctly.

in menu Display-&gt; Views, in any file paste the code

apply

And now this?

This is what I've done, but it does not work.

1. How could execute the code?

or

2.You can make it through the database, how?

Thank

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5MDcyLW15LXdyb25nLWNhdGVnb3J5LXRyZWU/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

13 years 7 months ago [\#93749](#93749) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[my wrong category tree](/forum/2-general-talk-about-hikashop/79072-my-wrong-category-tree#93749 "Hello, my wrong category tree. The breadcrumbs do not work well.  I saw in a post:  As expected, there was no issue in HikaShop. The problem was the category tree data which was completely screwed up in the database. So the system wasn't able to load the categories properly on your website to calculate the breacrumb. I've fixed the data in the database via a hidden category tree rebuild function and the breadcrumb now works properly on your website as far as I can see.  How I can rebuild category tree?.  Thanks    www.mrodriguez.es  Hikashop 1.5.7 Joomla 2.5.9")*

You need to add it in a view that you will then display so that the code gets executed.
For example, you can add it at the beginning of the "config" file of the "config" view for your backend template and each time you access the configuration page the script will be run.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5MDcyLW15LXdyb25nLWNhdGVnb3J5LXRyZWU/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 10
- Thank you received: 0
-
-

13 years 7 months ago [\#93781](#93781) by [manolo2119](/forum/user/9645-manolo2119 "View manolo2119's Profile")  Replied by *[manolo2119](/forum/user/9645-manolo2119 "View manolo2119's Profile")* on topic *[my wrong category tree](/forum/2-general-talk-about-hikashop/79072-my-wrong-category-tree#93781 "Hello, my wrong category tree. The breadcrumbs do not work well.  I saw in a post:  As expected, there was no issue in HikaShop. The problem was the category tree data which was completely screwed up in the database. So the system wasn't able to load the categories properly on your website to calculate the breacrumb. I've fixed the data in the database via a hidden category tree rebuild function and the breadcrumb now works properly on your website as far as I can see.  How I can rebuild category tree?.  Thanks    www.mrodriguez.es  Hikashop 1.5.7 Joomla 2.5.9")*

I added the code in my template config file. Dispaly -&gt; view

Then I went into system settings. But the categories still fail in the bread crumbs.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5MDcyLW15LXdyb25nLWNhdGVnb3J5LXRyZWU/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

13 years 7 months ago [\#93794](#93794) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[my wrong category tree](/forum/2-general-talk-about-hikashop/79072-my-wrong-category-tree#93794 "Hello, my wrong category tree. The breadcrumbs do not work well.  I saw in a post:  As expected, there was no issue in HikaShop. The problem was the category tree data which was completely screwed up in the database. So the system wasn't able to load the categories properly on your website to calculate the breacrumb. I've fixed the data in the database via a hidden category tree rebuild function and the breadcrumb now works properly on your website as far as I can see.  How I can rebuild category tree?.  Thanks    www.mrodriguez.es  Hikashop 1.5.7 Joomla 2.5.9")*

That code is to rebuild the category tree if it has a problem. It doesn't magically fix issues with breadcrumbs. It only fix the fact that if the category tree is out of synch, the system cannot retrieve properly the breadcrumb categories.
So your properly is probably elsewhere. For example, an issue in the SEF options of the HikaShop configuration ?
Also, I see that you're using an old version of HikaShop. Maybe it's something that we already fixed which is causing that.

The following user(s) said Thank You: [manolo2119](/forum/user/9645-manolo2119 "View manolo2119's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5MDcyLW15LXdyb25nLWNhdGVnb3J5LXRyZWU/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 1192
- Thank you received: 13
-
-

13 years 7 months ago [\#96265](#96265) by [verzevoul](/forum/user/8351-verzevoul "View verzevoul's Profile")  Replied by *[verzevoul](/forum/user/8351-verzevoul "View verzevoul's Profile")* on topic *[my wrong category tree](/forum/2-general-talk-about-hikashop/79072-my-wrong-category-tree#96265 "Hello, my wrong category tree. The breadcrumbs do not work well.  I saw in a post:  As expected, there was no issue in HikaShop. The problem was the category tree data which was completely screwed up in the database. So the system wasn't able to load the categories properly on your website to calculate the breacrumb. I've fixed the data in the database via a hidden category tree rebuild function and the breadcrumb now works properly on your website as far as I can see.  How I can rebuild category tree?.  Thanks    www.mrodriguez.es  Hikashop 1.5.7 Joomla 2.5.9")*

Nicolas I confirm that it has to do with breadrumbs.
I pasted the code in the config / config.php
I clicked and navigated in the backend configuration page, but script didn t run. When I manually change values category_left and category_right, breadcrumbs give many paths (i dont know the right values so I copied the values from category_parent_id and pasted in category_left and category_right, to see if something changes in breadcrumbs. It changes.
What am I doing wrong?
Why the script doesnt work for me. I saw in phpmyadmin, values are still like I pasted them even if I navigate in hikashop configuration page.

Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5MDcyLW15LXdyb25nLWNhdGVnb3J5LXRyZWU/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 1192
- Thank you received: 13
-
-

13 years 7 months ago [\#96270](#96270) by [verzevoul](/forum/user/8351-verzevoul "View verzevoul's Profile")  Replied by *[verzevoul](/forum/user/8351-verzevoul "View verzevoul's Profile")* on topic *[my wrong category tree](/forum/2-general-talk-about-hikashop/79072-my-wrong-category-tree#96270 "Hello, my wrong category tree. The breadcrumbs do not work well.  I saw in a post:  As expected, there was no issue in HikaShop. The problem was the category tree data which was completely screwed up in the database. So the system wasn't able to load the categories properly on your website to calculate the breacrumb. I've fixed the data in the database via a hidden category tree rebuild function and the breadcrumb now works properly on your website as far as I can see.  How I can rebuild category tree?.  Thanks    www.mrodriguez.es  Hikashop 1.5.7 Joomla 2.5.9")*

Sorry!
It works perfect... breadcumbs too.!!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5MDcyLW15LXdyb25nLWNhdGVnb3J5LXRyZWU/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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.093 seconds

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