Skip to content

Commit

Permalink
Merge pull request #5 from Gadoma/develop
Browse files Browse the repository at this point in the history
Fixed #4 facets with facetRange only
  • Loading branch information
Gadoma committed Apr 24, 2017
2 parents 5dc7660 + 686ae45 commit defb06c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/WalmartApiClient/Service/ProductService.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

class ProductService extends AbstractService implements ProductServiceInterface
{

const DEFAULT_PAGE_SIZE = 25;
const DEFAULT_SORT_FIELD = 'relevance';
const DEFAULT_SORT_ORDER = 'asc';
Expand Down Expand Up @@ -78,9 +77,11 @@ public function getBySearch($phrase, $category = '', $facets = 'off', $facetFilt
$searchParams['categoryId'] = $category;
}

if ($facets == 'on' && $facetFilter !== '') {
$constraints['facet.filter'] = $facetFilter;

if ($facets == 'on') {
if ($facetFilter !== '') {
$constraints['facet.filter'] = $facetFilter;
}

if ($facetRange !== '') {
$constraints['facet.range'] = $facetRange;
}
Expand Down

0 comments on commit defb06c

Please sign in to comment.