Monday, January 18, 2010

Avoid empty meta-title for products (for biostall)

Problem: in case the meta-title is not filled in for a product the title should replace it

Possible solution:

Create a new method in the product model (Mage_Catalog_Model_Product) class called getMetaTitle();
function getMetaTitle(){
if (!$this->getData('meta_title')){
$this->setMetaTitle($this->getTitle());
}
return $this->getData('meta_title');
}

No comments:

Post a Comment