Commit f145ede4c09878765850ed2239cd3b17abaa7b74

Authored by Karnovsky A
2 parents f307b0a8 e85a9a94

Merge remote-tracking branch 'origin/master'

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