// Fix display of breadcrumb (dont show categories disabled) + it's now impossible to browse categories outside of root category for shops
This commit is contained in:
@@ -99,7 +99,7 @@ class CmsControllerCore extends FrontController
|
||||
$this->context->smarty->assign(array(
|
||||
'cms' => $this->cms,
|
||||
'content_only' => (int)(Tools::getValue('content_only')),
|
||||
'path' => ((isset($this->cms->id_cms_category) AND $this->cms->id_cms_category) ? Tools::getFullPath((int)($this->cms->id_cms_category), $this->cms->meta_title, 'CMS') : Tools::getFullPath(1, $this->cms->meta_title, 'CMS'))
|
||||
'path' => ((isset($this->cms->id_cms_category) AND $this->cms->id_cms_category) ? Tools::getFullPath($this->cms->id_cms_category, $this->cms->meta_title, 'CMS') : Tools::getFullPath(1, $this->cms->meta_title, 'CMS'))
|
||||
));
|
||||
}
|
||||
elseif ($this->assignCase == 2)
|
||||
@@ -108,7 +108,7 @@ class CmsControllerCore extends FrontController
|
||||
'category' => $this->cms_category,
|
||||
'sub_category' => $this->cms_category->getSubCategories($this->context->language->id),
|
||||
'cms_pages' => CMS::getCMSPages($this->context->language->id, (int)($this->cms_category->id) ),
|
||||
'path' => ($this->cms_category->id !== 1) ? Tools::getPath((int)($this->cms_category->id), $this->cms_category->name, false, 'CMS') : '',
|
||||
'path' => ($this->cms_category->id !== 1) ? Tools::getPath($this->cms_category->id, $this->cms_category->name, false, 'CMS') : '',
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ class CategoryControllerCore extends FrontController
|
||||
$this->errors[] = Tools::displayError('Missing category ID');
|
||||
else
|
||||
{
|
||||
if (!Validate::isLoadedObject($this->category))
|
||||
if (!Validate::isLoadedObject($this->category) || !$this->category->inShop())
|
||||
$this->errors[] = Tools::displayError('Category does not exist');
|
||||
elseif (!$this->category->checkAccess($this->context->customer->id))
|
||||
$this->errors[] = Tools::displayError('You do not have access to this category.');
|
||||
@@ -103,7 +103,7 @@ class CategoryControllerCore extends FrontController
|
||||
$rewrited_url = $this->context->link->getCategoryLink((int)$this->category->id, $this->category->link_rewrite);
|
||||
|
||||
/* Scenes (could be externalised to another controler if you need them */
|
||||
$this->context->smarty->assign('scenes', Scene::getScenes((int)($this->category->id), $this->context->language->id, true, false));
|
||||
$this->context->smarty->assign('scenes', Scene::getScenes($this->category->id, $this->context->language->id, true, false));
|
||||
|
||||
/* Scenes images formats */
|
||||
if ($sceneImageTypes = ImageType::getImagesTypes('scenes'))
|
||||
@@ -142,7 +142,7 @@ class CategoryControllerCore extends FrontController
|
||||
'id_category' => (int)($this->category->id),
|
||||
'id_category_parent' => (int)($this->category->id_parent),
|
||||
'return_category_name' => Tools::safeOutput($this->category->name),
|
||||
'path' => Tools::getPath((int)($this->category->id)),
|
||||
'path' => Tools::getPath($this->category->id),
|
||||
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
|
||||
'categorySize' => Image::getSize('category'),
|
||||
'mediumSize' => Image::getSize('medium'),
|
||||
|
||||
@@ -167,7 +167,7 @@ class ProductControllerCore extends FrontController
|
||||
if (isset($category) AND Validate::isLoadedObject($category))
|
||||
{
|
||||
$this->context->smarty->assign(array(
|
||||
'path' => Tools::getPath((int)$category->id, $this->product->name, true),
|
||||
'path' => Tools::getPath($category->id, $this->product->name, true),
|
||||
'category' => $category,
|
||||
'subCategories' => $category->getSubCategories($this->context->language->id, true),
|
||||
'id_category_current' => (int)($category->id),
|
||||
|
||||
Reference in New Issue
Block a user