title = 'Заказ #' . $model->id; $this->params[ 'breadcrumbs' ][] = [ 'label' => \Yii::t('app', 'Заказы'), 'url' => [ 'index' ], ]; $this->params[ 'breadcrumbs' ][] = $this->title; if (empty($model->payment)) { $payment = ''; } elseif ($model->payment == 10) { $payment = Html::tag('h4', $model->orderPayment->lang->title, [ 'class' => 'text-navy' ]) . Html::beginTag( 'table', [ 'class' => 'table table-bordered' ] ) . Html::tag( 'tr', Html::tag('td', $model->getAttributeLabel('credit_sum')) . Html::tag( 'td', CreditHelper::checkSum( $model->credit_sum ) ) ) . Html::tag( 'tr', Html::tag('td', $model->getAttributeLabel('credit_month')) . Html::tag( 'td', CreditHelper::checkMonth( $model->credit_month ) ) ) . Html::tag( 'tr', Html::tag('td', 'Кредит') . Html::tag('td', $model->total - $model->credit_sum) ) . Html::tag( 'tr', Html::tag('td', 'Оплата в месяц') . Html::tag( 'td', CreditHelper::getCredit( $model->total - $model->credit_sum, $model->credit_month ) . ' грн/мес' ) ) . Html::endTag('table'); } else { $payment = $model->orderPayment->lang->title; } $js = <<< JS $('[data-toggle="popover"]').popover(); JS; $this->registerJs($js, View::POS_READY); ?>

title) ?>

$model->id, ], [ 'class' => 'btn btn-primary' ] ) ?> $model->id, ], [ 'class' => 'btn bg-orange' ] ) ?>

Данные заказа

$model, 'attributes' => [ 'id', 'deadline', 'pay', [ 'label' => 'Причина', 'value' => empty($model->reason) ? '' : Order::REASONS[ $model->reason ], ], [ 'label' => 'Статус', 'value' => empty($model->label) ? '' : $model->orderLabel->lang->title, ], 'name', 'phone', 'email', 'comment', [ 'label' => 'Способ доставки', 'value' => empty($model->delivery) ? '' : $model->orderDelivery->lang->title, ], 'declaration', 'stock', [ 'label' => 'Способ оплаты', 'value' => $payment, 'format' => 'html', ], 'insurance', 'city', 'adress', 'body', 'check', 'sms', ], ] ) ?>

Товары

$products, 'columns' => [ [ 'class' => SerialColumn::className(), ], 'sku', [ 'attribute' => 'product_name', 'content' => function (OrderProduct $model) { if (!empty( $model->product_name )) { if (empty( $model->productVariant )) { return ''; } return Html::a( StringHelper::truncate($model->product_name, 10, '...'), '#', [ 'onclick' => 'event.preventDefault();', 'data-toggle' => 'popover', 'data-placement' => 'right', 'data-html' => 'true', 'data-content' => Html::img( $model->productVariant->imageUrl, [ 'class' => 'img-rounded', ] ) . Html::tag('p', $model->product_name), ] ); } else { return ''; } }, ], [ 'attribute' => 'productVariant.product.brand.lang.title', 'label' => 'Брэнд', ], [ 'attribute' => 'productVariant.lang.title', 'label' => \Yii::t('app', 'Цвет'), 'content' => function (OrderProduct $model) { if (empty( $model->productVariant )) { return ''; } if (preg_match('@.*\.(png|jpg|gif)@i', $model->productVariant->lang->title)) { return ''; } else { return $model->productVariant->lang->title; } }, ], [ 'attribute' => 'productVariant.size', 'label' => 'Размер', ], 'price', 'count', 'sum_cost', 'booking', 'status', 'return', [ 'content' => function (OrderProduct $model) { if (empty( $model->productVariant )) { return ''; } $content = ''; foreach ($model->productVariant->variantStocks as $stock) { $content .= ''; } return Html::a( '', '#', [ 'onclick' => 'event.preventDefault();', 'data-toggle' => 'popover', 'data-placement' => 'left', 'data-html' => 'true', 'data-content' => $content . '
Складкол.
' . $stock->stock->title . '' . $stock->quantity . '
', ] ); }, ], ], ] ); ?>

История

$historyData, 'layout' => '{items}', 'itemView' => '_timeline_item', 'itemOptions' => [ 'tag' => false, ], 'options' => [ 'tag' => $historyData->totalCount == 0 ? 'div' : 'ul', 'class' => $historyData->totalCount == 0 ? 'list-view' : 'list-view timeline', ], 'emptyText' => 'У этого заказа пока нет истории', 'emptyTextOptions' => [ 'class' => 'callout callout-info', ], ] ); ?>