From e62011708f4557dbc75ed131340f1be2bcb484ea Mon Sep 17 00:00:00 2001 From: mDeflotte Date: Thu, 8 Dec 2011 10:36:42 +0000 Subject: [PATCH] // Blocklayered --- modules/blocklayered/blocklayered.css | 14 ++++---------- modules/blocklayered/blocklayered.php | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/modules/blocklayered/blocklayered.css b/modules/blocklayered/blocklayered.css index 447ed9cfe..6c91d2961 100644 --- a/modules/blocklayered/blocklayered.css +++ b/modules/blocklayered/blocklayered.css @@ -75,21 +75,15 @@ margin-bottom: 4px; } +#layered_block_left span.layered_close a { text-decoration: none; } + #layered_block_left span.layered_close { - display: block; float: right; - margin-bottom: 4px; font-weight: bold; font-size: 12px; + display: block; + margin-bottom: 4px; } -#layered_block_left span.layered_close a { - display:block; - height:12px; - width:12px; - text-decoration: none; - background:url(img/icon/delete.gif) no-repeat 0 0; -} - #layered_block_left ul li input.checkbox { vertical-align: middle; diff --git a/modules/blocklayered/blocklayered.php b/modules/blocklayered/blocklayered.php index d0b33e45c..891b18220 100644 --- a/modules/blocklayered/blocklayered.php +++ b/modules/blocklayered/blocklayered.php @@ -2082,14 +2082,14 @@ class BlockLayered extends Module AND psi.`id_currency` = '.$idCurrency; } - $allProductsOut = Db::getInstance(_PS_USE_SQL_SLAVE_)->query(' + $allProductsOut = self::query(' SELECT p.`id_product` id_product FROM `'._DB_PREFIX_.'product` p '.$priceFilterQueryOut.' '.$queryFiltersFrom.' WHERE 1 '.$queryFiltersWhere.' GROUP BY id_product'); - $allProductsIn = Db::getInstance(_PS_USE_SQL_SLAVE_)->query(' + $allProductsIn = self::query(' SELECT p.`id_product` id_product FROM `'._DB_PREFIX_.'product` p '.$priceFilterQueryIn.' @@ -2138,6 +2138,14 @@ class BlockLayered extends Module return $this->products; } + private static function query($sql_query) + { + if (version_compare(_PS_VERSION_,'1.5','>')) + return Db::getInstance(_PS_USE_SQL_SLAVE_)->query($sql_query); + else + return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql_query, false); + } + public function getFilterBlock($selectedFilters = array()) { global $cookie; @@ -3304,7 +3312,7 @@ class BlockLayered extends Module $nCategories = array(); $doneCategories = array(); - $attributeGroups = Db::getInstance(_PS_USE_SQL_SLAVE_)->query(' + $attributeGroups = self::query(' SELECT a.id_attribute, a.id_attribute_group FROM '._DB_PREFIX_.'attribute a LEFT JOIN '._DB_PREFIX_.'product_attribute_combination pac ON (pac.id_attribute = a.id_attribute) @@ -3319,7 +3327,7 @@ class BlockLayered extends Module while ($row = $db->nextRow($attributeGroups)) $attributeGroupsById[(int)$row['id_attribute']] = (int)$row['id_attribute_group']; - $features = Db::getInstance(_PS_USE_SQL_SLAVE_)->query(' + $features = self::query(' SELECT fv.id_feature_value, fv.id_feature FROM '._DB_PREFIX_.'feature_value fv LEFT JOIN '._DB_PREFIX_.'feature_product fp ON (fp.id_feature_value = fv.id_feature_value)