Breadcrumbs broken when using carousel

  • Posts: 36
  • Thank you received: 0
7 years 11 months ago #159647

-- url of the page with the problem -- : mywebsite.com/mypage
-- HikaShop version -- : 2.3.1
-- Joomla version -- : 2.3.2
-- PHP version -- : x.x.x
-- Browser(s) name and version -- : Chrome
-- Error-message(debug-mod must be tuned on) -- : Error_message

When I create a category carousel and click on a category shown in it. I get to the category, but the breadcrumbs show all categories and not the real path.

For example: Real path

Startseite > Edelrosen

path shown after clicking on carousel

Startseite > Edelrosen > Rosen > Zwergrosen > Kletterrosen > Strauchrosen > Englische und Romantische Rosen > Rugosarosen > Historische Rosen > Bodendeckerrosen > Wildrosen > Rosenbegleiter > Stauden > Kräuter > Clematis > Gehölze > Rosenpflege > Dünger > Pflanzenpflege > Werkzeug und Material > Bücher > Rosenlädchen > Kosmetik > Kulinarisches > Bücher


What goes wrong?

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

  • Posts: 75517
  • Thank you received: 11750
  • MODERATOR
7 years 11 months ago #159655

Hi,

Could you provide a screenshot of the HikaShop options of your module so that we can see what you did ?

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

  • Posts: 36
  • Thank you received: 0
7 years 11 months ago #159946

Here are two screenshots of the config of the carousel module

Attachments:

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

  • Posts: 75517
  • Thank you received: 11750
  • MODERATOR
7 years 11 months ago #159949

Hi,

Can you click on the "rebuild" button of the categories listing in your HikaShop backend ? It might help fix the problem if it comes from a broken category tree.
If not, could you turn on the debug mode and error reporting options of the Joomla configuration and look at the page with the wrong breadcrumb again ? could you provide a copy of the queries logged at the bottom of the page so that we can see what's going on ?

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

  • Posts: 36
  • Thank you received: 0
7 years 10 months ago #161156

For the first I get this after rebuild which looks kind better

Menu item for category listing module 115 > Rosen > Historische Rosen
How I get rid of the "Menu item of blabla"?

And more interesting for me I create the categories and products throw an import of an XML file of a ERP System. Is it possible that I missed something when I created the categories with my import? That's the code I wrote for it github.com/svanschu/WinArboR-HikaShop-Br...or/models/import.php

Thank you

Last edit: 7 years 10 months ago by svanschu.

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

  • Posts: 75517
  • Thank you received: 11750
  • MODERATOR
7 years 10 months ago #161172

Hi,

1. That is your menu item name. You can go in the Joomla menu manager and change the name of your menu item to something else if you want something else.

2. That's a lot of code to analyze. I didn't find any code relative to the creation of menu items on your code so I don't think that it comes from the import (but maybe I overlooked something?). I think that it's just the joomla menu items tree which was screwed up (it can happen when you have issues with install/uninstall processes, some extensions not handling the menu items properly, etc. It's hard to say exactly why you would have had that on your website). The rebuild button helped fix that.

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

  • Posts: 36
  • Thank you received: 0
7 years 10 months ago #161462

1. Ok need to play with it. The menüitemname should be "Rosen" which is the second part of the breadcrumb (it is also a category name)

2. Totaly understandable. This is the part I create category. Did I miss something? I don't create menus when I create categories.

/**
     * @param $name
     * @param $beschreibung
     * @param $parentId
     * @param $categoryDepth
     * @return mixed
     */
    private function createProductCategory($name, $beschreibung, $parentId, $categoryDepth)
    {
        $db = JFactory::getDbo();
        $query = $db->getQuery(true);
        $time = time();
        $query->insert('#__hikashop_category')
            ->set('category_name = \'' . $name . '\'')
            ->set('category_alias = \'' . JFilterOutput::stringURLSafe($name) . '\'')
            ->set('category_description = \'' . $beschreibung . '\'')
            ->set('category_type = \'product\'')
            ->set('category_parent_id = ' . $parentId)
            ->set('category_published = 1')
            ->set('category_depth = ' . $categoryDepth)
            ->set('category_created = ' . $time)
            ->set('category_modified = ' . $time)
            ->set('category_namekey = \'product_' . $time . '_' . rand() . '\'');
        $db->setQuery($query);
        $db->execute();
        return $db->insertid();
    }

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

  • Posts: 75517
  • Thank you received: 11750
  • MODERATOR
7 years 10 months ago #161485

1. Then you'll end up with Rosen twice in the breadcrumb no ?

2. Yes, you're missing the category_left and category_right columns.
Actually when you add categories, it's a complex process as the whole category tree needs to have its left and right updated as per the binary tree structure principles. The Rebuild button actually fixes the left/right values of all the categories.
The best would actually be to use the save function of the class.category class of HikaShop which handles that automatically for you.
Otherwise, you can have your own queries and then use the rebuild system of HikaShop at the end:
www.hikashop.com/support/forum/2-general...sql-script.html#8552

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

  • Posts: 36
  • Thank you received: 0
7 years 10 months ago #162680

1. Sync with the menu item done what I've wanted

2. Thx I will look into it.

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

Time to create page: 0.071 seconds
Powered by Kunena Forum