Commit 635f37617929a30c5f064a92b334a220d32ad67f

Authored by Administrator
1 parent a452c3af

Ntr

.htaccess
... ... @@ -12,7 +12,7 @@ AddDefaultCharset utf-8
12 12 # deal with admin first
13 13 #liniya svitla only
14 14  
15   - Redirect 301 /lyustry-2.htm /catalog/lyustry-i-potolochnoe-osveshchenie
  15 + Redirect 301 /lyustry-2.htm /catalog/lyustry-i-potolochnoe-osveshchenie/filters:podrazdel-lustri=lyustra
16 16 Redirect 301 /sovremennye-3448.htm /catalog/lyustry-i-potolochnoe-osveshchenie/filters:style-lustri=sovremennyy-6
17 17 Redirect 301 /klassicheskie-3407.htm /catalog/lyustry-i-potolochnoe-osveshchenie/filters:style-lustri=klassicheskiy-4
18 18 Redirect 301 /podvesnye-3439.htm /catalog/lyustry-i-potolochnoe-osveshchenie/filters:podrazdel-lustri=podves
... ... @@ -37,7 +37,7 @@ AddDefaultCharset utf-8
37 37 Redirect 301 /lampochki-29/fcatlist-36.htm /catalog/lampochki/filters:podrazdel-lampo4ki=lyuminiscentnye
38 38 Redirect 301 /lampochki-29/fcatlist-30.htm /catalog/lampochki/filters:podrazdel-lampo4ki=nakalivaniya
39 39 Redirect 301 /lampochki-29/fcatlist-43.htm /catalog/lampochki/filters:podrazdel-lampo4ki=svetodiodnye-led
40   - Redirect 301 /bra-5.htm /catalog/bra-i-nastennoe-osveshchenie
  40 + Redirect 301 /bra-5.htm /catalog/bra-i-nastennoe-osveshchenie/filters:podrazdel-bra=bra
41 41 Redirect 301 /bra-5/fbrandlist-7 /catalog/bra-i-nastennoe-osveshchenie/filters:brands=elstead
42 42 Redirect 301 /bra-5/fbrandlist-2 /catalog/bra-i-nastennoe-osveshchenie/filters:brands=eseo
43 43 Redirect 301 /bra-5/fbrandlist-3 /catalog/bra-i-nastennoe-osveshchenie/filters:brands=lirio
... ...
frontend/controllers/CatalogController.php
... ... @@ -150,14 +150,7 @@ class CatalogController extends \yii\web\Controller
150 150  
151 151  
152 152  
153   - $cacheKey = ['ActiveProperties','id' => $category];
154   -
155   - if(!$priceLimits = Yii::$app->cache->get($cacheKey)){
156   -
157   - $priceLimits = $productModel->priceLimits($category);
158   -
159   - Yii::$app->cache->set($cacheKey,$priceLimits,3600*24);
160   - }
  153 + $priceLimits = $productModel->priceLimits($category, $params);
161 154  
162 155  
163 156 return $this->render('products', [
... ...
frontend/models/ProductFrontendSearch.php
... ... @@ -119,15 +119,21 @@ class ProductFrontendSearch extends Product {
119 119 * @return array
120 120 */
121 121  
122   - public function priceLimits($category = null) {
  122 + public function priceLimits($category = null, $params = []) {
123 123 if (!empty($category)) {
124 124 /** @var ActiveQuery $query */
  125 +// $query = $category->getRelations('product_categories');
125 126 $query = $category->getProducts();
126 127 } else {
127 128 $query = Product::find();
128 129 }
129 130 $query->joinWith('variant');
130 131  
  132 + // Price filter fix
  133 + unset($params['prices']);
  134 +
  135 + ProductHelper::_setQueryParams($query, $params);
  136 +
131 137 return [
132 138 'min' => $query->min(ProductVariant::tableName() .'.price'),
133 139 'max' => $query->max(ProductVariant::tableName() .'.price'),
... ...