Show all products in a page + rel=canonical

Started by broc93, July 19, 2014, 00:14:30 AM

Previous topic - Next topic

broc93

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!
Herbalife products
http://dietabenesserehl.it

broc93

Herbalife products
http://dietabenesserehl.it

GJC Web Design

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

broc93

Hmmm I don't really know where to put my hands in that file :(
Herbalife products
http://dietabenesserehl.it

GJC Web Design

Quotecomponents/com_virtuemart/views/category/view.html.php
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

broc93

I meant, what should I look for/edit in that file? Thank you!
Herbalife products
http://dietabenesserehl.it

GJC Web Design

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