News:

Looking for documentation? Take a look on our wiki

Main Menu

VirtueMart Category Module Bag

Started by Rsn, August 07, 2018, 06:47:57 AM

Previous topic - Next topic

Rsn

Hello!

VirtueMart Category Module
Joomla 3.8.10
VirtueMart 3.2.14
Joomla Global Configuration:  Search Engine Friendly URLs - Yes
VirtueMart - Configuration - SEO Settings: SEO Enabled, Use Product and Category IDs - No, Use full category tree for product links - No.

On product page the module can't indicate the active menu item.

If Joomla Search Engine Friendly - No, or VM Use full category tree for product links - Yes, then the module works fine.

Please, help!

Studio 42

Quote from: Rsn on August 07, 2018, 06:47:57 AM
On product page the module can't indicate the active menu item.
It's the problem wen you disable tree.
The menu ID is set by the category, so removing the alias to category in Joomla mean removing the menu ID and no menu is selected

Rsn

Is there any way to solve this problem?

Studio 42

A simple way ? I dont think.
Use full category tree then menu ID is set

Rsn

Quote from: Studio 42 on August 08, 2018, 12:27:36 PM
Use full category tree then menu ID is set

My shop has a complex and long structure of product categories. If I use a tree, url of the products will be very long. So this option is not suitable for me.

I would like to see the official answer from the developers of Virtuemart.

Ghost

On product view, fetch the product and compare against its categories.

Rsn

On its category view, the parent category is marked in the module.
But on the product view, the parent category is not marked in the module (no "active" class).

This situation is exactly with the settings, that I specified in the beginning of the topic.

Rsn

Quote from: Rsn on August 07, 2018, 06:47:57 AM
On product page the module can't indicate the active menu item.

I meant: it does not indicate the parent category in the module.

Studio 42

Quote from: Rsn on August 10, 2018, 07:16:41 AM
Quote from: Rsn on August 07, 2018, 06:47:57 AM
On product page the module can't indicate the active menu item.

I meant: it does not indicate the parent category in the module.
Do you use VM core category module ?

Rsn

#9
Quote from: Studio 42 on August 10, 2018, 18:19:30 PM
Do you use VM core category module ?

Standard VirtueMart Category module.

And categories are not related to menu items.

Studio 42

I do not know if that is possible, I should do tests and it's to long to do(test if the menu item is set, Check if you can manually set it ....)

Rsn

Quote from: Studio 42 on August 13, 2018, 14:59:52 PM
I do not know if that is possible, I should do tests and it's to long to do(test if the menu item is set, Check if you can manually set it ....)

Thanks. My question is about the situation, when the menu items are not set manually.

Categories will be many and they will change. It will be difficult to keep menu items manually up to date. That's why I use this module with categories, not just a manually created menu.

Rsn

At the moment, I found next way out of the situation:
the definition of the active category using jQuery comparison with links in the breadcrumbs module


// current category in left module on product page
$('.view-productdetails .leftmenucat > ul > li > a').each(function() {
        var left_li_a = $(this);
        $('ul.breadcrumb li a').each(function() {
            if ($(this).attr('href') == left_li_a.attr('href')) {
                left_li_a.parent('li').addClass('active');
            }
        });
    });