_product_view.php 2.38 KB
<?php
    /**
     * Created by PhpStorm.
     * User: timur
     * Date: 29.05.18
     * Time: 3:32
     */
    
    /**
     * @var \app\models\Products $item
     */

    use yii\helpers\Url;
    
?>

<li class="product_item">
    
    <div class="status_items-wr">
        <!--порядок вывода если несколько статусов оставить как тут-->
        <? if ($item->new == 1): ?>
            <div><p class="staus_new">Новинка<span></span></p></div>
        <? endif; ?>
        <? if ($item->akciya == 1): ?>
            <div><p class="staus_sale">Акция<span></span></p></div>
        <? endif; ?>
        <? if ($item->top == 1): ?>
            <div><p class="staus_hit">Топ<span></span></p></div>
        <? endif; ?>
        <!-- ------------------------------- -->
    </div>
    
    <!--          <div>-->
    <!--            <div class="p_new"></div>-->
    <!--            <div class="p_top"></div>-->
    <!--            <div class="p_action"></div>-->
    <!--          </div>-->
    
    <a href="<?= Url::to(
        [
            'products/show',
            'translit_rubric' => $item->catalog->translit,
            'translit'        => $item->translit,
            'id'              => $item->id,
        ]
    ) ?>"><img src="<?= Yii::$app->request->baseUrl . '/upload/products/ico/' . $item->image ?>" width="180" height="240" border="0"/></a>
    
    <?php
        if ($item->out_of_stock == 0) {
            echo "<div class=\"t_stock\">в наличии</div>";
        } else if ($item->out_of_stock == 1) {
            echo "<div class=\"t_stock t_no_stock\">нет в наличии</div>";
        }
    ?>
    
    <p class="rubric"><?= $item->catalog->name ?></p>
    <a href="<?= Url::to(
        [
            'products/show',
            'translit_rubric' => $item->catalog->translit,
            'translit'        => $item->translit,
            'id'              => $item->id,
        ]
    ) ?>" class="name"><?= $item->name ?></a>
    <div class="cost">цена <?= $item->cost->cost ?> грн</div>
    <a
        href="<?= Url::to(
            [
                'products/show',
                'translit_rubric' => $item->catalog->translit,
                'translit'        => $item->translit,
                'id'              => $item->id,
            ]
        ) ?>"
        class="buy t_buy_btn"
    >
        Купить
    </a>
</li>