VirtueMart Forum

VirtueMart 2 + 3 + 4 => Security (https) / Performance / SEO, SEF, URLs => Topic started by: fabioweb on October 17, 2017, 23:19:50 PM

Title: Index Follow Category
Post by: fabioweb on October 17, 2017, 23:19:50 PM
Hello,
is it possible to setup this  (http://"https://www.casacasette.it/casette-in-legno/casette-in-legno-28mm/casetta-da-bambini-182x182-254-dettaglio") with noindex,follow
and this url  (http://"view-source:https://www.casacasette.it/casette-in-legno/casetta-da-bambini-182x182-254-dettaglio")with "index,follow" ?

In short these are the same product page but i need different robots managment 

Thank you
Title: Re: Index Follow Category
Post by: Studio 42 on October 24, 2017, 00:58:01 AM
If you need to do this, you have to use condition.
sample code using categories (to modify for your needs) :

$document = JFactory::getDocument();
If ($cat_id == "XXX") $document->setMetaData('robots','noindex,follow');
else $document->setMetaData('robots','index,follow');

But of course in this case all product in same category have same meta robots, so you need perhaps use a product id and cat id filter.
Title: Index Follow Category
Post by: fabioweb on October 24, 2017, 12:15:37 PM
Thank you for your help.. Where i need to insert the code?

Regards
Title: Re: Index Follow Category
Post by: Studio 42 on October 24, 2017, 12:54:48 PM
In your product page JOOMLAROOT/templates/YOURTEMPLATE/html/virtuemart/productdetails/default.php
But is i said, it's not complete and need some more work.
It's possible to write a system plugin too, to check category+product, bit is longer to do.