Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
Simplified hidden parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Edwin Jacobs committed Jan 6, 2021
1 parent c097db4 commit eed10b6
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Model/Client/Request/ProductNavigationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ProductNavigationRequest extends Request
/**
* @var array
*/
protected $hiddenParameters = '';
protected $hiddenParameters = [];

/**
* {@inheritdoc}
Expand All @@ -59,13 +59,8 @@ public function addAttributeFilter(string $attribute, $value)
*/
public function addHiddenParameter(string $attribute, $value)
{
$hiddenParameter = sprintf('%s=%s', $attribute, $value);
if (!empty($this->hiddenParameters)) {
$hiddenParameter = '&' . $hiddenParameter;
}
$this->hiddenParameters .= $hiddenParameter;

$this->setParameter('tn_parameters', $this->hiddenParameters);
$this->hiddenParameters[] = sprintf('%s=%s', $attribute, $value);
$this->setParameter('tn_parameters', implode('&', $this->hiddenParameters));
}

/**
Expand Down

0 comments on commit eed10b6

Please sign in to comment.