Change in app\code\core\Mage\Catalog\controllers\ProductController.php

After:

$categoryId = (int) $this->getRequest()->getParam('category', false);

add code:

if($categoryId == 0){
   $_product = Mage::getModel('catalog/product')->load($productId);
   $cat_ids = $_product->getCategoryIds();
   $categoryId = $cat_ids[0];
  }

Leave a reply

Your email address will not be published.