isNewRecord) { // echo $form->field($model, 'user_id') // ->textInput(); // } ?>
field($model, 'name') ->textInput([ 'maxlength' => true , 'value' => strip_tags($model->name)]) ?>
field($model, 'phone') ->textInput([ 'maxlength' => true ]) ?>
field($model, 'email') ->textInput([ 'maxlength' => true ]) ?>
field($model, 'city') ->textInput([ 'maxlength' => true ]) ?>
field($model, 'address') ->textInput([ 'maxlength' => true ]) ?>
field($model, 'comment') ->textarea() ?>
field($model, 'label_id') ->widget(Select2::className(),[ 'options' => [ 'placeholder' => \Yii::t('app', 'Выберите вариант метки'), ], 'data' => $labels, 'pluginOptions' => [ 'allowClear' => true, ], ]) ?>
field($model, 'delivery_id') ->widget(Select2::className(),[ 'options' => [ 'placeholder' => \Yii::t('app', 'Выберите вариант доставки'), ], 'data' => $deliveries, 'pluginOptions' => [ 'allowClear' => true, ], ]) ?>
field($model, 'payment_id') ->widget(Select2::className(),[ 'options' => [ 'placeholder' => \Yii::t('app', 'Выберите вариант оплаты'), ], 'data' => $payments, 'pluginOptions' => [ 'allowClear' => true, ], ]) ?>
'add-to-order', 'options' => [ 'placeholder' => \Yii::t('order', 'Select product'), ], 'pluginOptions' => [ 'allowClear' => true, 'minimumInputLength' => 3, 'language' => [ 'errorLoading' => new JsExpression( "function() {return '" . \Yii::t('order', 'Waiting for results') . "'; }" ), ], 'ajax' => [ 'url' => Url::to([ 'product-list' ]), 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term}; }'), ], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression('function(city) { return city.text; }'), 'templateSelection' => new JsExpression('function (city) { return city.text; }'), ], 'id' => 'add-to-order', ] ); ?>
КОЛ-ВО'; echo Html::textInput( 'count-to-order', 1, [ 'class' => 'form-control', 'id' => $idInput, ] ); ?>
isNewRecord) { foreach ($model->orderProducts as $index => $orderProduct) { $sum += ( $orderProduct->count * $orderProduct->price ); echo $this->render( '_order_product', [ 'orderProduct' => $orderProduct, 'price' => $orderProduct->price, 'index' => $index, 'variant' => $orderProduct->variant, 'form' => $form, ] ); } } ?>
Итого: " . $sum . "
" ); ?>
isNewRecord ? Yii::t('order', 'Create') : Yii::t('order', 'Update'), [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-success' ] ) ?>