Last active
August 29, 2015 14:01
-
-
Save anunay/ff8628cdfebd72dda87d to your computer and use it in GitHub Desktop.
Magento: Get category from product
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Magento: Getting categroy from product | |
$categoryIds = $_product->getCategoryIds(); | |
if(count($categoryIds) ){ | |
$firstCategoryId = $categoryIds[0]; | |
$_category = Mage::getModel('catalog/category')->load($firstCategoryId); | |
echo $_category->getData('categorysecondimage'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment