Commit f145ede4c09878765850ed2239cd3b17abaa7b74
Merge remote-tracking branch 'origin/master'
# Conflicts: # frontend/web/css/style.css
Showing
7 changed files
with
19 additions
and
12 deletions
Show diff stats
common/config/main.php
@@ -85,8 +85,8 @@ return [ | @@ -85,8 +85,8 @@ return [ | ||
85 | ], | 85 | ], |
86 | 'product_trumb2' => [ | 86 | 'product_trumb2' => [ |
87 | 'resize' => [ | 87 | 'resize' => [ |
88 | - 'width' => 98, | ||
89 | - 'height' => 98, | 88 | + 'width' => 88, |
89 | + 'height' => 88, | ||
90 | 'master' => null | 90 | 'master' => null |
91 | ], | 91 | ], |
92 | ], | 92 | ], |
@@ -100,7 +100,7 @@ return [ | @@ -100,7 +100,7 @@ return [ | ||
100 | 'product_view' => [ | 100 | 'product_view' => [ |
101 | 'resize' => [ | 101 | 'resize' => [ |
102 | 'width' => 392, | 102 | 'width' => 392, |
103 | - 'height' => null, | 103 | + 'height' => 365, |
104 | 'master' => null | 104 | 'master' => null |
105 | ], | 105 | ], |
106 | ], | 106 | ], |
common/models/Orders.php
@@ -7,7 +7,7 @@ use common\modules\product\models\ProductVariant; | @@ -7,7 +7,7 @@ use common\modules\product\models\ProductVariant; | ||
7 | 7 | ||
8 | class Orders extends \yii\db\ActiveRecord | 8 | class Orders extends \yii\db\ActiveRecord |
9 | { | 9 | { |
10 | - | 10 | + private $data; |
11 | public static function tableName() | 11 | public static function tableName() |
12 | { | 12 | { |
13 | return 'orders'; | 13 | return 'orders'; |
frontend/controllers/BasketController.php
@@ -25,7 +25,8 @@ class BasketController extends Controller | @@ -25,7 +25,8 @@ class BasketController extends Controller | ||
25 | return Yii::$app->response->redirect(['basket/index']); | 25 | return Yii::$app->response->redirect(['basket/index']); |
26 | } | 26 | } |
27 | 27 | ||
28 | - if(isset($_POST['update'])){ | 28 | + if(isset($_POST['update']) && isset($_POST['ProductVariant'])){ |
29 | + | ||
29 | foreach ($_POST['ProductVariant'] as $index=>$row) { | 30 | foreach ($_POST['ProductVariant'] as $index=>$row) { |
30 | $modelOrder->updateBasket($row); | 31 | $modelOrder->updateBasket($row); |
31 | } | 32 | } |
@@ -83,12 +84,14 @@ class BasketController extends Controller | @@ -83,12 +84,14 @@ class BasketController extends Controller | ||
83 | 84 | ||
84 | public function actionItems(){ | 85 | public function actionItems(){ |
85 | $modelMod = new Orders; | 86 | $modelMod = new Orders; |
87 | + | ||
88 | + | ||
86 | if(!empty($_GET['deleteID'])){ | 89 | if(!empty($_GET['deleteID'])){ |
87 | $modelMod->deleteBasketMod($_GET['deleteID']); | 90 | $modelMod->deleteBasketMod($_GET['deleteID']); |
88 | } | 91 | } |
89 | 92 | ||
90 | - if(isset($_POST['Mod'])){ | ||
91 | - foreach ($_POST['Mod'] as $index=>$row) { | 93 | + if(isset($_POST['ProductVariant'])){ |
94 | + foreach ($_POST['ProductVariant'] as $index=>$row) { | ||
92 | $modelMod->updateBasket($row); | 95 | $modelMod->updateBasket($row); |
93 | } | 96 | } |
94 | } | 97 | } |
frontend/views/basket/ajax_items.php
@@ -2,7 +2,9 @@ | @@ -2,7 +2,9 @@ | ||
2 | use yii\widgets\ActiveForm; | 2 | use yii\widgets\ActiveForm; |
3 | use yii\helpers\Html; | 3 | use yii\helpers\Html; |
4 | ?> | 4 | ?> |
5 | -<?php $form = ActiveForm::begin(['enableClientScript' => false,'id'=>'basket_form2']); ?> | 5 | +<?php $form = ActiveForm::begin(['enableClientScript' => false, 'options' => [ |
6 | + 'class' => 'basket_form2' | ||
7 | +]]); ?> | ||
6 | <?php foreach($basket_mods as $i=>$item):?> | 8 | <?php foreach($basket_mods as $i=>$item):?> |
7 | <div class="basket_item"> | 9 | <div class="basket_item"> |
8 | <?php echo $form->field($item,'['.$i.']id')->hiddenInput()->label(false); ?> | 10 | <?php echo $form->field($item,'['.$i.']id')->hiddenInput()->label(false); ?> |
frontend/views/basket/index.php
@@ -38,7 +38,7 @@ $('#order-delivery input[type=\"radio\"]').click(function(){ | @@ -38,7 +38,7 @@ $('#order-delivery input[type=\"radio\"]').click(function(){ | ||
38 | 38 | ||
39 | <div class="layout"> | 39 | <div class="layout"> |
40 | 40 | ||
41 | - <h1>Корзина</h1> | 41 | + <h1 class="basket_title_">Корзина</h1> |
42 | <div class="ten"></div> | 42 | <div class="ten"></div> |
43 | <?= Html::a('Вернуться в каталог', ['/site/index'], ['class'=>'btn-success']) ?> | 43 | <?= Html::a('Вернуться в каталог', ['/site/index'], ['class'=>'btn-success']) ?> |
44 | <?php $form = ActiveForm::begin(['enableClientScript' => false]); ?> | 44 | <?php $form = ActiveForm::begin(['enableClientScript' => false]); ?> |
frontend/web/css/style.css
@@ -1235,7 +1235,7 @@ ul.product-special li.promo:after { | @@ -1235,7 +1235,7 @@ ul.product-special li.promo:after { | ||
1235 | .irs {height: 49px;} | 1235 | .irs {height: 49px;} |
1236 | .price_filter.first_price_li {margin-top: 8px;} | 1236 | .price_filter.first_price_li {margin-top: 8px;} |
1237 | .product_read_ .w{ | 1237 | .product_read_ .w{ |
1238 | - width: 110px;overflow: hidden; | 1238 | + width: 110px;overflow: hidden; |
1239 | float: left; | 1239 | float: left; |
1240 | margin: 0; | 1240 | margin: 0; |
1241 | padding-top: 0; | 1241 | padding-top: 0; |
@@ -1278,7 +1278,6 @@ ul.product-special li.promo:after { | @@ -1278,7 +1278,6 @@ ul.product-special li.promo:after { | ||
1278 | width: 100%; | 1278 | width: 100%; |
1279 | float: left; | 1279 | float: left; |
1280 | } | 1280 | } |
1281 | - | ||
1282 | .product-thumb-video iframe { | 1281 | .product-thumb-video iframe { |
1283 | width: 260px; | 1282 | width: 260px; |
1284 | height: auto; | 1283 | height: auto; |
frontend/web/js/basket.js
@@ -75,10 +75,13 @@ | @@ -75,10 +75,13 @@ | ||
75 | } | 75 | } |
76 | 76 | ||
77 | var sendformitems = function(w,form){ | 77 | var sendformitems = function(w,form){ |
78 | - data_form = $(form+' #basket_form2').serialize(); | 78 | + var data_form = $(form+' .basket_form2').serialize(); |
79 | + console.log(data_form); | ||
80 | + | ||
79 | $.ajax({ | 81 | $.ajax({ |
80 | type: 'POST', | 82 | type: 'POST', |
81 | url: "/basket/items/", | 83 | url: "/basket/items/", |
84 | + dataType: "json", | ||
82 | data: data_form, | 85 | data: data_form, |
83 | success: function(data) { | 86 | success: function(data) { |
84 | popup(w,form); | 87 | popup(w,form); |