VirtueMart Forum

VirtueMart 2 + 3 + 4 => Security (https) / Performance / SEO, SEF, URLs => Topic started by: broc93 on July 19, 2014, 00:14:30 AM

Title: Show all products in a page + rel=canonical
Post by: broc93 on July 19, 2014, 00:14:30 AM
Hello.
I wanted to put on my website a page with all the products ordered from the most sold to the least. I thought it would be a good idea just to use a link like this one: http://www.prodotti-herblife-vendita-online.it/orderDesc/by,product_sales

The fact is, this page has a <link href="/" rel="canonical"/>, which means that crawlers read it as equivalent to the homepage. Also breadcrumbs show me that I'm in homepage, and I don't want to.

The problem is that Google also sees pages like "/orderDesc/by,product_sales/results,1-12", "/orderDesc/by,product_sales/results,1-6", "/orderDesc/by,product_sales/results,1-3" which are automatically created with a rel="canonical" attribute to the homepage.

How could I solve this problem?
Shall I put all the products in a single category called "All products", but then, how can I make "number of sales" the default order (without changing that of the other categories)
Otherwise, what shall I do?

Thank you very much in advance, hope someone could help me.
Have a nice day!
Title: Re: Show all products in a page + rel=canonical
Post by: broc93 on August 15, 2014, 15:38:13 PM
Anyone could help me please?
Title: Re: Show all products in a page + rel=canonical
Post by: GJC Web Design on August 15, 2014, 19:41:07 PM
check what is happening in components/com_virtuemart/views/category/view.html.php

public function setCanonicalLink($tpl,$document,$categoryId,$manId){
      // Set Canonic link
      if (!empty($tpl)) {
         $format = $tpl;
      } else {
         $format = JRequest::getWord('format', 'html');
      }
      if ($format == 'html') {

         $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', '' );

      }
   }

perhaps add another 'if' for special page
Title: Re: Show all products in a page + rel=canonical
Post by: broc93 on August 16, 2014, 18:30:20 PM
Hmmm I don't really know where to put my hands in that file :(
Title: Re: Show all products in a page + rel=canonical
Post by: GJC Web Design on August 16, 2014, 20:32:24 PM
Quotecomponents/com_virtuemart/views/category/view.html.php
Title: Re: Show all products in a page + rel=canonical
Post by: broc93 on August 17, 2014, 00:23:28 AM
I meant, what should I look for/edit in that file? Thank you!
Title: Re: Show all products in a page + rel=canonical
Post by: GJC Web Design on August 17, 2014, 20:27:54 PM
add another elseif  - detect a variable from that page url and write the url you need/want

but without the non sef url can't help more