product_smart.php 2.45 KB
<?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->variant->product_variant_id])
            ?>">
                <?= \common\components\artboximage\ArtboxImageHelper::getImage($product->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>

        <?php

        echo '<div class="cost-block">';
        echo '<p class="cost">';
        // есть скидка
        if ($product->variant->price_old != 0 && $product->variant->price_old != $product->variant->price)
        {
            echo '<strike><span id=\'old_cost\'>'.$product->variant->price_old.'</span> грн.</strike>&nbsp;';
        }

        echo $product->variant->price.' <span>грн.</span></p>';

        echo '</div>';

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

    <div class="mycarousel">
        <ul class="jcarousel jcarousel-skin-tango">
            <?php foreach ($product->variants 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>