magentokeyword

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.


Solution

  • 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(); ?>