Skip to content

Commit

Permalink
Wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ah-net committed Jul 25, 2023
1 parent 7b121eb commit ec1d12d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
2 changes: 2 additions & 0 deletions Controller/Ajax/FacetAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public function execute()
$facetRequest = $this->requestFactory->create();

$categoryId = $this->getRequest()->getParam('category');
$facetKey = $this->getRequest()->getParam('facetkey');
$facetRequest->addCategoryFilter($categoryId);
$facetRequest->addFacetKey($facetKey);

$response = $this->client->request($facetRequest);
$result = [];
Expand Down
9 changes: 2 additions & 7 deletions Model/Client/Request/FacetAttributeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class FacetAttributeRequest extends Request
public function __construct(Helper $helper, StoreManager $storeManager)
{
parent::__construct($helper, $storeManager);
$this->setPath($this->path);
}

/**
Expand All @@ -46,11 +45,7 @@ public function getResponseType()
return FacetAttributesResponse::class;
}

/**
* {@inheritdoc}
*/
public function setPath($path)
{
$this->path .= '/ae-color/attributes';
public function addFacetKey($facetKey) {
$this->setPath($this->path . '/' . $facetKey . '/attributes');
}
}
7 changes: 0 additions & 7 deletions Model/Client/Response/FacetResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ public function setFacets(array $facets)
$value = new FacetType($value);
}

if (isset($value[0])) {
$values = $value;
}else {
//only one result
$values[] = $value;
}

$values[] = $value;
}

Expand Down

0 comments on commit ec1d12d

Please sign in to comment.