Author Topic: Manufacturer pages with wrong urls and metatags  (Read 551 times)

Leila

  • Beginner
  • *
  • Posts: 23
  • A beginner
    • Интернет магазин Ковровик
  • VirtueMart Version: 3.4.2.
Manufacturer pages with wrong urls and metatags
« on: August 21, 2019, 09:55:21 am »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9037
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Manufacturer pages with wrong urls and metatags
« Reply #1 on: August 21, 2019, 11:42:35 am »
Quote
Joomla 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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Leila

  • Beginner
  • *
  • Posts: 23
  • A beginner
    • Интернет магазин Ковровик
  • VirtueMart Version: 3.4.2.
Re: Manufacturer pages with wrong urls and metatags
« Reply #2 on: August 21, 2019, 12:21:40 pm »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9037
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Manufacturer pages with wrong urls and metatags
« Reply #3 on: August 21, 2019, 13:00:58 pm »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Leila

  • Beginner
  • *
  • Posts: 23
  • A beginner
    • Интернет магазин Ковровик
  • VirtueMart Version: 3.4.2.
Re: Manufacturer pages with wrong urls and metatags
« Reply #4 on: August 21, 2019, 13:08:54 pm »

 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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9037
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Manufacturer pages with wrong urls and metatags
« Reply #5 on: August 21, 2019, 13:15:38 pm »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Leila

  • Beginner
  • *
  • Posts: 23
  • A beginner
    • Интернет магазин Ковровик
  • VirtueMart Version: 3.4.2.
Re: Manufacturer pages with wrong urls and metatags
« Reply #6 on: August 21, 2019, 13:52:06 pm »
Quote
how 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);

Quote
does 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.

Quote
what 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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9037
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Manufacturer pages with wrong urls and metatags
« Reply #7 on: August 21, 2019, 14:10:58 pm »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Leila

  • Beginner
  • *
  • Posts: 23
  • A beginner
    • Интернет магазин Ковровик
  • VirtueMart Version: 3.4.2.
Re: Manufacturer pages with wrong urls and metatags
« Reply #8 on: August 21, 2019, 14:17:35 pm »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9037
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Manufacturer pages with wrong urls and metatags
« Reply #9 on: August 21, 2019, 15:23:35 pm »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Leila

  • Beginner
  • *
  • Posts: 23
  • A beginner
    • Интернет магазин Ковровик
  • VirtueMart Version: 3.4.2.
Re: Manufacturer pages with wrong urls and metatags
« Reply #10 on: August 21, 2019, 16:06:57 pm »
I dont know. I didnt hack virtuemart core, only did some template overrides.


Leila

  • Beginner
  • *
  • Posts: 23
  • A beginner
    • Интернет магазин Ковровик
  • VirtueMart Version: 3.4.2.
Re: Manufacturer pages with wrong urls and metatags
« Reply #11 on: August 21, 2019, 19:00:05 pm »

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9918
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Manufacturer pages with wrong urls and metatags
« Reply #12 on: September 07, 2019, 13:15:15 pm »
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
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Leila

  • Beginner
  • *
  • Posts: 23
  • A beginner
    • Интернет магазин Ковровик
  • VirtueMart Version: 3.4.2.
Re: Manufacturer pages with wrong urls and metatags
« Reply #13 on: September 17, 2019, 08:50:09 am »
Now it works! Thank you very much for help!