<?php
/** @var \common\modules\product\models\Product $product */
use yii\helpers\Url;
?>
<div class="item">
    <div class="boxitem">
        <div class="pixbox">
            <a href="<?= Url::to([
                'catalog/product',
                'product' => $product,
                '#' => 'm' .$product->enabledVariants[0]->product_variant_id])
            ?>">
                <?= \common\components\artboximage\ArtboxImageHelper::getImage($product->enabledVariants[0]->imageUrl, 'list')?>
            </a>
        </div>
        <?php if(!empty($product->is_top) || !empty($product->is_new) || !empty($product->akciya)) :?>
            <ul class="product-special">
                <?php if(!empty($product->is_top)) :?>
                    <li class="top"><div>top</div></li>
                <?php endif?>
                <?php if(!empty($product->is_new)) :?>
                    <li class="new"><div>new</div></li>
                <?php endif?>
                <?php if(!empty($product->akciya)) :?>
                    <li class="promo"><div>promo</div></li>
                <?php endif?>
            </ul>
        <?php endif?>
        <a href="<?= Url::to([
            'catalog/product',
            'product' => $product])
        ?>" class="name"><?= $product->name ?>
        </a>

        <div class="cost-block">
            <p class="cost">
            <?php if ($product->enabledVariants[0]->price_old != 0 && $product->enabledVariants[0]->price_old != $product->enabledVariants[0]->price) :?>
                <strike><span id="old_cost"><?= $product->enabledVariants[0]->price_old ?></span> грн.</strike>&nbsp;
            <?php endif?>
            <?= $product->enabledVariants[0]->price?> <span>грн.</span></p>
        </div>
    </div>

    <a href="<?= Url::to([
        'catalog/product',
        'product' => $product,
        '#' => 'm' .$product->enabledVariants[0]->product_variant_id])
    ?>" class="link_buy">Купить</a>

    <div class="mycarousel">
        <ul class="jcarousel jcarousel-skin-tango">
            <?php foreach ($product->enabledVariants as $variant) : ?>
            <li>
                <a href="<?= Url::to([
                    'catalog/product',
                    'product' => $product,
                    '#' => 'm' . $variant->product_variant_id]) ?>">
                    <?= \common\components\artboximage\ArtboxImageHelper::getImage($variant->imageUrl, 'product_variant')?>
                </a>
            </li>
            <?php endforeach; ?>
        </ul>
    </div>
</div>