13161 - replace CATEGORY_COLLECTION_ALL in all overrided controllers except CategoryController by a calling of a Category default method

This commit is contained in:
Rodney Figaro 2017-05-10 10:15:22 +02:00
parent b1ec03723e
commit 595a52bee7
12 changed files with 17 additions and 11 deletions

View File

@ -8,6 +8,11 @@ class Category extends CategoryCore
const CATEGORY_SAVEUR = 12; const CATEGORY_SAVEUR = 12;
const CATEGORY_SAVEUR_ALL = 27; const CATEGORY_SAVEUR_ALL = 27;
public static function getDefault($context = null)
{
return self::CATEGORY_COLLECTION_ALL;
}
public static function getCategoriesTree($id_parent, $currentDepth = 0, $depth = 3, $context = null) public static function getCategoriesTree($id_parent, $currentDepth = 0, $depth = 3, $context = null)
{ {
if(!$context) if(!$context)

View File

@ -60,7 +60,7 @@ class AddressController extends AddressControllerCore
parent::initContent(); parent::initContent();
if($this->context->customer->logged) if($this->context->customer->logged)
{ {
Tools::redirect($this->context->link->getCategoryLink(Category::CATEGORY_COLLECTION_ALL)); Tools::redirect($this->context->link->getCategoryLink(Category::getDefault()));
} }
} }
} }

View File

@ -7,7 +7,7 @@ class AddressesController extends AddressesControllerCore
parent::initContent(); parent::initContent();
if($this->context->customer->logged) if($this->context->customer->logged)
{ {
Tools::redirect($this->context->link->getCategoryLink(Category::CATEGORY_COLLECTION_ALL)); Tools::redirect($this->context->link->getCategoryLink(Category::getDefault()));
} }
} }
} }

View File

@ -375,7 +375,7 @@ class AuthController extends AuthControllerCore
CartRule::autoAddToCart($this->context); CartRule::autoAddToCart($this->context);
if (!$this->ajax) { if (!$this->ajax) {
Tools::redirect($this->context->link->getCategoryLink(Category::CATEGORY_COLLECTION_ALL)); Tools::redirect($this->context->link->getCategoryLink(Category::getDefault()));
} }
} }
} }

View File

@ -8,7 +8,7 @@ class ContactController extends ContactControllerCore
parent::initContent(); parent::initContent();
if($this->context->customer->logged) if($this->context->customer->logged)
{ {
Tools::redirect($this->context->link->getCategoryLink(Category::CATEGORY_COLLECTION_ALL)); Tools::redirect($this->context->link->getCategoryLink(Category::getDefault()));
} }
} }

View File

@ -7,7 +7,7 @@ class DiscountController extends DiscountControllerCore
parent::initContent(); parent::initContent();
if($this->context->customer->logged) if($this->context->customer->logged)
{ {
Tools::redirect($this->context->link->getCategoryLink(Category::CATEGORY_COLLECTION_ALL)); Tools::redirect($this->context->link->getCategoryLink(Category::getDefault()));
} }
} }
} }

View File

@ -1,3 +1,4 @@
<?php <?php
class IdentityController extends IdentityControllerCore class IdentityController extends IdentityControllerCore
@ -7,7 +8,7 @@ class IdentityController extends IdentityControllerCore
parent::initContent(); parent::initContent();
if($this->context->customer->logged) if($this->context->customer->logged)
{ {
Tools::redirect($this->context->link->getCategoryLink(Category::CATEGORY_COLLECTION_ALL)); Tools::redirect($this->context->link->getCategoryLink(Category::getDefault()));
} }
} }
} }

View File

@ -8,7 +8,7 @@ class IndexController extends IndexControllerCore
parent::initContent(); parent::initContent();
if($this->context->customer->logged) if($this->context->customer->logged)
{ {
Tools::redirect($this->context->link->getCategoryLink(Category::CATEGORY_COLLECTION_ALL)); Tools::redirect($this->context->link->getCategoryLink(Category::getDefault()));
} }
} }

View File

@ -7,7 +7,7 @@ class MyAccountController extends MyAccountControllerCore
parent::initContent(); parent::initContent();
if($this->context->customer->logged) if($this->context->customer->logged)
{ {
Tools::redirect($this->context->link->getCategoryLink(Category::CATEGORY_COLLECTION_ALL)); Tools::redirect($this->context->link->getCategoryLink(Category::getDefault()));
} }
} }
} }

View File

@ -7,7 +7,7 @@ class OrderFollowController extends OrderFollowControllerCore
parent::initContent(); parent::initContent();
if($this->context->customer->logged) if($this->context->customer->logged)
{ {
Tools::redirect($this->context->link->getCategoryLink(Category::CATEGORY_COLLECTION_ALL)); Tools::redirect($this->context->link->getCategoryLink(Category::getDefault()));
} }
} }
} }

View File

@ -7,7 +7,7 @@ class OrderSlipController extends OrderSlipControllerCore
parent::initContent(); parent::initContent();
if($this->context->customer->logged) if($this->context->customer->logged)
{ {
Tools::redirect($this->context->link->getCategoryLink(Category::CATEGORY_COLLECTION_ALL)); Tools::redirect($this->context->link->getCategoryLink(Category::getDefault()));
} }
} }
} }

View File

@ -7,7 +7,7 @@ class SitemapController extends SitemapControllerCore
parent::initContent(); parent::initContent();
if($this->context->customer->logged) if($this->context->customer->logged)
{ {
Tools::redirect($this->context->link->getCategoryLink(Category::CATEGORY_COLLECTION_ALL)); Tools::redirect($this->context->link->getCategoryLink(Category::getDefault()));
} }
} }
} }