Hi!
I ve already posted my question in topic https://forum.virtuemart.net/index.php?topic=142723.msg506051#msg506051.
An extra ending is randomly added to /manufacturer/name/ending when I click on manufactuter link on product details page or manufacturer module.
The normal manufacturer category should look like this : https://www.kovrovik.com.ua/manufacturer/confetti-carpet - with proper meta tags and description.
But instead I get this: https://www.kovrovik.com.ua/manufacturer/confetti-carpet/kovry - metatags are from category https://www.kovrovik.com.ua/kovry.
The added ending is from Virtuemart category alias.
I also get pages with no products because the added category (ending) doesnt contain products of needed manufacturer.
Joomla cache turn off doesnt help. After cleaning all cache I get proper url but only first two or three times. And then again!
The only thing that seems to help 100% is turning off Joomla SEF as well as Virtuemart SEF.
Virtuemart 3.4.2.
Joomla 3.9.8.
Php 7.2.21.
QuoteJoomla cache turn off doesn't help. After cleaning all cache I get proper url but only first two or three times
which cache??
if it works with caches cleared then it is obviously a caching problem .. afaik VM is only reliable with the Joomla conservative caching
but I don't use any of the Joomla caches on my sites - my current favourite is the Litespeed server cache system or on Siteground servers their proprietary cache system - both seem 100% reliable
try installing the module https://github.com/OSTraining/OSURL .. it will show u the real url that is being sef'd .. might help
Joomla standart cache in General settings and cache plugin. When all is turned off the problem remains. Clearing cache in System > Clear cache helps only for some time.
Osurl module output:
$_SERVER["REQUEST_URI"]: /manufacturer/confetti-carpet/akrilovye-kovry
JRouter::getVars() and buildQuery: /index.php?Itemid=392&option=com_virtuemart&limitstart=0&virtuemart_manufacturer_id=2&virtuemart_category_id=29&view=category&limit=
where &virtuemart_category_id=29 - is ID of category "akrilovye-kovry"
what is menu item Itemid=392 assigned to?
what does the url
/index.php?Itemid=392&option=com_virtuemart&limitstart=0&virtuemart_manufacturer_id=2&view=category&limit= give u? i.e. no virtuemart_category_id
Itemid=392 is joomla menu with Virtuemart top level category layout. This is front page in Russhian language.
/index.php?Itemid=392&option=com_virtuemart&limitstart=0&virtuemart_manufacturer_id=2&view=category&limit= gives the correct manufacturer page with proper metatags!
how is the link to the manu page constructed in the template?
does it come from the view.html.php?
what about a https://www.php.net/manual/en/function.preg-replace.php in the template to get rid of the virtuemart_category_id?
Quotehow is the link to the manu page constructed in the template?
I dont really understand what you mean :(
I guess you mean the link in default_manufactuter.php
$link = JRoute::_('index.php?option=com_virtuemart&view=manufacturer&virtuemart_manufacturer_id=' . $manufacturers_details->virtuemart_manufacturer_id. '&tmpl=component', FALSE);
Quotedoes it come from the view.html.php?
Maybe. But I didn't override it and dont have it in overrides.
I get to manu page from product details page i.e https://www.kovrovik.com.ua/efes-0559-green-round-detail
To show manufacturer on product page I added to template override /templates/my_template/html/com_virtuemart/productdetails/custom.php (I dont really understand the code: I found the solution on a forum).
<?php
// Manufacturer of the Product
if (VmConfig::get('show_manufacturers', 1) && !empty($this->product->virtuemart_manufacturer_id)) {
echo $this->loadTemplate('manufacturer');
}
?>
When I click on manufacturer name I get popup with link to view all products. And this link randomly leads to wrong url. So does the manufacturer link when I add manufacturers module.
Quotewhat about a https://www.php.net/manual/en/function.preg-replace.php in the template to get rid of the virtuemart_category_id?
I'd like to but I dont understand PHP.
components\com_virtuemart\views\productdetails\tmpl\default_manufacturer.php
I don't see any virtuemart_category_id there
//Link to products
$link = JRoute::_('index.php?option=com_virtuemart&view=manufacturer&virtuemart_manufacturer_id=' . $manufacturers_details->virtuemart_manufacturer_id. '&tmpl=component', FALSE);
so how is it being added?
maybe in /components/com_virtuemart/views/manufacturer/tmpl/details.php
JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=' . $this->manufacturer->virtuemart_manufacturer_id, FALSE);
Because when I tried to change link as here http://forum.virtuemart.net/index.php?topic=136209.0, the link started to lead to to main page.
also there .. no mention of virtuemart_category_id - so why is the virtuemart_category_id being added to your links?
I dont know. I didnt hack virtuemart core, only did some template overrides.
When Joomla SEF is off page url looks like https://www.kovrovik.com.ua/index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=6&Itemid=184&lang=ru
Without virtuemart_category_id!
That should be correct. Please try the last version. I think we worked on that http://dev.virtuemart.net/attachments/1177/com_virtuemart.3.6.1.10121_package_or_extract.zip
Now it works! Thank you very much for help!