<?php
use yii\web\View;
?>
<?php if(!empty($products)) :?>
<div class="<?= $class?>">
    <div class="content">
        <div class="title"><?= $title?></div>
        <div class="<?= $class?>_cont">
    <?php /** @var \common\modules\product\models\Product $product */?>
    <?php foreach($products as $product) :?>
            <div class="item" data-id="<?= $product->product_id?>">
                <?php if ($product->is_new) :?>
                <div class="new">Новинка</div>
                <?php endif?>
                <?php if ($product->is_top) :?>
                <div class="top">Toп</div>
                <?php endif?>
                <a href="<?= \yii\helpers\Url::to([
                    'catalog/product',
                    'product' => $product])
                ?>" class="item_link">
                    <div class="pic">
                        <?= \common\components\artboximage\ArtboxImageHelper::getImage($product->imageUrl, 'product_list')?>
                    </div>
                    <div class="title_item"><?= $product->name?></div>
                </a>
                <?php if ($product->brand) :?>
                <div class="brand">Бренд: <span><?= $product->brand->name?></span></div>
                <?php endif?>
                <div class="type"><?= implode(', ', $product->categoriesNames)?></div>
                <?php if($product->variant) :?>
                    <div class="price"><?= $product->variant->price?> <span>грн.</span></div>
                    <button class="basket_add_but" data-id="<?= $product->variant->product_variant_id?>">в корзину</button>
                <?php endif?>
                <!--<a href="#" class="compare_add_but" data-id="<?/*= $product->product_id*/?>"><span>добавить к сравнению</span></a>-->
            </div>
        <?php endforeach?>
            <div style="clear:both;"></div>
        </div>
    </div>
</div>
<?php endif?>