Commit 3af3ecb372dc680c9d6a37980bb3b0e5a841a569

Authored by Administrator
1 parent 6a42c489

image size

Showing 1 changed file with 14 additions and 15 deletions   Show diff stats
frontend/views/basket/index.php
@@ -14,12 +14,12 @@ $this->registerMetaTag(['name' => 'keywords', 'content' => 'Корзина']); @@ -14,12 +14,12 @@ $this->registerMetaTag(['name' => 'keywords', 'content' => 'Корзина']);
14 $this->registerJsFile(Yii::$app->request->baseUrl.'/js/jquery.mask.js',['position'=>View::POS_HEAD,'depends'=>['yii\web\YiiAsset']]); 14 $this->registerJsFile(Yii::$app->request->baseUrl.'/js/jquery.mask.js',['position'=>View::POS_HEAD,'depends'=>['yii\web\YiiAsset']]);
15 15
16 $this->registerJs(" 16 $this->registerJs("
17 -$('#order-phone,#order-phone2').mask('(000) 000-0000'); 17 +$('#orders-phone,#orders-phone2').mask('(000) 000-0000');
18 ", View::POS_READY, 'mask'); 18 ", View::POS_READY, 'mask');
19 19
20 20
21 $this->registerJs(" 21 $this->registerJs("
22 -$('#order-delivery input[type=\"radio\"]').click(function(){ 22 +$('#orders-delivery input[type=\"radio\"]').click(function(){
23 $('.delivery-data').hide(); 23 $('.delivery-data').hide();
24 $('#delivery-data-'+$(this).val()).show(); 24 $('#delivery-data-'+$(this).val()).show();
25 }); 25 });
@@ -51,25 +51,24 @@ $('#order-delivery input[type=\"radio\"]').click(function(){ @@ -51,25 +51,24 @@ $('#order-delivery input[type=\"radio\"]').click(function(){
51 <?php echo $form->field($modelOrder,'adress'); ?> 51 <?php echo $form->field($modelOrder,'adress'); ?>
52 <?php echo $form->field($modelOrder,'email'); ?> 52 <?php echo $form->field($modelOrder,'email'); ?>
53 <?= $form->field($modelOrder, 'delivery') 53 <?= $form->field($modelOrder, 'delivery')
54 - ->radioList(ArrayHelper::map(Delivery::find()->where(['parent_id'=>0])->asArray()->all(), 'id', 'title'), [  
55 - 'item' => function($index, $label, $name, $checked, $value) {  
56 - $return = '<div class="custom-form-buttons">';  
57 - $return .= '<input class="custom-radio" id="custom-radio-' . $value . '" ' . ( $checked ? "checked" : "" ) . ' type="radio" name="' . $name . '" value="' . $value . '" >';  
58 - $return .= '<label for="custom-radio-' . $value . '" ><span></span>' . $label . '</label>';  
59 - $return .= '</div>';  
60 - return $return;  
61 - },  
62 - ]); 54 + ->radioList(ArrayHelper::map(Delivery::find()->where(['parent_id'=>0])->asArray()->all(), 'id', 'title'))
63 ?> 55 ?>
64 -  
65 <div class="both"></div> 56 <div class="both"></div>
66 57
67 <?php foreach(Delivery::find()->where(['parent_id'=>0])->all() as $item):?> 58 <?php foreach(Delivery::find()->where(['parent_id'=>0])->all() as $item):?>
68 <div class='delivery-data' id='delivery-data-<?=$item->id?>'> 59 <div class='delivery-data' id='delivery-data-<?=$item->id?>'>
69 <?=$item->text?> 60 <?=$item->text?>
70 - <?= $form->field($modelOrder, 'delivery')  
71 - ->radioList(ArrayHelper::map(Delivery::find()->where(['parent_id'=>$item->id])->asArray()->all(), 'id', 'title'),['id' => 'order-delivery-childs'])->label(false)  
72 - ?> 61 + <?= $form->field($modelOrder, 'delivery')
  62 + ->radioList(ArrayHelper::map(Delivery::find()->where(['parent_id'=>0])->asArray()->all(), 'id', 'title'), [
  63 + 'item' => function($index, $label, $name, $checked, $value) {
  64 + $return = '<div class="custom-form-buttons">';
  65 + $return .= '<input class="custom-radio" id="custom-radio-' . $value . '" ' . ( $checked ? "checked" : "" ) . ' type="radio" name="' . $name . '" value="' . $value . '" >';
  66 + $return .= '<label for="custom-radio-' . $value . '" ><span></span>' . $label . '</label>';
  67 + $return .= '</div>';
  68 + return $return;
  69 + },
  70 + ]);
  71 + ?>
73 </div> 72 </div>
74 73
75 <?php endforeach;?> 74 <?php endforeach;?>