Skip to content

Commit

Permalink
Merge pull request #5310 in SW/shopware from sw-19519/5.3/add-number-…
Browse files Browse the repository at this point in the history
…to-search-condition to 5.3

* commit '283e2134cedf796ffc7498384e14312a945156af':
  SW-19519 - Add main detail number as search field
  • Loading branch information
janbuecker committed Aug 8, 2017
2 parents 5bd198b + 283e213 commit 301699a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions engine/Shopware/Controllers/Backend/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

use Doctrine\DBAL\Connection;
use Shopware\Models\Article\Article;

/**
* Backend search controller
Expand Down Expand Up @@ -353,6 +354,12 @@ private function addSearchTermCondition($entity, $query, $term)
return 'entity.' . $field;
}, $fields);

switch ($entity) {
case Article::class:
$fields[] = 'mainDetail.number';
break;
}

$builder->addSearchTerm($query, $term, $fields);
}

Expand Down

0 comments on commit 301699a

Please sign in to comment.