Commit f1646b52d95f1d2f6ab4f55b1457fdf0eeebee41
1 parent
91a4ccc9
add variantSku
Showing
1 changed file
with
17 additions
and
2 deletions
Show diff stats
helpers/CatalogFilterHelper.php
| ... | ... | @@ -167,6 +167,23 @@ class CatalogFilterHelper extends Object |
| 167 | 167 | public static function setQueryParams(array $params, $categoryId, $langId,$in_stock=true) |
| 168 | 168 | { |
| 169 | 169 | |
| 170 | + if (!empty( $params[ 'special' ] )) { | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + if (in_array('new', $params[ 'special' ])) { | |
| 175 | + $reform[ 'special' ][ 'is_new' ] = true; | |
| 176 | + } | |
| 177 | + if (in_array('top', $params[ 'special' ])) { | |
| 178 | + $reform[ 'special' ][ 'is_top' ] = true; | |
| 179 | + } | |
| 180 | + if (in_array('promo', $params[ 'special' ])) { | |
| 181 | + $reform[ 'special' ][ 'is_discount' ] = true; | |
| 182 | + } | |
| 183 | + | |
| 184 | + $params[ 'special' ] = $reform[ 'special' ]; | |
| 185 | + } | |
| 186 | + | |
| 170 | 187 | $last_query = null; |
| 171 | 188 | $productVariantOptions = self::getProductVariantOptions($categoryId,$langId); |
| 172 | 189 | $filters = []; |
| ... | ... | @@ -275,9 +292,7 @@ class CatalogFilterHelper extends Object |
| 275 | 292 | */ |
| 276 | 293 | |
| 277 | 294 | foreach ($params as $key => $param) { |
| 278 | - | |
| 279 | 295 | $filters['bool']['must'][]['term'][$key] = $param; |
| 280 | - | |
| 281 | 296 | } |
| 282 | 297 | |
| 283 | 298 | } | ... | ... |