Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save govindak/d2a15223b994ac16b22b to your computer and use it in GitHub Desktop.
Save govindak/d2a15223b994ac16b22b to your computer and use it in GitHub Desktop.
<?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