Example #1
0
?>
<div class="page-header">
    <h1>
        <?php 
echo Yii::t('StoreModule.store', 'Products');
?>
        <small><?php 
echo Yii::t('StoreModule.store', 'administration');
?>
</small>
    </h1>
</div>

<?php 
$this->widget('yupe\\widgets\\CustomGridView', ['id' => 'product-grid', 'sortableRows' => true, 'sortableAjaxSave' => true, 'sortableAttribute' => 'position', 'sortableAction' => '/store/productBackend/sortable', 'type' => 'condensed', 'dataProvider' => $model->search(), 'filter' => $model, 'actionsButtons' => ['add' => CHtml::link(Yii::t('StoreModule.store', 'Add'), ['/store/productBackend/create'], ['class' => 'btn btn-sm btn-success pull-right']), 'copy' => CHtml::link(Yii::t('StoreModule.store', 'Copy'), '#', ['id' => 'copy-products', 'class' => 'btn btn-sm btn-default pull-right', 'style' => 'margin-right: 4px;'])], 'columns' => [['type' => 'raw', 'value' => function ($data) {
    return CHtml::image(StoreImage::product($data, 40, 40), $data->name, ["width" => 40, "height" => 40, "class" => "img-thumbnail"]);
}], ['name' => 'name', 'type' => 'raw', 'value' => function ($data) {
    return CHtml::link(\yupe\helpers\YText::wordLimiter($data->name, 5), ["/store/productBackend/update", "id" => $data->id]);
}], ['class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'sku', 'editable' => ['emptytext' => '---', 'url' => $this->createUrl('/store/productBackend/inline'), 'mode' => 'inline', 'params' => [Yii::app()->getRequest()->csrfTokenName => Yii::app()->getRequest()->csrfToken]], 'filter' => CHtml::activeTextField($model, 'sku', ['class' => 'form-control'])], ['class' => 'yupe\\widgets\\EditableStatusColumn', 'name' => 'producer_id', 'url' => $this->createUrl('/store/productBackend/inline'), 'source' => CMap::mergeArray(['' => '---'], Producer::model()->getFormattedList()), 'editable' => ['emptytext' => '---']], ['name' => 'category_id', 'value' => function ($data) {
    $categoryList = '<span class="label label-primary">' . (isset($data->category) ? $data->category->name : '---') . '</span>';
    foreach ($data->categories as $category) {
        $categoryList .= '<br>' . $category->name;
    }
    return $categoryList;
}, 'type' => 'raw', 'filter' => CHtml::activeDropDownList($model, 'category_id', StoreCategoryHelper::formattedList(), ['encode' => false, 'empty' => '', 'class' => 'form-control']), 'htmlOptions' => ['width' => '220px']], ['class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'price', 'value' => function (Product $data) {
    return round($data->getBasePrice(), 2);
}, 'editable' => ['url' => $this->createUrl('/store/productBackend/inline'), 'mode' => 'inline', 'params' => [Yii::app()->getRequest()->csrfTokenName => Yii::app()->getRequest()->csrfToken]], 'filter' => CHtml::activeTextField($model, 'price', ['class' => 'form-control'])], ['class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'discount_price', 'header' => Yii::t('StoreModule.store', 'New price'), 'value' => function (Product $data) {
    return round($data->getDiscountPrice(), 2);
}, 'editable' => ['emptytext' => '---', 'url' => $this->createUrl('/store/productBackend/inline'), 'mode' => 'inline', 'params' => [Yii::app()->getRequest()->csrfTokenName => Yii::app()->getRequest()->csrfToken]], 'filter' => CHtml::activeTextField($model, 'discount_price', ['class' => 'form-control'])], ['class' => 'yupe\\widgets\\EditableStatusColumn', 'name' => 'in_stock', 'header' => Yii::t('StoreModule.store', 'Availability'), 'url' => $this->createUrl('/store/productBackend/inline'), 'source' => $model->getInStockList(), 'options' => [Product::STATUS_IN_STOCK => ['class' => 'label-success'], Product::STATUS_NOT_IN_STOCK => ['class' => 'label-danger']]], ['class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'quantity', 'value' => function (Product $data) {
    return $data->quantity;
}, 'header' => Yii::t('StoreModule.store', 'Rest'), 'editable' => ['url' => $this->createUrl('/store/productBackend/inline'), 'mode' => 'inline', 'params' => [Yii::app()->getRequest()->csrfTokenName => Yii::app()->getRequest()->csrfToken]], 'filter' => CHtml::activeTextField($model, 'price', ['class' => 'form-control'])], ['class' => 'yupe\\widgets\\EditableStatusColumn', 'name' => 'status', 'url' => $this->createUrl('/store/productBackend/inline'), 'source' => $model->getStatusList(), 'options' => [Product::STATUS_ACTIVE => ['class' => 'label-success'], Product::STATUS_NOT_ACTIVE => ['class' => 'label-info'], Product::STATUS_ZERO => ['class' => 'label-default']]], ['class' => 'yupe\\widgets\\CustomButtonColumn', 'buttons' => ['front_view' => ['visible' => function ($row, $data) {
Example #2
0
            </div>
            <div class="best-brands__body">
                <div class="grid">
                    <?php 
    foreach ($brands as $brand) {
        ?>
                        <div class="best-brands__item grid-module-2">
                            <a href="<?php 
        echo Yii::app()->createUrl('/store/producer/view', ['slug' => $brand->slug]);
        ?>
" title="<?php 
        echo $brand->name;
        ?>
">
                                <img src="<?php 
        echo StoreImage::producer($brand, 100, 100);
        ?>
" class="best-brands__img" alt="<?php 
        echo $brand->name;
        ?>
">
                            </a>
                        </div>
                    <?php 
    }
    ?>
                </div>
            </div>
        </div>
    </div>
<?php 
Example #3
0
<?php

$productUrl = Yii::app()->createUrl('/store/product/view', ['name' => CHtml::encode($data->slug)]);
$basePrice = (double) $data->getBasePrice();
?>
<div class="catalog__item">
    <article class="product-vertical">
        <a href="<?php 
echo $productUrl;
?>
">
            <div class="product-vertical__thumbnail">
                <img src="<?php 
echo StoreImage::product($data, 150, 280, false);
?>
" class="product-vertical__img" />
            </div>
        </a>
        <div class="product-vertical__content"><a href="<?php 
echo $productUrl;
?>
" class="product-vertical__title"><?php 
echo CHtml::encode($data->getName());
?>
</a>
            <div class="product-vertical__price">
                <div class="product-price"><?php 
echo $data->getResultPrice();
?>
<span class="ruble"> <?php 
echo Yii::t("StoreModule.store", Yii::app()->getModule('store')->currency);
Example #4
0
                    </div>
                    <?php 
if ($product->isSpecial()) {
    ?>
                        <div class="product-gallery__label">
                            <div class="product-label product-label_hit">
                                <div class="product-label__text">Хит</div>
                            </div>
                        </div>
                    <?php 
}
?>
                </div>
                <div class="product-gallery__nav">
                    <a href="<?php 
echo StoreImage::product($product);
?>
" rel="group" data-product-thumbnail
                       class="product-gallery__nav-item">
                        <img src="<?php 
echo $product->getImageUrl(60, 60, false);
?>
" alt=""
                             class="product-gallery__nav-img">
                    </a>
                    <?php 
foreach ($product->getImages() as $key => $image) {
    ?>
                        <a href="<?php 
    echo $image->getImageUrl();
    ?>
Example #5
0
                <div class="btn h-slider__control h-slider__prev js-slick__prev"></div>
            </div>
            <div class="h-slider__slides js-slick__container">
                <?php 
foreach ($products as $product) {
    ?>
                    <div class="h-slider__slide">
                        <div class="grid-module-4">
                            <div class="product-mini">
                                <div class="product-mini__thumbnail">
                                    <a href="<?php 
    echo ProductHelper::getUrl($product);
    ?>
">
                                        <img src="<?php 
    echo StoreImage::product($product, 92, 92, false);
    ?>
"
                                             class="product-mini__img"
                                             alt="<?php 
    echo CHtml::encode($product->getImageAlt());
    ?>
"
                                             title="<?php 
    echo CHtml::encode($product->getImageTitle());
    ?>
"
                                            >
                                    </a>
                                </div>
                                <div class="product-mini__info">
Example #6
0
File: view.php Project: yupe/yupe
    ?>
</price>
                <oldprice><?php 
    echo $offer->getBasePrice();
    ?>
</oldprice>
                <currencyId><?php 
    echo Yii::app()->getModule('store')->currency;
    ?>
</currencyId>
                <categoryId><?php 
    echo $offer->category_id;
    ?>
</categoryId>
                <picture><?php 
    echo StoreImage::product($offer);
    ?>
</picture>
                <name><?php 
    echo htmlspecialchars(strip_tags($offer->name));
    ?>
</name>
                <model><?php 
    echo htmlspecialchars(strip_tags($offer->name));
    ?>
</model>
                <vendor><?php 
    echo htmlspecialchars(strip_tags($offer->producer->name));
    ?>
</vendor>
                <description><?php 
Example #7
0
File: index.php Project: yupe/yupe
$this->breadcrumbs = [Yii::t('StoreModule.store', 'Producers') => ['/store/producerBackend/index'], Yii::t('StoreModule.store', 'Manage')];
$this->pageTitle = Yii::t('StoreModule.store', 'Producers - manage');
$this->menu = [['icon' => 'fa fa-fw fa-list-alt', 'label' => Yii::t('StoreModule.store', 'Manage producers'), 'url' => ['/store/producerBackend/index']], ['icon' => 'fa fa-fw fa-plus-square', 'label' => Yii::t('StoreModule.store', 'Create producer'), 'url' => ['/store/producerBackend/create']]];
?>
<div class="page-header">
    <h1>
        <?php 
echo Yii::t('StoreModule.store', 'Producers');
?>
        <small><?php 
echo Yii::t('StoreModule.store', 'administration');
?>
</small>
    </h1>
</div>

<?php 
$this->widget('yupe\\widgets\\CustomGridView', ['id' => 'producer-grid', 'sortableRows' => true, 'sortableAjaxSave' => true, 'sortableAttribute' => 'sort', 'sortableAction' => '/store/producerBackend/sortable', 'type' => 'condensed', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => [['name' => 'image', 'type' => 'raw', 'value' => function ($data) {
    return CHtml::image(StoreImage::producer($data, 40, 40), $data->name, ['width' => 40, 'height' => 40, 'class' => 'img-thumbnail']);
}, 'filter' => false], ['name' => 'name', 'type' => 'raw', 'value' => function ($data) {
    return CHtml::link($data->name, ['/store/producerBackend/update', 'id' => $data->id]);
}], ['name' => 'name_short', 'type' => 'raw', 'value' => function ($data) {
    return CHtml::link($data->name_short, ['/store/producerBackend/update', 'id' => $data->id]);
}], ['class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'slug', 'editable' => ['url' => $this->createUrl('/store/producerBackend/inline'), 'mode' => 'inline', 'params' => [Yii::app()->getRequest()->csrfTokenName => Yii::app()->request->csrfToken]], 'filter' => CHtml::activeTextField($model, 'slug', ['class' => 'form-control'])], ['class' => 'yupe\\widgets\\EditableStatusColumn', 'name' => 'status', 'url' => $this->createUrl('/store/producerBackend/inline'), 'source' => $model->getStatusList(), 'options' => [Producer::STATUS_ACTIVE => ['class' => 'label-success'], Producer::STATUS_NOT_ACTIVE => ['class' => 'label-info'], Producer::STATUS_ZERO => ['class' => 'label-default']]], ['header' => Yii::t('StoreModule.store', 'Products'), 'value' => function ($data) {
    return CHtml::link($data->productCount, ['/store/productBackend/index', 'Product[producer_id]' => $data->id], ['class' => 'badge']);
}, 'type' => 'raw'], ['class' => 'yupe\\widgets\\CustomButtonColumn', 'frontViewButtonUrl' => function ($data) {
    return Yii::app()->createUrl('/store/producer/view', ['slug' => $data->slug]);
}, 'buttons' => ['front_view' => ['visible' => function ($row, $data) {
    return $data->status == Producer::STATUS_ACTIVE;
}]]]]]);
Example #8
0
File: _item.php Project: yupe/yupe
<?php

/**
 * @var Product $product
 */
?>
<div class="h-slider__slide js-overlay-item">
    <div class="grid-module-3">
        <article class="product-vertical">
            <a href="<?php 
echo ProductHelper::getUrl($product);
?>
">
                <div class="product-vertical__thumbnail">
                    <img src="<?php 
echo StoreImage::product($product, 150, 280, false);
?>
"
                         class="product-vertical__img"
                         alt="<?php 
echo CHtml::encode($product->getImageAlt());
?>
"
                         title="<?php 
echo CHtml::encode($product->getImageTitle());
?>
"
                    />
                </div>
            </a>
            <div class="product-vertical__content"><a href="<?php