Commit 27c5f6f5050752c70f3b3acd1286ab9309b0c6b3
Merge remote-tracking branch 'origin/master'
Showing
7 changed files
with
58 additions
and
17 deletions
Show diff stats
common/config/main.php
@@ -9,7 +9,7 @@ return [ | @@ -9,7 +9,7 @@ return [ | ||
9 | ], | 9 | ], |
10 | 'components' => [ | 10 | 'components' => [ |
11 | 'cache' => [ | 11 | 'cache' => [ |
12 | - 'class' => 'yii\caching\MemCache', | 12 | + 'class' => 'yii\caching\DummyCache', |
13 | 'keyPrefix' => 'linija_' | 13 | 'keyPrefix' => 'linija_' |
14 | ], | 14 | ], |
15 | 'sms' => [ | 15 | 'sms' => [ |
common/modules/product/models/Import.php
@@ -106,7 +106,7 @@ | @@ -106,7 +106,7 @@ | ||
106 | 106 | ||
107 | if ($from == 0) { | 107 | if ($from == 0) { |
108 | ProductStock::updateAll([ 'quantity' => 0 ]); | 108 | ProductStock::updateAll([ 'quantity' => 0 ]); |
109 | - ProductVariant::updateAll([ 'status' => 1 ]); | 109 | + ProductVariant::updateAll([ 'status' => 1 ], 'status != 2'); |
110 | } | 110 | } |
111 | 111 | ||
112 | while (empty( $limit ) || $j++ < $limit) { | 112 | while (empty( $limit ) || $j++ < $limit) { |
@@ -164,7 +164,9 @@ | @@ -164,7 +164,9 @@ | ||
164 | // ===== Set stock ==== | 164 | // ===== Set stock ==== |
165 | if (!$city_name) { | 165 | if (!$city_name) { |
166 | if (!$count) { | 166 | if (!$count) { |
167 | - $productVariant->status = 0; | 167 | + if ($productVariant->status !== 2) { |
168 | + $productVariant->status = 0; | ||
169 | + } | ||
168 | if ($price_promo) { | 170 | if ($price_promo) { |
169 | $productVariant->price_old = $price; | 171 | $productVariant->price_old = $price; |
170 | $productVariant->price = $price_promo; | 172 | $productVariant->price = $price_promo; |
@@ -227,7 +229,9 @@ | @@ -227,7 +229,9 @@ | ||
227 | } | 229 | } |
228 | 230 | ||
229 | $productVariant->stock = $quantity; | 231 | $productVariant->stock = $quantity; |
230 | - $productVariant->status = 0; | 232 | + if ($productVariant->status !== 2) { |
233 | + $productVariant->status = 0; | ||
234 | + } | ||
231 | $productVariant->save(); | 235 | $productVariant->save(); |
232 | 236 | ||
233 | $this->output[] = '<font style="color:blue">Товар ' . $product_title . ' успешно сохранен</font>'; | 237 | $this->output[] = '<font style="color:blue">Товар ' . $product_title . ' успешно сохранен</font>'; |
frontend/models/ProductFrontendSearch.php
@@ -115,10 +115,13 @@ | @@ -115,10 +115,13 @@ | ||
115 | ); | 115 | ); |
116 | 116 | ||
117 | // $query->groupBy(['product.product_id', 'product_variant.price', 'product_variant.stock']); | 117 | // $query->groupBy(['product.product_id', 'product_variant.price', 'product_variant.stock']); |
118 | - $query->orderBy([ | ||
119 | - 'brand.sort' => SORT_ASC, | ||
120 | - 'product_variant.stock' => SORT_DESC, | ||
121 | - ]); | 118 | + $query->orderBy( |
119 | + [ | ||
120 | + 'brand.sort' => SORT_ASC, | ||
121 | + 'product_variant.price' => SORT_ASC, | ||
122 | + 'product_variant.stock' => SORT_DESC, | ||
123 | + ] | ||
124 | + ); | ||
122 | ProductHelper::_setQueryParams($query, $params); | 125 | ProductHelper::_setQueryParams($query, $params); |
123 | if ($in_stock) { | 126 | if ($in_stock) { |
124 | $query->andWhere( | 127 | $query->andWhere( |
@@ -143,7 +146,8 @@ | @@ -143,7 +146,8 @@ | ||
143 | ->innerJoin( | 146 | ->innerJoin( |
144 | 'event', | 147 | 'event', |
145 | 'event.event_id=events_to_products.event_id' | 148 | 'event.event_id=events_to_products.event_id' |
146 | - )->where(['event.sale' => true]), | 149 | + ) |
150 | + ->where([ 'event.sale' => true ]), | ||
147 | ], | 151 | ], |
148 | ] | 152 | ] |
149 | ); | 153 | ); |
frontend/views/catalog/_product_item.php
@@ -94,13 +94,15 @@ use yii\helpers\Url; | @@ -94,13 +94,15 @@ use yii\helpers\Url; | ||
94 | <div class="additional_info params"> | 94 | <div class="additional_info params"> |
95 | <div class="block_title">Особенности | 95 | <div class="block_title">Особенности |
96 | <span style="float: right;font-weight: normal;color: #390;font-size: 13px;"> | 96 | <span style="float: right;font-weight: normal;color: #390;font-size: 13px;"> |
97 | - <?php if($model->variant->status == 1){?> | ||
98 | - снят с производства | ||
99 | - <?php } elseif($model->variant->stock > 0) {?> | ||
100 | - в наличии | ||
101 | - <?php } else {?> | ||
102 | - под заказ | ||
103 | - <?php } ?> | 97 | + <?php if($model->variant->status == 1){?> |
98 | + снят с производства | ||
99 | + <?php } elseif($model->variant->status == 2) {?> | ||
100 | + в ожидании | ||
101 | + <?php } elseif($model->variant->stock > 0) {?> | ||
102 | + в наличии | ||
103 | + <?php } else {?> | ||
104 | + под заказ | ||
105 | + <?php } ?> | ||
104 | </span> | 106 | </span> |
105 | </div> | 107 | </div> |
106 | <div class="descr"> | 108 | <div class="descr"> |
frontend/views/layouts/main.php
@@ -474,6 +474,7 @@ | @@ -474,6 +474,7 @@ | ||
474 | </footer> | 474 | </footer> |
475 | 475 | ||
476 | <div class="btn-fixeds fixed-events"><a href="/event/main">акции</a></div> | 476 | <div class="btn-fixeds fixed-events"><a href="/event/main">акции</a></div> |
477 | + <div class="btn-fixeds fixed-events btns_trio-link"><a href="/catalog/lyustry-i-potolochnoe-osveshchenie">Новинка<b></b></a></div> | ||
477 | <!--<div class="btn-fixeds fixed-sale"><a href="/event">Распродажа</a></div>--> | 478 | <!--<div class="btn-fixeds fixed-sale"><a href="/event">Распродажа</a></div>--> |
478 | 479 | ||
479 | <table border="0" cellspacing="0" cellpadding="0" class="reqsBox"></table> | 480 | <table border="0" cellspacing="0" cellpadding="0" class="reqsBox"></table> |
frontend/web/css/css_header.css
@@ -8255,6 +8255,26 @@ footer .content-title { | @@ -8255,6 +8255,26 @@ footer .content-title { | ||
8255 | color: #01974a | 8255 | color: #01974a |
8256 | } | 8256 | } |
8257 | 8257 | ||
8258 | +.btn-fixeds.btns_trio-link { | ||
8259 | + right: auto; | ||
8260 | + left: 40px; | ||
8261 | +} | ||
8262 | +.btn-fixeds.btns_trio-link a { | ||
8263 | + text-align: left; | ||
8264 | + padding-left: 20px; | ||
8265 | +} | ||
8266 | +.btn-fixeds.btns_trio-link a b { | ||
8267 | + background: url(../images/trio-min.png) 0 50% no-repeat; | ||
8268 | + width: 32px; | ||
8269 | + height: 41px; | ||
8270 | + position: absolute; | ||
8271 | + top: 0; | ||
8272 | + right: 20px; | ||
8273 | +} | ||
8274 | + | ||
8275 | + | ||
8276 | + | ||
8277 | + | ||
8258 | .brbeadcrumbs-wr { | 8278 | .brbeadcrumbs-wr { |
8259 | height: 83px; | 8279 | height: 83px; |
8260 | line-height: 83px | 8280 | line-height: 83px |
@@ -13250,7 +13270,17 @@ h1.title { | @@ -13250,7 +13270,17 @@ h1.title { | ||
13250 | .fixed-events { | 13270 | .fixed-events { |
13251 | transform: rotate(-90deg); | 13271 | transform: rotate(-90deg); |
13252 | -webkit-transform: rotate(-90deg); | 13272 | -webkit-transform: rotate(-90deg); |
13253 | - right: -53px | 13273 | + right: -53px; |
13274 | + } | ||
13275 | + | ||
13276 | + .btn-fixeds.btns_trio-link { | ||
13277 | + transform: rotate(90deg); | ||
13278 | + -webkit-transform: rotate(90deg); | ||
13279 | + left: -53px; | ||
13280 | + } | ||
13281 | + .btn-fixeds.btns_trio-link a{ | ||
13282 | + transform: rotate(180deg); | ||
13283 | + -webkit-transform: rotate(180deg); | ||
13254 | } | 13284 | } |
13255 | 13285 | ||
13256 | .fixed-sale { | 13286 | .fixed-sale { |
1.61 KB