diff --git a/classes/Configuration.php b/classes/Configuration.php index 3353f442b..65cc3d8b4 100644 --- a/classes/Configuration.php +++ b/classes/Configuration.php @@ -145,6 +145,9 @@ class ConfigurationCore extends ObjectModel */ public static function get($key, $id_lang = null, $id_shop_group = null, $id_shop = null) { + if (defined('_PS_DO_NOT_LOAD_CONFIGURATION_') && _PS_DO_NOT_LOAD_CONFIGURATION_) + return false; + // If conf if not initialized, try manual query if (!self::$_CONF) { diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 78bb412a2..3c03a518b 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -419,41 +419,28 @@ class AdminControllerCore extends Controller */ public function processFilter() { + $prefix = str_replace(array('admin', 'controller'), '', Tools::strtolower(get_class($this))); // Filter memorization if (isset($_POST) && !empty($_POST) && isset($this->table)) foreach ($_POST as $key => $value) { - if (is_array($this->table)) - { - foreach ($this->table as $table) - if (stripos($key, $table.'Filter_') === 0 || stripos($key, 'submitFilter') === 0) - $this->context->cookie->$key = !is_array($value) ? $value : serialize($value); - } - elseif (stripos($key, $this->table.'Filter_') === 0 || stripos($key, 'submitFilter') === 0) + if (stripos($key, $this->table.'Filter_') === 0) + $this->context->cookie->{$prefix.$key} = !is_array($value) ? $value : serialize($value); + elseif(stripos($key, 'submitFilter') === 0) $this->context->cookie->$key = !is_array($value) ? $value : serialize($value); } if (isset($_GET) && !empty($_GET) && isset($this->table)) foreach ($_GET as $key => $value) - { - if (is_array($this->table)) - { - foreach ($this->table as $table) - if (stripos($key, $table.'OrderBy') === 0 || stripos($key, $table.'Orderway') === 0) - $this->context->cookie->$key = $value; - } - elseif (stripos($key, $this->table.'OrderBy') === 0 || stripos($key, $this->table.'Orderway') === 0) + if (stripos($key, $this->table.'OrderBy') === 0 || stripos($key, $this->table.'Orderway') === 0) $this->context->cookie->$key = $value; - } - - $filters = $this->context->cookie->getFamily($this->table.'Filter_'); - + $filters = $this->context->cookie->getFamily($prefix.$this->table.'Filter_'); foreach ($filters as $key => $value) { /* Extracting filters from $_POST on key filter_ */ - if ($value != null && !strncmp($key, $this->table.'Filter_', 7 + Tools::strlen($this->table))) + if ($value != null && !strncmp($key, $prefix.$this->table.'Filter_', 7 + Tools::strlen($prefix.$this->table))) { - $key = Tools::substr($key, 7 + Tools::strlen($this->table)); + $key = Tools::substr($key, 7 + Tools::strlen($prefix.$this->table)); /* Table alias could be specified using a ! eg. alias!field */ $tmp_tab = explode('!', $key); $filter = count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0]; @@ -835,11 +822,12 @@ class AdminControllerCore extends Controller */ public function processResetFilters() { - $filters = $this->context->cookie->getFamily($this->table.'Filter_'); + $prefix = str_replace(array('admin', 'controller'), '', Tools::strtolower(get_class($this))); + $filters = $this->context->cookie->getFamily($prefix.$this->table.'Filter_'); foreach ($filters as $cookie_key => $filter) - if (strncmp($cookie_key, $this->table.'Filter_', 7 + Tools::strlen($this->table)) == 0) + if (strncmp($cookie_key, $prefix.$this->table.'Filter_', 7 + Tools::strlen($prefix.$this->table)) == 0) { - $key = substr($cookie_key, 7 + Tools::strlen($this->table)); + $key = substr($cookie_key, 7 + Tools::strlen($prefix.$this->table)); /* Table alias could be specified using a ! eg. alias!field */ $tmp_tab = explode('!', $key); $key = (count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0]); @@ -1592,6 +1580,7 @@ class AdminControllerCore extends Controller $helper->multiple_fieldsets = $this->multiple_fieldsets; $helper->row_hover = $this->row_hover; $helper->position_identifier = $this->position_identifier; + $helper->controller_name = $this->controller_name; // For each action, try to add the corresponding skip elements list $helper->list_skip_actions = $this->list_skip_actions; diff --git a/classes/helper/HelperList.php b/classes/helper/HelperList.php index f0f206606..c7d6ca626 100644 --- a/classes/helper/HelperList.php +++ b/classes/helper/HelperList.php @@ -530,11 +530,12 @@ class HelperListCore extends Helper if ($this->position_identifier && ($this->orderBy == 'position' && $this->orderWay != 'DESC')) $table_dnd = true; + $prefix = isset($this->controller_name) ? str_replace(array('admin', 'controller'), '', Tools::strtolower($this->controller_name)) : ''; foreach ($this->fields_list as $key => $params) { if (!isset($params['type'])) $params['type'] = 'text'; - $value = Context::getContext()->cookie->{$this->table.'Filter_'.(array_key_exists('filter_key', $params) ? $params['filter_key'] : $key)}; + $value = Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.(array_key_exists('filter_key', $params) ? $params['filter_key'] : $key)}; switch ($params['type']) { case 'bool': @@ -558,9 +559,9 @@ class HelperListCore extends Helper case 'select': foreach ($params['list'] as $option_value => $option_display) { - if (isset(Context::getContext()->cookie->{$this->table.'Filter_'.$params['filter_key']}) - && Context::getContext()->cookie->{$this->table.'Filter_'.$params['filter_key']} == $option_value - && Context::getContext()->cookie->{$this->table.'Filter_'.$params['filter_key']} != '') + if (isset(Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.$params['filter_key']}) + && Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.$params['filter_key']} == $option_value + && Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.$params['filter_key']} != '') $this->fields_list[$key]['select'][$option_value]['selected'] = 'selected'; } break; diff --git a/install-dev/controllers/http/smarty_compile.php b/install-dev/controllers/http/smarty_compile.php index d8ec92a58..e8374410c 100644 --- a/install-dev/controllers/http/smarty_compile.php +++ b/install-dev/controllers/http/smarty_compile.php @@ -24,7 +24,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -require_once(_PS_ROOT_DIR_.'/config/settings.inc.php'); +define('_PS_DO_NOT_LOAD_CONFIGURATION_', true); if (Tools::getValue('bo')) { if (!is_dir(_PS_ROOT_DIR_.'/admin/')) diff --git a/themes/default/css/global.css b/themes/default/css/global.css index 517f98a81..2e71455cb 100644 --- a/themes/default/css/global.css +++ b/themes/default/css/global.css @@ -812,6 +812,8 @@ table#cart_summary #total_price_container { font-size:13px } .cart_voucher p {padding-bottom:0;} + +.cart_voucher p.discount_name_block {float:left;} .cart_voucher #display_cart_vouchers { clear:both; line-height: 20px; diff --git a/themes/default/shopping-cart.tpl b/themes/default/shopping-cart.tpl index 8a54749bc..bdea6d762 100644 --- a/themes/default/shopping-cart.tpl +++ b/themes/default/shopping-cart.tpl @@ -185,7 +185,7 @@