Magento add price and color in meta description -


i add product price in meta description of products. don't write meta desc in product options, magento gets product desc. (it's ok me)

$description = $product->getmetadescription();             if ($description) {                 $headblock->setdescription( ($description) );             } else {                 $headblock->setdescription(mage::helper('core/string')->substr($product->getdescription(), 0, 255)); 

how make meta desc looks that= productdesc color finalprice

?

pleas copyfile view.php app\code\core\mage\catalog\block\product app\code\local\mage\catalog\block\product here find protected function _preparelayout() find code , comment this

$description = $product->getmetadescription();             if ($description) {                 $headblock->setdescription( ($description) );             } else {                 $headblock->setdescription(mage::helper('core/string')->substr($product->getdescription(), 0, 255));             }   , try below          $color=$product->getattributetext('color');             $basecurrencycode = mage::app()->getstore()->getbasecurrencycode();             $currentcurrencycode = mage::app()->getstore()->getcurrentcurrencycode();             $currencysymbol = mage::app()->getlocale()->currency($currentcurrencycode)->getsymbol();             $price=$currentcurrencycode .' '.mage::helper('core')->currency($product->getfinalprice(),false,true);              $metatmp1=$color.' '. $price;             $strlen=strlen($metatmp);             $metatmp2==mage::helper('core/stri;ng')->substr($product->getdescription(), 0, (255-$strlen-5));             $meta= $metatmp2.''.$metatmp1;             $headblock->setdescription( $meta) ; 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -