I have 2 custom attributes I\'d like to add to the tags on product pages. They are \'brand\' and \'subtitle\'.
My page title would end up
From your question, I assume you are referring to changing the meta title for products.
There are 3 options open to you:
Your decision is really between options 2 & 3 (both of which will require you to create a custom module to achieve).
I always try to be as unobtrusive as possible when extending Magento core functionality - so I would opt for option 3 here. Please see below code for a complete example:
app/etc/modules/Yourcompany_Yourmodule.xml
true
local
app/code/local/Yourcompany/Yourmodule/etc/config.xml
1.0.0
Yourcompany_Yourmodule_Model
Yourcompany_Yourmodule_Model_Observer
catalog_controller_product_view
app/code/local/Yourcompany/Yourmodule/Model/Observer.php
getEvent()->getProduct()) {
$title = $product->getData('brand') . ' ' . $product->getData('name') . ' ' . $product->getData('sub_title');
$product->setMetaTitle($title);
}
return $this;
}
}