Manufacturer pages with wrong urls and metatags

Started by Leila, August 21, 2019, 09:55:21 AM

Previous topic - Next topic

Leila

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.

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Leila

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"



GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Leila


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!

GJC Web Design

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?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Leila

#6
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.

GJC Web Design

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?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Leila

#8
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.

GJC Web Design

also there .. no mention of virtuemart_category_id - so why is the virtuemart_category_id being added to your links?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Leila

I dont know. I didnt hack virtuemart core, only did some template overrides.



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/

Leila