Nasir Zia
Nasir Zia

Reputation: 574

Get Meta Keyword By ID in Magento

I want to display Meta Keyword of a Product in view.phtml file. What function do i need to call upon to display meta keyword of that particular product in Magento.

Upvotes: 1

Views: 884

Answers (1)

Gerard de Visser
Gerard de Visser

Reputation: 8050

To return the meta keyword of the rendered product, use following within your view.phtml:

<?php echo $_product->getMetaKeyword(); ?>

You can get meta keyword by product id with:

<?php $_product = Mage::getModel('catalog/product')->load($productId); ?>
<?php echo $_product->getMetaKeyword(); ?>

Upvotes: 2

Related Questions