Add meta tag dynamically in Magento

Boon Chye Phang
Boon Chye Phang used Ask the Experts™
How to create a meta data dynamically onto HTML head with the customer name as the content?
I am using Magento 1.9
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

from  "app/code/core/Mage/Page/Block/Html/Header.php":

will get the current logged in customer with

Open in new window

So you can use it like this
$customer = Mage::getSingleton('customer/session')->getCustomer();
echo $customer->getName();

Open in new window


Thank you it works!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial