Commit 036d79907800fd857caecfaa16db02ac3fc7c4e2

Authored by Yarik
2 parents 096128d9 ff1da5e9

Merge remote-tracking branch 'origin/master'

common/modules/product/helpers/ProductHelper.php
@@ -132,7 +132,10 @@ @@ -132,7 +132,10 @@
132 if(!is_object($product)) { 132 if(!is_object($product)) {
133 $product = Product::find() 133 $product = Product::find()
134 ->where([ 'product_id' => $product ]) 134 ->where([ 'product_id' => $product ])
135 - ->with('enabledVariants') 135 + ->with([
  136 + 'enabledVariants',
  137 + 'variant',
  138 + ])
136 ->one(); 139 ->one();
137 } 140 }
138 141
@@ -153,8 +156,8 @@ @@ -153,8 +156,8 @@
153 1, 156 1,
154 ]) 157 ])
155 ->andWhere([ 'product_category.category_id' => $product_categories ]); 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 $query->innerJoin('product_option', 'product_option.product_id = product.product_id'); 162 $query->innerJoin('product_option', 'product_option.product_id = product.product_id');
160 $where = [ ]; 163 $where = [ ];
@@ -192,7 +195,6 @@ @@ -192,7 +195,6 @@
192 /** 195 /**
193 * @param ActiveQuery $query 196 * @param ActiveQuery $query
194 * @param $params 197 * @param $params
195 - * @param bool $setPriceLimits  
196 */ 198 */
197 public static function _setQueryParams(&$query, $params) 199 public static function _setQueryParams(&$query, $params)
198 { 200 {
frontend/web/js/filter.js
@@ -72,9 +72,10 @@ function priceRequest(link){ @@ -72,9 +72,10 @@ function priceRequest(link){
72 data: {info:filter,category:id}, 72 data: {info:filter,category:id},
73 success: function(result){ 73 success: function(result){
74 if(result=='0'){ 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 } else { 79 } else {
79 $(link).removeClass('disabled-link'); 80 $(link).removeClass('disabled-link');
80 tag.find('input').prop( "disabled", false ); 81 tag.find('input').prop( "disabled", false );