Пример #1
0
use app\modules\user\models\Country;
use app\modules\user\models\User;
use app\widgets\BackLink;
use app\widgets\EntityDropDown;
use yii\bootstrap\ActiveForm;
use yii\bootstrap\Nav;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\redactor\widgets\Redactor;
use yii\web\View;
/**
 * @var View $this
 * @var Product $model
 */
$items = [['label' => BackLink::widget(['title' => Yii::t('app', 'Orders'), 'textOnly' => true]), 'url' => Url::to(['/admin/order/list'])]];
if (!$model->isNewRecord) {
    $items[] = ['label' => Yii::t('app', 'View items'), 'url' => Url::to(['/admin/order-items/list', 'node' => $model->id])];
}
$items[count($items) - 1]['active'] = true;
echo Nav::widget(['encodeLabels' => false, 'items' => $items, 'options' => ['class' => 'nav-pills']]);
?>

<div class="order-form">
    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'currency_code')->widget(EntityDropDown::className(), ['items' => ArrayHelper::map(Currency::find()->all(), 'code', 'name')]);
?>
Пример #2
0
<?php

use app\models\Category;
use app\modules\admin\models\ProductSearch;
use app\widgets\BackLink;
use app\widgets\EntityDropDown;
use yii\bootstrap\Nav;
use yii\data\ActiveDataProvider;
use yii\grid\GridView;
use yii\helpers\Url;
/**
 * @var ProductSearch $searchModel
 * @var ActiveDataProvider $dataProvider
 * @var Category $category
 */
$this->title = Yii::t('app', 'Products');
echo Nav::widget(['encodeLabels' => false, 'items' => [['label' => BackLink::widget(['title' => Yii::t('app', 'Categories'), 'textOnly' => true]), 'url' => Url::to(['/admin/category/list', 'node' => $category->id])], ['label' => $category->name, 'url' => Url::to(), 'active' => true], ['label' => Yii::t('app', 'Create'), 'url' => Url::to(['/admin/product/create', 'node' => $category->id])]], 'options' => ['class' => 'nav-pills']]);
echo GridView::widget(['filterModel' => $searchModel, 'dataProvider' => $dataProvider, 'columns' => [['attribute' => 'id', 'filter' => false], 'slug', ['attribute' => 'name', 'format' => 'text'], ['attribute' => 'status', 'filter' => EntityDropDown::widget(['model' => $searchModel, 'attribute' => 'status', 'items' => [Yii::t('app', 'No'), Yii::t('app', 'Yes')]]), 'value' => function ($data) {
    return $data->status ? Yii::t('app', 'Yes') : Yii::t('app', 'No');
}], 'price', ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}']]]);
Пример #3
0
">
                    <?php 
    echo Html::img($product->thumb(64, 64));
    ?>
                </a>
            </td>
            <td><?php 
    echo Html::a($product->name, ['/product/view', 'slug' => $product->slug]);
    ?>
</td>
            <td><?php 
    echo CurrencyHelper::format($line->price, $order->currency_code, false);
    ?>
</td>
            <td><?php 
    echo $line->quantity;
    ?>
</td>
            <td><?php 
    echo CurrencyHelper::format($line->subtotal, $order->currency_code, false);
    ?>
</td>
        </tr>
    <?php 
}
?>
    </tbody>
</table>
<?php 
echo BackLink::widget(['title' => Yii::t('app', 'Order list'), 'url' => ['/checkout/order/list'], 'options' => ['class' => 'btn btn-primary']]);
Пример #4
0
</td>
                <td><?php 
    echo Yii::$app->formatter->asDatetime($order->created_at);
    ?>
</td>
                <td><?php 
    echo $order->getStatusText();
    ?>
</td>
                <td><?php 
    echo Html::a(Yii::t('app', 'Details'), ['/checkout/order/view', 'token' => $order->token], ['class' => 'btn btn-default']);
    ?>
</td>
            </tr>
        <?php 
}
?>
    </tbody>
</table>
<?php 
if (isset($pager)) {
    ?>
    <div align="right">
        <?php 
    echo $pager;
    ?>
    </div>
<?php 
}
echo BackLink::widget(['title' => Yii::t('app', 'My account'), 'url' => ['/user/account/details'], 'options' => ['class' => 'btn btn-primary']]);
Пример #5
0
<?php

use app\models\Comment;
use app\models\Product;
use app\modules\user\models\User;
use app\widgets\BackLink;
use app\widgets\EntityDropDown;
use app\widgets\Rating;
use yii\bootstrap\ActiveForm;
use yii\bootstrap\Html;
use yii\bootstrap\Nav;
use yii\helpers\Url;
/** @var Comment $model */
$this->title = Yii::t('app', 'Update a comment: ' . $model->id . ' (' . Product::findOne($model->product_id)->name) . ' - ' . User::findOne($model->user_id)->name . ')';
echo Nav::widget(['encodeLabels' => false, 'items' => [['label' => BackLink::widget(['title' => Yii::t('app', 'Comments'), 'textOnly' => true]), 'url' => Url::to(['/admin/comment/list']), 'active' => true]], 'options' => ['class' => 'nav-pills']]);
?>

<div class="comment-form">
    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'product_id')->hiddenInput()->label(false);
?>

    <?php 
echo $form->field($model, 'user_id')->hiddenInput()->label(false);
?>

    <?php 
Пример #6
0
use app\modules\admin\models\AddProductForm;
use app\modules\checkout\models\Order;
use app\widgets\BackLink;
use app\widgets\Nav;
use yii\bootstrap\ActiveForm;
use yii\bootstrap\Html;
use yii\data\ArrayDataProvider;
use yii\grid\GridView;
use yii\helpers\Url;
/**
 * @var Order $order
 * @var AddProductForm $newProduct
 */
$this->title = Yii::t('app', 'Order items');
$items = $order->orderLines;
echo Nav::widget(['encodeLabels' => false, 'items' => [['label' => BackLink::widget(['title' => Yii::t('app', 'Order'), 'textOnly' => true]), 'url' => Url::to(['/admin/order/update', 'id' => $order->id]), 'active' => true]], 'options' => ['class' => 'nav-pills']]);
?>

<h3><?php 
echo Yii::t('app', 'Info');
?>
</h3>
<table class="table table-bordered table-striped">
    <tr>
        <th><?php 
echo Yii::t('app', 'ID');
?>
</th>
        <td><?php 
echo $order->id;
?>