Front search issue fixed

This commit is contained in:
jitendra 2018-10-30 19:56:11 +05:30
parent eb327c309b
commit 7ee3c3a972
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);
}
}