1
我使用下面的代码显示产品在我的产品页面上的类别。但我使用相同的产品运行多个商店,并且还显示其他网站的类别。我怎样才能显示我访问的网站的类别?Magento - 显示产品的类别
<?php $categories = $_product->getCategoryIds(); ?>
<?php foreach($categories as $k => $_category_id): ?>
<?php $_category = Mage::getModel('catalog/category')->load($_category_id) ?>
<a href="<?php echo $_category->getUrl() ?>"><?php echo $_category->getName() ?> | </a>
<?php endforeach; ?>
试试这个。 http://stackoverflow.com/questions/15505221/how-do-i-get-the-category-ids-that-a-product-is-in-with-respect-to-the-store-tha –