Skip to content

Commit

Permalink
[*] CORE : Merge of #582
Browse files Browse the repository at this point in the history
  • Loading branch information
gRoussac committed Nov 29, 2013
1 parent cbc79c6 commit 68ed6fa
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions controllers/front/ProductController.php
Expand Up @@ -530,27 +530,26 @@ protected function assignCategory()
{
// Assign category to the template
if ($this->category !== false && Validate::isLoadedObject($this->category) && $this->category->inShop() && $this->category->isAssociatedToShop())
{
$path = Tools::getPath($this->category->id, $this->product->name, true);
$this->context->smarty->assign(array(
'category' => $this->category,
'subCategories' => $this->category->getSubCategories($this->context->language->id, true),
'id_category_current' => (int)$this->category->id,
'id_category_parent' => (int)$this->category->id_parent,
'return_category_name' => Tools::safeOutput($this->category->name)
));
}
elseif (Category::inShopStatic($this->product->id_category_default, $this->context->shop))
{
$cat_default = new Category((int)$this->product->id_category_default);
if (Validate::isLoadedObject($cat_default) && $cat_default->active && $cat_default->isAssociatedToShop())
$this->category = new Category((int)$this->product->id_category_default);
if (Validate::isLoadedObject( $this->category) && $this->category->active && $this->category->isAssociatedToShop())
$path = Tools::getPath((int)$this->product->id_category_default, $this->product->name);
}
if (!isset($path) || !$path)
$path = Tools::getPath((int)$this->context->shop->id_category, $this->product->name);
$this->context->smarty->assign('path', $path);

$this->context->smarty->assign('categories', Category::getHomeCategories($this->context->language->id, true, (int)$this->context->shop->id));
// various assignements before Hook::exec
$this->context->smarty->assign(array(
'path' => $path,
'category' => $this->category,
'subCategories' => $this->category->getSubCategories($this->context->language->id, true),
'id_category_current' => (int)$this->category->id,
'id_category_parent' => (int)$this->category->id_parent,
'return_category_name' => Tools::safeOutput($this->category->name),
'categories' => Category::getHomeCategories($this->context->language->id, true, (int)$this->context->shop->id)
));
$this->context->smarty->assign(array('HOOK_PRODUCT_FOOTER' => Hook::exec('displayFooterProduct', array('product' => $this->product, 'category' => $this->category))));
}

Expand Down

0 comments on commit 68ed6fa

Please sign in to comment.