News:

Looking for documentation? Take a look on our wiki

Main Menu

[BUG] Hidden category shown on breadcumb

Started by Marttyn, January 26, 2018, 12:52:36 PM

Previous topic - Next topic

Marttyn

Hi!
Im experiencing some issue i think it should not be the regular behaviour.
In my store i have "regular" categories, and "hidden" categories. The hidden categories are for backend administration purposes. I have one hidden category for every of my product suppliers. So i may have 5 products that i purchase to "Supplier 1", this 5 products have their regular category, and also the hidden category associated to that supplier. This way i can manage stock more easily. And when i need to purchase to one supplier, i can see all the products i purchase from them and also see the stock. This is the way ive found to manage purchasing.
Everything is correct... this are hidden categories, and dont show up in the frontend
But for example, when i create a stockable variant, the child product has a hidden category associated, but no "regular" category, otherwise the child would be shown in that category listing, and i only want to show the parent in the listing.
The problem is that that child shows the hidden category in the breadcrumb  :o
If i remove all categories from the child product, then its ok, and show the correct breadcumb path (the parent path).
Can anyone test this and see if it only happens to me or if its a bug?
Thanks!

Studio 42

Is the "hiden" category published ?
It's only a bug, iif category is unpublished and not if you dont added links to menu.

Marttyn

Sure, my "hidden" categories are unpublished. Otherwise they would show in the categories module.

Studio 42

Have you update VM ?
I dont see your virtuemart release in the post


aftertaf

i've had this happen too... i changed my backend structure to avoid the issue, in the end...

Studio 42

Here the solution
file JOOMLAROOT/administrator/components/com_virtuemart/models/category.php line 709
$select = 'SELECT '.implode(', ',self::joinLangSelectFields($langFields));
$joins = implode(' ',self::joinLangTables('#__virtuemart_categories','c','virtuemart_category_id','FROM'));

replace with
$select = 'SELECT c.published,'.implode(', ',self::joinLangSelectFields($langFields)) .' FROM #__virtuemart_categories as c ';
$joins = implode(' ',self::joinLangTables('#__virtuemart_categories','c','virtuemart_category_id'));


And
file JOOMLAROOT/components/com_virtuemart/views/productdetails/view.html.php line 210
$pathway->addItem(strip_tags(vmText::_($c->category_name)), JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $c->virtuemart_category_id, FALSE));

replace with
if($c->published) {
$pathway->addItem(strip_tags(vmText::_($c->category_name)), JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $c->virtuemart_category_id, FALSE));
}

 
And breacrumb cannot display published categories anymore ;)

Marttyn

Thanks friend for taking the time to check this!
Your mod "kind of fix" the problem, but there are still some other things that still remain unfixed. I think the whole multivariant solution its quite buggy and needs some improvement.
This still have problems (look at the picture):
1. Hidden category name still show on the name of the site
2. URL becomes "broken" with 404 in the path
3. The product path in the breadcrumb is now in root, while it should be the parent path
4. Name of the product dont update when changing from one variant to the other

Regards!

Studio 42

I know that you have other problems, what i don't understand is why published categories can be set in front(i have see comment about price rules that can use unpublished categories , but i think this is bad too).
MAx or other from dev teeam, can you fix this ? i don't want give 20 lines of core hack to reapply each Vm updates.

But how you can have 404 in the breadcrumb, if this is not set ?
Perhpas a solution is to use ordering and set your categories to higher level, or in another category not in root ?
Do you tested such tricks, so the canonical category is not the hidden one ?

Marttyn

I dont understand what you want me to try.
I have a parent category called "Suppliers", and children categories with the names of my suppliers. Just an example:
Suppliers
|_ Amazon
|_ Ebay
|_ Aliexpress

Both the parent and the children categories are hidden (unpublished). And i only apply one child category to each of my product so i know where to purchase them.
On regular products i also have other published categories added to them, but on child multivariant products i only have the hidden category.

Jörgen

I have also seen this issue. In my case using different calculation rules applied to categories. Assigning categories to a Child overrides the categories that otherwise are  inherited from the parent Product. It doesn´t add a new category it replaces the existing ones.

Couldn´t You assign a custom field that is hidden in the front end callied supplier ? You can create a nice drop down of suppliers to choose from.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Studio 42

@Jörgen, i think that he only want use this as filter in back-end, not front, currently VM have only filter category or manufacturer (and vendors).

It seems that VM do not override categories, if some are set in children because it not check if this are unpublished or not.
My trick was to remove the bug, but the problem is that product model do not check for unpublished categories set it in child(and perhaps in parent to ?) and not override it.

A solution, is to use vendor, but you have to manually modify all your products in shop and can give other issues in your case.


Marttyn

Quote from: Jörgen on January 29, 2018, 13:57:16 PM
Couldn´t You assign a custom field that is hidden in the front end callied supplier ? You can create a nice drop down of suppliers to choose from.
In my case, a custom field will not give me a filter on the BE. I use the categories to group all the products from the same supplier. And when i have to order parts to one supplier, i can see all products from that supplier at the same time, and see the stocks for them, and also order other products that have low stock.

Quote from: Studio 42 on January 29, 2018, 16:07:30 PM
A solution, is to use vendor, but you have to manually modify all your products in shop and can give other issues in your case.
It wont be a problem to manually change all the vendors from my products if that solve the problem. And i wasnt doing it that way because my older template was showing the Vendor in the productdetails view. But my new template now doesnt show it, so maybe i can do that! Thanks Patrick!  :D

In any case, although i could solve the problem this way, the bug is still there.

Regards!

Milbo

The solution is to fix the problem, of course. But it is not soo easy to replicate it. I just tried and had no success. VM recognises the unpublished categories, except in some circumstances. I know I could reproduce the problem of Jörgen.

So in your case the problem is that the parent category is completly unpublished, or? btw, buying membership helps me to pay the time for the fix https://extensions.virtuemart.net/support/virtuemart-supporter-membership-silver-detail I looked already into it for Jörg, I also found some, but was not able todo the final fix, yet. There is imho no fast quickndirty solution.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/