_product.php
2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
use yii\helpers\Url;
?>
<div class="boxitem">
    <div class="pixbox">
        <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->imageAvator ?>" border="0"/>
        </a>
    </div>
    <a href="<?= Url::to([
        'products/show',
        'translit_rubric' => $item->catalog->translit,
        'translit' => $item->translit,
        'id' => $item->id])
    ?>" class="name"><?= $item->name ?>
    </a>
<?php
    echo '<div class="cost-block">';
    // есть скидка
    if ($item->costMax->old_cost != 0 && $item->costMax->old_cost != $item->costMax->cost)
    {
        // одинаковая скидка
        if ($item->costMax->count_diff == 1)
        {
            echo '<strike><span id=\'old_cost\'>'.$item->costMax->old_cost.'</span> грн.</strike>';
        }
    }
    echo '<p class="cost">'.$item->costMax->cost.'  грн.</p>';
    echo '</div>';
?>
</div>
    <a href="<?= Url::to([
        'products/show',
        'translit_rubric' => $item->catalog->translit,
        'translit' => $item->translit,
        'id' => $item->id])
    ?>" class="link_buy">Купить</a>
<div class="mycarousel">
    <ul class="jcarousel jcarousel-skin-tango">
        <?php foreach ($item->mods as $mods) { ?>
            <li>
                <a href="<?= Url::to([
                    'products/show',
                    'translit_rubric' => $item->catalog->translit,
                    'translit' => $item->translit,
                    'id' => $item->id,
                    '#' => 'm' . $mods->id]) ?>">
                    <img src="<?= Yii::$app->request->baseUrl . '/upload/mod/ico/' . $mods->imageAvator ?>" width="40"
                        height="40" alt="<?= $mods->name ?>"/>
                </a>
            </li>
        <?php } ?>
    </ul>
</div>