Author Topic: How to add categories on product link canoncial  (Read 2319 times)

zenza

  • Beginner
  • *
  • Posts: 4
  • A beginner
How to add categories on product link canoncial
« on: July 28, 2016, 15:52:42 pm »
Canoncial url by default refers to the most minimum category and how to make that he referred to a subcategory (i.e. to big category), i.e. instead of sitename/category/item.html, there was sitename/category/subcategory/item.html?

Jaspers

  • Beginner
  • *
  • Posts: 8
  • A beginner
Re: How to add categories on product link canoncial
« Reply #1 on: August 03, 2016, 11:40:26 am »
As i understand if your product is asigned both to category and subcategory, and if you have a menu, which leads to the virtuemart category and subcategory at the same time - the canonnical url will choose the category menu link. So if you choose for product only subcategory - everything will work properly. But i need product to be choosen both category and subcategory.
I Suffer with this question 10 days already. There is no answer anywhere  :(

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10355
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: How to add categories on product link canoncial
« Reply #2 on: August 03, 2016, 12:27:41 pm »
how about trying the extended query to show subcat prods if in parent

see models -> product.php from around line 367

if ($virtuemart_category_id > 0) {
         $joinCategory = TRUE;
         if(true){
            $where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id;
         } else {
            /*GJC add subcat products*/  etc
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

Jaspers

  • Beginner
  • *
  • Posts: 8
  • A beginner
Re: How to add categories on product link canoncial
« Reply #3 on: August 03, 2016, 13:37:40 pm »
So there is no way to add subcategory to the canonical link wuthout removing the category in products?