VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: davi7852@yahoo.com on June 24, 2016, 23:41:59 PM

Title: Display in SERPS
Post by: davi7852@yahoo.com on June 24, 2016, 23:41:59 PM
Hey Guys, 

I wanted to see if there was a way for me to change how the products currently display on the SERPs...  Right now it displays = product category :: product name :: call for price 

Is there a way for me to switch this to=  product name :: category :: call for price?

Please see attachment, I'd like this to display "Graco Therm-O-Flow 200 : Hot Melt Units - Call for price"

Or when I update the custom title on the product is there a way for me to make this display to overwrite how it displays currently? 

Thanks! 

Ryan
Title: Re: Display in SERPS
Post by: AH on June 25, 2016, 13:44:29 PM
This require a core change or some plugin development

administrator/components/com_virtuemart/views/product/view.html.php


// Set the titles
// $document->setTitle should be after the additem pathway
if ($product->customtitle) {
$document->setTitle(strip_tags(html_entity_decode($product->customtitle,ENT_QUOTES)));
} else {
                //QUORVIA adjusted
                //$document->setTitle(strip_tags(html_entity_decode(($category->category_name ? (vmText::_($category->category_name) . ' : ') : '') . $product->product_name,ENT_QUOTES)));
                $document->setTitle(strip_tags(html_entity_decode($product->product_name . ' : ' . ($category->category_name ? (vmText::_($category->category_name)) : '') ,ENT_QUOTES)));
}
Title: Re: Display in SERPS
Post by: Studio 42 on June 25, 2016, 15:30:14 PM
Note : If you don't want modify virtuemart core, you can add this code in the tmpl files overides, so it's not removed on VM updates.
Title: Re: Display in SERPS
Post by: AH on June 27, 2016, 09:55:03 AM
@studio 42

Thanks for the additional information - Clearly setting this as an override in the product template is preferable!!


$document->setTitle(strip_tags(html_entity_decode($this->product->product_name . ' : ' . ($this->category->category_name ? (vmText::_($this->category->category_name)) : '') ,ENT_QUOTES)));
Title: Re: Display in SERPS
Post by: GJC Web Design on June 27, 2016, 12:42:27 PM
yes- all the document set stuff cascades its effect so any of this can be done at tmpl or even in modules