[*] CORE : Merge of https://github.com/PrestaShop/PrestaShop/pull/582
This commit is contained in:
1 parent
cbc79c6cf2
commit
68ed6fac82
1 file changed
+12
-13
@@ -530,27 +530,26 @@ class ProductControllerCore extends FrontController
|
|||||||
{
|
{
|
||||||
// Assign category to the template
|
// Assign category to the template
|
||||||
if ($this->category !== false && Validate::isLoadedObject($this->category) && $this->category->inShop() && $this->category->isAssociatedToShop())
|
if ($this->category !== false && Validate::isLoadedObject($this->category) && $this->category->inShop() && $this->category->isAssociatedToShop())
|
||||||
{
|
|
||||||
$path = Tools::getPath($this->category->id, $this->product->name, true);
|
$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))
|
elseif (Category::inShopStatic($this->product->id_category_default, $this->context->shop))
|
||||||
{
|
{
|
||||||
$cat_default = new Category((int)$this->product->id_category_default);
|
$this->category = new Category((int)$this->product->id_category_default);
|
||||||
if (Validate::isLoadedObject($cat_default) && $cat_default->active && $cat_default->isAssociatedToShop())
|
if (Validate::isLoadedObject( $this->category) && $this->category->active && $this->category->isAssociatedToShop())
|
||||||
$path = Tools::getPath((int)$this->product->id_category_default, $this->product->name);
|
$path = Tools::getPath((int)$this->product->id_category_default, $this->product->name);
|
||||||
}
|
}
|
||||||
if (!isset($path) || !$path)
|
if (!isset($path) || !$path)
|
||||||
$path = Tools::getPath((int)$this->context->shop->id_category, $this->product->name);
|
$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))));
|
$this->context->smarty->assign(array('HOOK_PRODUCT_FOOTER' => Hook::exec('displayFooterProduct', array('product' => $this->product, 'category' => $this->category))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user