Skip to content

Instantly share code, notes, and snippets.

@rintoug
Last active July 24, 2016 06:19
Show Gist options
  • Save rintoug/b82920cfa4b00845ca43ac64eb12c5b0 to your computer and use it in GitHub Desktop.
Save rintoug/b82920cfa4b00845ca43ac64eb12c5b0 to your computer and use it in GitHub Desktop.
$product = Mage::getModel('catalog/product')->load($productId);
$cats = $product->getCategoryIds();
foreach ($cats as $category_id) {
$_cat = Mage::getModel('catalog/category')->load($category_id) ;
echo $_cat->getName();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment