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 14 $this->registerJsFile(Yii::$app->request->baseUrl.'/js/jquery.mask.js',['position'=>View::POS_HEAD,'depends'=>['yii\web\YiiAsset']]);
15 15  
16 16 $this->registerJs("
17   -$('#order-phone,#order-phone2').mask('(000) 000-0000');
  17 +$('#orders-phone,#orders-phone2').mask('(000) 000-0000');
18 18 ", View::POS_READY, 'mask');
19 19  
20 20  
21 21 $this->registerJs("
22   -$('#order-delivery input[type=\"radio\"]').click(function(){
  22 +$('#orders-delivery input[type=\"radio\"]').click(function(){
23 23 $('.delivery-data').hide();
24 24 $('#delivery-data-'+$(this).val()).show();
25 25 });
... ... @@ -51,25 +51,24 @@ $('#order-delivery input[type=\"radio\"]').click(function(){
51 51 <?php echo $form->field($modelOrder,'adress'); ?>
52 52 <?php echo $form->field($modelOrder,'email'); ?>
53 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 56 <div class="both"></div>
66 57  
67 58 <?php foreach(Delivery::find()->where(['parent_id'=>0])->all() as $item):?>
68 59 <div class='delivery-data' id='delivery-data-<?=$item->id?>'>
69 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 72 </div>
74 73  
75 74 <?php endforeach;?>
... ...