Commit 036d79907800fd857caecfaa16db02ac3fc7c4e2
Merge remote-tracking branch 'origin/master'
Showing
2 changed files
with
10 additions
and
7 deletions
Show diff stats
common/modules/product/helpers/ProductHelper.php
... | ... | @@ -132,7 +132,10 @@ |
132 | 132 | if(!is_object($product)) { |
133 | 133 | $product = Product::find() |
134 | 134 | ->where([ 'product_id' => $product ]) |
135 | - ->with('enabledVariants') | |
135 | + ->with([ | |
136 | + 'enabledVariants', | |
137 | + 'variant', | |
138 | + ]) | |
136 | 139 | ->one(); |
137 | 140 | } |
138 | 141 | |
... | ... | @@ -153,8 +156,8 @@ |
153 | 156 | 1, |
154 | 157 | ]) |
155 | 158 | ->andWhere([ 'product_category.category_id' => $product_categories ]); |
156 | - $query->andWhere(['>=', 'product_variant.price', $product->enabledVariant->price * 0.7]); | |
157 | - $query->andWhere(['<=', 'product_variant.price', $product->enabledVariant->price * 1.3]); | |
159 | + $query->andWhere(['>=', 'product_variant.price', $product->variant->price * 0.7]); | |
160 | + $query->andWhere(['<=', 'product_variant.price', $product->variant->price * 1.3]); | |
158 | 161 | |
159 | 162 | $query->innerJoin('product_option', 'product_option.product_id = product.product_id'); |
160 | 163 | $where = [ ]; |
... | ... | @@ -192,7 +195,6 @@ |
192 | 195 | /** |
193 | 196 | * @param ActiveQuery $query |
194 | 197 | * @param $params |
195 | - * @param bool $setPriceLimits | |
196 | 198 | */ |
197 | 199 | public static function _setQueryParams(&$query, $params) |
198 | 200 | { | ... | ... |
frontend/web/js/filter.js
... | ... | @@ -72,9 +72,10 @@ function priceRequest(link){ |
72 | 72 | data: {info:filter,category:id}, |
73 | 73 | success: function(result){ |
74 | 74 | if(result=='0'){ |
75 | - $(link).addClass('disabled-link'); | |
76 | - tag.find('input').prop( "disabled", true ); | |
77 | - $(link).find("span").html('('+result+')'); | |
75 | + $(link).parent().parent().parent().remove(); | |
76 | +// $(link).addClass('disabled-link'); | |
77 | +// tag.find('input').prop( "disabled", true ); | |
78 | +// $(link).find("span").html('('+result+')'); | |
78 | 79 | } else { |
79 | 80 | $(link).removeClass('disabled-link'); |
80 | 81 | tag.find('input').prop( "disabled", false ); | ... | ... |