Hello VM Heroes,
I will try to be very simple and straight forward.
The problem: in the canonical url's relative path (only in category & sub-category pages) VM inject at the end .../manufacturer/ !
Looks like this - /category/manufacturer/ or /category/sub-category/manufacturer/ and so on...
The canonical URL's of product detailed pages looks: /category/product/ even if your products are in sub-category.
My system are Joomla 3.3.6 -stable, VM - 3.04.
SEF URL is ON
SEF Rewriting is ON (avoid index.php)
Template is based on Joomlart T3 framework bs3_blank
Dynamic VM URL's disactivated
So, how can I get-off from manufacturer in URLs?
Also, question: there is base href tag and canonical present but NOT the same. (ex.: base href - http://yoursite.com/category/sub-categoty/product and canonical url - /category/product).
I think it has to be the same. Where is the bug????
Thanks for all solution and ideas in advance.
Best regards.
Hello,
Nobody has this problem or there is no solutions???
The generated urls depend primarily on how you structured your site and your menus. Can you provide a link to your website, so we can have a look at your site structure and your menus?
Do you make a try with Joomla default template?
I can confirm this
when you use joomla menu to link to a category
& do not choose a manufacturer
It will have /manufacturer in the url
In the menu parameters, virtuemart_manufacturer_id is set to 0
views/category/view.html.php
public function setCanonicalLink($tpl,$document,$categoryId,$manId){
// Set Canonic link
if (!empty($tpl)) {
$format = $tpl;
} else {
$format = vRequest::getCmd('format', 'html');
}
if ($format == 'html') {
// remove joomla canonical before adding it
foreach ( $document->_links as $k => $array ) {
if ( $array['relation'] == 'canonical' ) {
unset($document->_links[$k]);
break;
}
}
$link = 'index.php?option=com_virtuemart&view=category';
if($categoryId!==-1){
$link .= '&virtuemart_category_id='.$categoryId;
}
if($manId!==-1 ){
$link .= '&virtuemart_manufacturer_id='.$manId;
}
$document->addHeadLink( JRoute::_($link, FALSE) , 'canonical', 'rel', '' );
}
}
CHANGE THIS
if($manId!==-1 ){
$link .= '&virtuemart_manufacturer_id='.$manId;
}
TO THIS
if($manId!==-1 && $manId >=1){
$link .= '&virtuemart_manufacturer_id='.$manId;
}
Heyho, Pro,
very great. Yes, this sounds absolut valid. We dont need a filter if we want all manufacturers.
Thanks a lot,
It works perfect.
Other question. Why the base href and canonical are not the same when your are on product detail page?
Why VM skip the sub-category in canonical URLs?
I used this template without VM and it works great (both - base href & canonical).
Thanks for your time and advice
This fix hasn't been applied to the core as of VM 3.0.9, so you still have to do it yourself, but I did it and it worked for me. Thanks so much!
Is there a way to remove the parameter altogether from the URL if 'virtuemart_manufacturer_id=0' ?
@ PRO: Thank you really much!
I hope this will be a core feature very soon!
Hi,
I have completly rewrote the router.php for a customer, but i think noone will the fixes from the VM team(i reported already and give solution for some of this).
fixes and feature included :
Language always filtered corectly.
Menu with Permission are filtered from the possible parent menus.
Menu for category 0 was not set anymore in last VM 3.0.9.
No extra Query to get Joomla menu link.
Default category query values are unset(prevent to have categorylayout=0...(this can give some problem, if you set it by url or a form)
P.S: I'm on using short Url for manufacturer in category eg. yourmenu/mf_name. This work for category search when you have only a manufacturer and having a specific menu setting(category "none"), but need a core change to work.
Quote from: philraymond on June 25, 2015, 18:54:06 PM
This fix hasn't been applied to the core as of VM 3.0.9, so you still have to do it yourself, but I did it and it worked for me. Thanks so much!
Check the dates, your answer sounds like "we did not apply it". Wrong, vm3.0.9 was RELEASED already.
Quote from: Studio 42 on September 08, 2015, 20:21:37 PM
Hi,
I have completly rewrote the router.php for a customer, but i think noone will the fixes from the VM team(i reported already and give solution for some of this)
No man, PRO gave the solution for it, and it is in the svn since then. Man really stop the bitching and lieing. I have no time and not the mood to correct your nonsense all the time. and the best is, you steal always time which could be used to fix bugs, instead of bitching around.
I don't understand you? Why i have to deal then with fixes?
It's not possible to get another language from router. you have only one instance comming form current VM language. Is this true or not ?
In VM 3.0.10 this is still not solved. Any news?
Hi maks,
Check the answer before my.
Apparently I fantasizes and all works perfect in last release.
I do no more check for fixes anymore and not fight windmills.
Greets,
Patrick
But though seems that it haven't fixed in 3.0.11 which i have just downloaded. if($manId!==-1) line haven't changed... So i still need to update it myself. Thanks Pro for solution
Thank you, yes my fault.
I added it at a wrong place (before the function, not in the function) it seems, so it was not always working correctly