Exemplo n.º 1
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use app\components\Helpers;
$this->title = 'Sản phẩm';
$this->params['breadcrumbs'][] = $this->title;
?>
<div id="product-list">

    <p class="text-right"><?php 
echo Html::a('Tạo mới', ['create'], ['class' => 'btn btn-success']);
?>
</p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'summary' => '', 'tableOptions' => ['class' => 'table table-striped table-bordered table-hover'], 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'name', ['attribute' => 'thumbnail', 'format' => 'image', 'contentOptions' => ['class' => 'thumbnail-list']], ['attribute' => 'pro_id', 'value' => function ($model) {
    return $model->producer->name;
}], ['attribute' => 'cate_id', 'value' => function ($model) {
    return $model->category->name;
}], ['attribute' => 'price', 'value' => function ($model) {
    return Helpers::formatPrice($model->price);
}], ['attribute' => 'status', 'value' => function ($model) {
    return $model->getStatusLabel($model->status);
}], ['class' => 'yii\\grid\\ActionColumn', 'contentOptions' => ['class' => 'text-center'], 'template' => '{update} {delete} {thumbnail}', 'header' => 'Tùy chọn', 'headerOptions' => ['class' => 'text-center'], 'buttons' => ['thumbnail' => function ($url, $model, $key) {
    return Html::a('<i class="fa fa-picture-o"></i>', ['thumbnail/list', 'product_id' => $key], ['title' => 'Danh sách hình']);
}]]]]);
?>

</div>
Exemplo n.º 2
0
" class="product thumbnail">
            <img src="<?php 
    echo $product['thumbnail'];
    ?>
" alt="<?php 
    echo $product['name'];
    ?>
">
            <div class="cat"><?php 
    echo $product->category->name;
    ?>
</div>
            <div class="title"><?php 
    echo $product['name'];
    ?>
</div>
            <div class="price text-bold"><?php 
    echo Helpers::formatPrice($product['price']);
    ?>
</div>
        </a>
    </div>
    <?php 
}
?>
</div>
<div class="text-right">
<?php 
echo \yii\widgets\LinkPager::widget(['pagination' => $pagination]);
?>
</div>
Exemplo n.º 3
0
                                <?php 
}
?>
                            </ul>
                        </div>
                        <div class="info pull-left text-black">
                            <div class="text-uppercase"><?php 
echo $product->sku;
?>
</div>
                            <p class="text-uppercase"><?php 
echo $product->name;
?>
</p>
                            <div class="price text-bold"><?php 
echo Helpers::formatPrice($product->price);
?>
</div>
                            <table class="option">
                                <tr>
                                    <td class="quantity">
                                        <button class="down"><i class="fa fa-caret-left"></i></button>
                                        <span>1</span>
                                        <button class="up"><i class="fa fa-caret-right"></i></button>
                                    </td>
                                    <td>Màu sắc: <i class="fa fa-square" style="color: teal"></i></td>
                                    <td>Size: L</td>
                                </tr>
                            </table>
                            <button class="add-to-cart">
                                <i class="fa fa-cart-plus text-24"></i>