VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Rsn on August 07, 2018, 06:47:57 AM

Title: VirtueMart Category Module Bag
Post by: Rsn on August 07, 2018, 06:47:57 AM
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!
Title: Re: VirtueMart Category Module Bag
Post by: Studio 42 on August 07, 2018, 14:16:32 PM
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
Title: Re: VirtueMart Category Module Bag
Post by: Rsn on August 08, 2018, 06:16:31 AM
Is there any way to solve this problem?
Title: Re: VirtueMart Category Module Bag
Post by: Studio 42 on August 08, 2018, 12:27:36 PM
A simple way ? I dont think.
Use full category tree then menu ID is set
Title: Re: VirtueMart Category Module Bag
Post by: Rsn on August 09, 2018, 06:56:26 AM
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.
Title: Re: VirtueMart Category Module Bag
Post by: Ghost on August 09, 2018, 08:27:08 AM
On product view, fetch the product and compare against its categories.
Title: Re: VirtueMart Category Module Bag
Post by: Rsn on August 10, 2018, 07:13:12 AM
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.
Title: Re: VirtueMart Category Module Bag
Post by: 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.
Title: Re: VirtueMart Category Module Bag
Post by: Studio 42 on August 10, 2018, 18:19:30 PM
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 ?
Title: Re: VirtueMart Category Module Bag
Post by: Rsn on August 13, 2018, 13:41:57 PM
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.
Title: Re: VirtueMart Category Module Bag
Post by: 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 ....)
Title: Re: VirtueMart Category Module Bag
Post by: Rsn on August 13, 2018, 15:41:51 PM
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.
Title: Re: VirtueMart Category Module Bag
Post by: Rsn on August 13, 2018, 15:44:43 PM
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');
            }
        });
    });