Add meta tag dynamically in Magento

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

Do more with

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

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

will get the current logged in customer with
Mage::getSingleton('customer/session')->getCustomer()

Open in new window



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

Open in new window

Author

Commented:
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