Commit 8c0d4c195c420af2693bd41e81ece2dbcfb9a03c

Authored by Alexey Boroda
1 parent 9bad9e51

-get similar method fix

Showing 1 changed file with 5 additions and 3 deletions   Show diff stats
common/modules/product/helpers/ProductHelper.php
... ... @@ -155,16 +155,18 @@
155 155 ->andWhere([ 'product_category.category_id' => $product_categories ]);
156 156 // $query->andWhere(['>=', 'product_variant.price', $product->enabledVariant->price * 0.7]);
157 157 // $query->andWhere(['<=', 'product_variant.price', $product->enabledVariant->price * 1.3]);
  158 +
  159 + $query->innerJoin('product_option', 'product_option.product_id = product.product_id');
  160 + $where = [ ];
158 161 foreach($product->properties as $group) {
159   - $where = [ ];
  162 +
160 163 foreach($group->_options as $option) {
161 164 $where[] = $option->tax_option_id;
162 165 }
163 166 if(!$where) {
164 167 continue;
165 168 }
166   - $query->innerJoin('product_option to' . $group->tax_group_id, 'to' . $group->tax_group_id . '.product_id = product.product_id');
167   - $query->andWhere([ 'to' . $group->tax_group_id . '.option_id' => $where ]);
  169 + $query->andWhere([ 'option_id' => $where ]);
168 170 }
169 171 $query->andWhere([
170 172 '!=',
... ...