diff --git a/modules/blocklayered/blocklayered.php b/modules/blocklayered/blocklayered.php index dc4e7600e..85cb8a7d4 100644 --- a/modules/blocklayered/blocklayered.php +++ b/modules/blocklayered/blocklayered.php @@ -39,7 +39,7 @@ class BlockLayered extends Module { $this->name = 'blocklayered'; $this->tab = 'front_office_features'; - $this->version = '1.8.2'; + $this->version = '1.8.3'; $this->author = 'PrestaShop'; $this->need_instance = 0; @@ -70,6 +70,7 @@ class BlockLayered extends Module Configuration::updateValue('PS_LAYERED_FILTER_CATEGORY_DEPTH', 1); Configuration::updateValue('PS_LAYERED_FILTER_INDEX_QTY', 0); Configuration::updateValue('PS_LAYERED_FILTER_INDEX_CDT', 0); + Configuration::updateValue('PS_LAYERED_FILTER_INDEX_MNF', 0); $this->rebuildLayeredStructure(); @@ -109,6 +110,7 @@ class BlockLayered extends Module Configuration::deleteByName('PS_LAYERED_FILTER_CATEGORY_DEPTH'); Configuration::deleteByName('PS_LAYERED_FILTER_INDEX_QTY'); Configuration::deleteByName('PS_LAYERED_FILTER_INDEX_CDT'); + Configuration::deleteByName('PS_LAYERED_FILTER_INDEX_MNF'); Db::getInstance()->execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_price_index'); Db::getInstance()->execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_friendly_url'); @@ -1225,15 +1227,18 @@ class BlockLayered extends Module $attributes = array(); $features = array(); + $blacklist = array('weight', 'price'); + if (!Configuration::get('PS_LAYERED_FILTER_INDEX_CDT')) + $blacklist[] = 'condition'; + if (!Configuration::get('PS_LAYERED_FILTER_INDEX_QTY')) + $blacklist[] = 'quantity'; + if (!Configuration::get('PS_LAYERED_FILTER_INDEX_MNF')) + $blacklist[] = 'manufacturer'; + foreach ($filters as $type => $val) { switch($type) { - case 'price': - case 'weight': - $smarty->assign('nobots', true); - $smarty->assign('nofollow', true); - return; case 'id_attribute_group': foreach ($val as $attr) { @@ -1259,7 +1264,14 @@ class BlockLayered extends Module } break; default: - if (count($val) > 1) { + if (in_array($type, $blacklist)) + { + $smarty->assign('nobots', true); + $smarty->assign('nofollow', true); + return; + } + if (count($val) > 1) + { $smarty->assign('nobots', true); $smarty->assign('nofollow', true); return; @@ -1428,6 +1440,7 @@ class BlockLayered extends Module Configuration::updateValue('PS_LAYERED_FILTER_CATEGORY_DEPTH', (int)Tools::getValue('ps_layered_filter_category_depth')); Configuration::updateValue('PS_LAYERED_FILTER_INDEX_QTY', (int)Tools::getValue('ps_layered_filter_index_availability')); Configuration::updateValue('PS_LAYERED_FILTER_INDEX_CDT', (int)Tools::getValue('ps_layered_filter_index_condition')); + Configuration::updateValue('PS_LAYERED_FILTER_INDEX_MNF', (int)Tools::getValue('ps_layered_filter_index_manufacturer')); $html .= '
+ '.$this->l('Yes').'
+
+ '.$this->l('No').'
+