How do i remove title suffix only from product page. My current Page title is like [Product Name] - [Website Address] here i want to remove website address only from product page which means it should appear in all rest of the pages. Can anyone please help me on this. Thanks in Advance.
2 Answers
You can create your custom module and hook the event catalog_controller_product_view
<frontend> <events> <catalog_controller_product_view> <observers> <yourmodule> <type>singleton</type> <class>yourmodule/observer</class> <method>changeProductTitle</method> </yourmodule> </observers> </catalog_controller_product_view> </events> </frontend> And in your Observer.php define the function like below
public function changeProductTitle($observer) { if ($product = $observer->getEvent()->getProduct()) { $title = $product->getData('name'); $product->setMetaTitle($title); $product->setTitle($title); } return $this; } Modify the code according to your requirement.
Try to go into pages under cms in magento back-end and check out if there is a product page, click edit and see what the title of the certain page is.
Or check the following link it may be helpful
- Sorry I don't have any product page under cms, Is there any other way to do this?. ThanksKumar– Kumar2015-04-23 10:43:02 +00:00Commented Apr 23, 2015 at 10:43
- i edited my answer give it a govasilisdmr– vasilisdmr2015-04-23 11:03:43 +00:00Commented Apr 23, 2015 at 11:03