Merge pull request #112 from bagisto/jitendra

Front search issue fixed
This commit is contained in:
JItendra Singh 2018-10-30 19:57:21 +05:30 committed by GitHub
commit 74b2974faa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -35,6 +35,11 @@ class SearchByAttributeCriteria extends AbstractProduct implements CriteriaInter
*/
public function apply($model, RepositoryInterface $repository)
{
return $model = $model->leftJoin('product_attribute_values as pav', 'products.id', '=', 'pav.product_id')->where('attribute_id', '=', 75)->where('products.parent_id', '=', null);
$attribute = $this->attribute->findOneByField('code', 'name');
return $model
->leftJoin('product_attribute_values as pav', 'products.id', '=', 'pav.product_id')
->where('attribute_id', '=', $attribute->id)
->where('products.parent_id', '=', null);
}
}