diff --git a/common/modules/product/helpers/ProductHelper.php b/common/modules/product/helpers/ProductHelper.php index 1935100..8afe692 100755 --- a/common/modules/product/helpers/ProductHelper.php +++ b/common/modules/product/helpers/ProductHelper.php @@ -155,16 +155,18 @@ ->andWhere([ 'product_category.category_id' => $product_categories ]); // $query->andWhere(['>=', 'product_variant.price', $product->enabledVariant->price * 0.7]); // $query->andWhere(['<=', 'product_variant.price', $product->enabledVariant->price * 1.3]); + + $query->innerJoin('product_option', 'product_option.product_id = product.product_id'); + $where = [ ]; foreach($product->properties as $group) { - $where = [ ]; + foreach($group->_options as $option) { $where[] = $option->tax_option_id; } if(!$where) { continue; } - $query->innerJoin('product_option to' . $group->tax_group_id, 'to' . $group->tax_group_id . '.product_id = product.product_id'); - $query->andWhere([ 'to' . $group->tax_group_id . '.option_id' => $where ]); + $query->andWhere([ 'option_id' => $where ]); } $query->andWhere([ '!=', -- libgit2 0.21.4