From 8c0d4c195c420af2693bd41e81ece2dbcfb9a03c Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 3 Feb 2017 11:18:57 +0200 Subject: [PATCH] -get similar method fix --- common/modules/product/helpers/ProductHelper.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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