Commit 91a4ccc9f7cc2b773f99b37498940c487096b8a0

Authored by Administrator
1 parent 5ad602b0

add variantSku

Showing 1 changed file with 4 additions and 2 deletions   Show diff stats
helpers/CatalogFilterHelper.php 100644 → 100755
@@ -305,12 +305,14 @@ class CatalogFilterHelper extends Object @@ -305,12 +305,14 @@ class CatalogFilterHelper extends Object
305 */ 305 */
306 private static function filterPrices(array $params, array &$filters) 306 private static function filterPrices(array $params, array &$filters)
307 { 307 {
  308 + $filterP['nested']['path'] = 'variants';
308 if (!empty( $params[ 'min' ] ) && $params[ 'min' ] > 0) { 309 if (!empty( $params[ 'min' ] ) && $params[ 'min' ] > 0) {
309 - $filters['bool']['filter']['range']['age']['gte'] = $params[ 'min' ]; 310 + $filterP['nested']['query']['bool']['filter'][]['range']['variants.price']['gte'] = $params[ 'min' ];
310 } 311 }
311 if (!empty( $params[ 'max' ] ) && $params[ 'max' ] > 0) { 312 if (!empty( $params[ 'max' ] ) && $params[ 'max' ] > 0) {
312 - $filters['bool']['filter']['range']['age']['lte'] = $params[ 'max' ]; 313 + $filterP['nested']['query']['bool']['filter'][]['range']['variants.price']['lte'] = $params[ 'max' ];
313 } 314 }
  315 + $filters['bool']['must'][] = $filterP;
314 316
315 } 317 }
316 318