From fce4e79b4df046b284afe6bdc2809c7dc20cd70b Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Wed, 11 Dec 2013 17:31:55 +0100 Subject: [PATCH 1/2] [-] MO : BlockLayered - FixBug #PNM-1331 Categories now filtered by groups --- modules/blocklayered/blocklayered.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/blocklayered/blocklayered.php b/modules/blocklayered/blocklayered.php index 7346ca95c..9a7987e7b 100644 --- a/modules/blocklayered/blocklayered.php +++ b/modules/blocklayered/blocklayered.php @@ -2190,7 +2190,10 @@ class BlockLayered extends Module break; + case 'category': + $this->user_groups = ($this->context->customer->isLogged() ? $this->context->customer->getGroups() : array(Configuration::get('PS_UNIDENTIFIED_GROUP'))); + $depth = Configuration::get('PS_LAYERED_FILTER_CATEGORY_DEPTH'); if ($depth === false) $depth = 1; @@ -2206,9 +2209,11 @@ class BlockLayered extends Module $sql_query['group'] = ') count_products FROM '._DB_PREFIX_.'category c LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = c.id_category AND cl.`id_shop` = '.(int)Context::getContext()->shop->id.' and cl.id_lang = '.$id_lang.') + RIGHT JOIN '._DB_PREFIX_.'category_group cg ON (cg.id_category = c.id_category AND cg.`id_group` IN ('.implode(', ', $this->user_groups).')) WHERE c.nleft > '.(int)$parent->nleft.' AND c.nright < '.(int)$parent->nright.' '.($depth ? 'AND c.level_depth <= '.($parent->level_depth+(int)$depth) : '').' + AND c.active = 1 GROUP BY c.id_category ORDER BY c.nleft, c.position'; } From b66d47083ed32b522440739183c1f99898362c11 Mon Sep 17 00:00:00 2001 From: sLorenzini Date: Wed, 11 Dec 2013 17:34:17 +0100 Subject: [PATCH 2/2] // update schema.org on product-list --- themes/default-bootstrap/product-list.tpl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/themes/default-bootstrap/product-list.tpl b/themes/default-bootstrap/product-list.tpl index 30c05c5e4..14ef8803c 100644 --- a/themes/default-bootstrap/product-list.tpl +++ b/themes/default-bootstrap/product-list.tpl @@ -76,7 +76,8 @@
+ itemscope + itemtype="http://schema.org/Offer"> {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)} {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} @@ -258,10 +259,10 @@ html += '
' + $(element).find('.left-block').html() + '
'; html += '
'; html += '
'+ $(element).find('.product-flags').html() + '
'; - html += '
'+ $(element).find('h5').html() + '
'; + html += '
'+ $(element).find('h5').html() + '
'; var rating = $(element).find('.comments_note').html(); // check : rating if (rating != null) { - html += '
'+ rating + '
'; + html += '
'+ rating + '
'; } html += '

'+ $(element).find('.product-desc').html() + '

'; var colorList = $(element).find('.color-list-container').html(); @@ -300,17 +301,17 @@ html += '
' + $(element).find('.left-block').html() + '
'; html += '
'; html += '
'+ $(element).find('.product-flags').html() + '
'; - html += '
'+ $(element).find('h5').html() + '
'; + html += '
'+ $(element).find('h5').html() + '
'; var rating = $(element).find('.comments_note').html(); // check : rating if (rating != null) { - html += '
'+ rating + '
'; + html += '
'+ rating + '
'; } - html += '

'+ $(element).find('.product-desc').html() + '

'; + html += '

'+ $(element).find('.product-desc').html() + '

'; var price = $(element).find('.content_price').html(); // check : catalog mode is enabled if (price != null) { html += '
'+ price + '
'; } - html += '
'+ $(element).find('.button-container').html() +'
'; + html += '
'+ $(element).find('.button-container').html() +'
'; var colorList = $(element).find('.color-list-container').html(); if (colorList != null) { html += '
'+ colorList +'
';