Skip to content

Commit

Permalink
Merge pull request #805 from romainruaud/fix_one-result-redirect
Browse files Browse the repository at this point in the history
Prevent applying the redirect on one result if another exists
  • Loading branch information
afoucret authored Mar 9, 2018
2 parents 10b650e + 8cda5ad commit 4d565e4
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ public function __construct(
/**
* Process a redirect to the product page if there is only one result for a given search.
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*
* @param \Magento\CatalogSearch\Controller\Result\Index $subject The CatalogSearch Result Controller
* @param \Closure $proceed The execute method
*
Expand All @@ -99,7 +97,7 @@ public function aroundExecute(
) {
$proceed();

if ($this->scopeConfig->isSetFlag(self::REDIRECT_SETTINGS_CONFIG_XML_FLAG)) {
if (!$subject->getResponse()->isRedirect() && $this->scopeConfig->isSetFlag(self::REDIRECT_SETTINGS_CONFIG_XML_FLAG)) {
$layer = $this->layerResolver->get();
$layerState = $layer->getState();

Expand Down

0 comments on commit 4d565e4

Please sign in to comment.