News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

[BUG] Hidden category shown on breadcumb

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

Previous topic - Next topic

Marttyn

Thanks Milbo!
I will consider a membership.
But unfortunately, when i saw the bug and no quick solution, i opted for the suggested method of giving a manufacturer to all of my products.
Anyway, i "recreated" a similar category structure, and all problems seems to dissapear except for this:
-unpublished category name appended to the page/tab name
-breadcrumb of the product is under root instead of the parent category
-SEF url has the same problem as the breadcrumb

The first problem can be solved changing /components/com_virtuemart/views/productdetails/view.html.php :
$document->setTitle(strip_tags(html_entity_decode(($category->category_name ? (vmText::_($category->category_name) . ' : ') : '') . $product->product_name,ENT_QUOTES)));
to this:
$document->setTitle(strip_tags(html_entity_decode(($category->category_name ? ($category->published ? (vmText::_($category->category_name) . ' : ') : '') : '') . $product->product_name,ENT_QUOTES)));

And I think the two last are not really problems, its the regular behaviour, as the product in fact dont have any published category... anyway, it would be better to keep the category of the parent for both the URL and the breadcrumb. Just a suggestion.

Milbo

I use now

$category = '';
if($category->published and !empty($category->category_name)){
$category = $category->category_name.': ';
}
$document->setTitle(strip_tags(html_entity_decode($category . $product->product_name,ENT_QUOTES)));


is nicer to read. The others are not really a problem and yes, there is imho even a method to get the prior category, but ... only when the product is in more than one category. We cannot list the product below the wrong category.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/


aftertaf

hi,
will this make it into the next version in that case ? :)

Studio 42

Note that if you use shorten url, in product details the breadcrumb is empty and dont use the last visited category(nothing to do with this bug, but with breadcrumb).