News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Title as product short description on ask-a-question/recommend pages

Started by man.of.earth, September 06, 2019, 12:51:08 PM

Previous topic - Next topic

man.of.earth

Hello,

I saw that product short description (!) was set as title on the "ask a question" and "recommend to a friend" pages. Product name would be a logical choice.
This can be corrected in
/components/com_virtuemart/views/askquestion/view.html.php, line 128

$document->setMetaData ('title', $product->product_s_desc); //Maybe better product_name

replaced for
$document->setMetaData ('title', $product->product_name.' - '.vmText::_('COM_VIRTUEMART_PRODUCT_ASK_QUESTION')); //Maybe better product_name

and in /components/com_virtuemart/views/recommend/view.html.php, line 132

$document->setMetaData('title', $this->product->product_name);  //Maybe better product_name

replaced for
$document->setMetaData ('title', $product->product_name.' - '.vmText::_('COM_VIRTUEMART_PRODUCT_RECOMMEND')); //Maybe better product_name

Additionally, for both of them, in case the meta description is not set for the individual product, it could use the product short description instead (lines 117 and 124 respectively in the two files):
if ($this->product->metadesc) {
   $document->setDescription( $this->product->metadesc );
}


add
else{
   $document->setDescription( strip_tags($this->product->product_s_desc) );
}


Product recommend file has a wrong definition on line 117:
// for askquestion
$pathway->addItem( vmText::_('COM_VIRTUEMART_PRODUCT_ASK_QUESTION'));


change for
// for recommend
$pathway->addItem( vmText::_('COM_VIRTUEMART_PRODUCT_RECOMMEND'));


The productdetails template (/components/com_virtuemart/views/productdetails/tmpl/default.php) has a glitch in regards to the title of "Recomend to a friend":
echo $this->linkIcon($MailLink, 'COM_VIRTUEMART_EMAIL', 'emailButton', 'show_emailfriend', false,true,false,'class="recommened-to-friend"');

should be replaced for
echo $this->linkIcon($MailLink, 'COM_VIRTUEMART_PRODUCT_RECOMMEND', 'emailButton', 'show_emailfriend', false,true,false,'class="recommened-to-friend"');

as "E-mail" isn't both noun and verb in other languages than English, and it would not be understood so easily the role of that button from its title (plus, COM_VIRTUEMART_EMAIL is used to denote email address in notify, orders etc. templates).