News:

Looking for documentation? Take a look on our wiki

Main Menu

[Solved] Canonical on products?

Started by Gipa, February 27, 2013, 22:21:35 PM

Previous topic - Next topic

Gipa

Ok, apparently VM2 is a bit like my car: It fixed itself...!      ;)

Now I just have to figure out why pagination no longer works...     ::)

Gipa

Aaaaand now pagination works.

Gotta love a system that can fix itself...!     ;)

Gipa

Aaaand now canonical doesn't work anymore. All products point back to themselves; not to the product in the category with the lowest id.

I tried setting up a completely different store to test if it was a problem with some file in my site, but the same thing happens here...

I'm getting a bit desperate here. Does anybody know ANYTHING that might help?     :'(

Gipa

By the way, the new site is with VM2.0.18c and a different template than the first site. So it shouldn't be a template problem, and 18c doesn't seem to do the trick...      :'(

PRO

sounds like a cache problem or something like that

Gipa

FIX:

/components/com_virtuemart/views/productdetails/view.html.php

Find:

   if ($format == 'html') {

       // Set Canonic link

       $document->addHeadLink(JRoute::_($product->canonical, true, -1), 'canonical', 'rel', '');
      $document->setBase(htmlspecialchars(JRoute::_($product->canonical, true, -1)));

   }


Change to:

   if ($format == 'html') {

       // Set Canonic link

       $document->addHeadLink(JRoute::_($product->canonical, true, 0), 'canonical', 'rel', '');
      $document->setBase(htmlspecialchars(JRoute::_($product->canonical, true, 0)));

   }


(Just changed two accounts of -1 to 0.)


Then canonical works.

Just remember that this file is overwritten when you update VM - so you'll have to change it again later, unless the VM team changes it as well...

Gipa

Oooook then. That only worked right after I tested it. Now it doesn't work anymore.

Going crazy here! How hard can it be to fix?!

PRO

Quote from: Gipa on March 13, 2013, 12:20:38 PM
Oooook then. That only worked right after I tested it. Now it doesn't work anymore.

Going crazy here! How hard can it be to fix?!


this might be a session  problem or something