_basket.php 4.1 KB
Newer Older
Яков's avatar
first  
Яков committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<div class="max_width">
    <div class="truecount" <?php echo (count($offers) > 0  ? '' : 'style="display: none"') ?> >
        <table class="basket_offers_table to_div" width="100%" cellpadding="0" cellspacing="0">
            <thead>
            <tr>
                <th><?php echo __('Наименование');?></th>
                <th></th>
                <th><?php echo __('Количество');?></th>
                <th><?php echo __('Цена');?></th>
                <th><?php echo __('Сумма');?></th>
                <th><a onclick="basket.clean();event.stopPropagation();return false;" class="red_link bbs_d"><?php echo __('Очистить');?></a></th>
            </tr>
            </thead>
            <tbody valign="middle">
            <?php
            $productFreeShipping = 1;
            foreach ($offers as $offer){
                if ($offer['Product']['free_shipping'] == 0) {
                    $productFreeShipping = 0;
                }
Яков's avatar
two    
Яков committed
21
                //print_r($offer);
Яков's avatar
first  
Яков committed
22
23
24
25
26
27
28
29
30
31
32
                $quantity_type = $offer['Translation'][$culture]['quantity_type'];
                if ($offer['quantity_type_select']) {
                    $quantity_type = (isset(Offer::$quantity_type_select_values[$offer['quantity_type_select']]) ? Offer::$quantity_type_select_values[$offer['quantity_type_select']] : '');
                }
                echo '<tr>';
                $offer_img = $offer['img'];
                if(!$offer_img && $offer['Product']['product_img']){
                    $offer_imgs = explode(';', $offer['Product']['product_img']);
                    $offer_img = $offer_imgs[0];
                }
                //print_r($offer['Product']);
Яков's avatar
two    
Яков committed
33
                echo '<td valign="top"><a style="border: none" href="/' . $offer['Translation'][$culture]['lang'] . '/product/' . $offer['Product']['alias'] . '/"><div class="basket_img" ' . ($offer_img ? 'style="background-image: url(/u/i/' . Page::replaceImageSize($offer_img, 'S') . ');"' : '') . '></div></a>';
Яков's avatar
first  
Яков committed
34
35
36
37
38
39
40
                echo '<td><div class="basket_offer_title"><a href="/' . $offer['Translation'][$culture]['lang'] . '/product/' . $offer['Product']['alias'] . '/">' . $offer['Translation'][$culture]['title'] . '</a></div></td>';
                echo '</td>';
                echo '<td class="align_center"><div class="product_counter" data-id="' . $offer['id'] . '">';
                echo '<input type="button" class="product_counter_minus" data-symbol="-" onclick="counterLite.update($(this))">';
                echo '<input autocomplete="off" type="text" class="product_counter_val" value="' . $offer['BasketOffer'][0]['amount'] . '" data-symbol="false" onkeyup="counterLite.update($(this))">';
                echo '<input type="button" class="product_counter_plus" data-symbol="+" onclick="counterLite.update($(this))">';
                echo '</div><span class="name_unit">' . ($quantity_type != '' ? $quantity_type : '') . '</span></td>';
Яков's avatar
two    
Яков committed
41
42
                echo '<td valign="middle" class="basket_offers_table__price align_center">' . number_format($offer['price'], 0, ',', ' ') . '&nbsp;<span class="rub">i</span></td>';
                echo '<td valign="middle" class="basket_offers_table__price align_center">' . number_format($offer['BasketOffer'][0]['price'], 0, ',', ' ') . '&nbsp;<span class="rub">i</span></td>';
Яков's avatar
first  
Яков committed
43
44
45
46
47
48
                echo '<td width="1" align="center"><div class="basket_clean" onclick="basket.delete(this);"></div></td>';
                echo '</tr>';
            }
            ?>
            </tbody>
        </table>
Яков's avatar
two    
Яков committed
49
        <div class="basket_total" data-delivery-info="<?php echo $productFreeShipping ?>"><?php echo __('Итого');?>:<div class="basket_total__price"><?php echo number_format($info['price'], 0, ',', ' ');?></div>&nbsp;<span class="rub">i</span></div>
Яков's avatar
first  
Яков committed
50
51
52
53
54
55
56
57
58
59
    </div>
</div>

<div class="cart_empty"  <?php echo (count($offers) > 0 ? 'style="display: none"' : '' )?> >
    <p>Тут пока ничего нет. Посмотри в <a href="<?php echo url_for("@catalog"); ?>">каталоге</a>, там много интересного</p>
    <i class="br10"></i>
    <div class="cart_empty__img"></div>
    <i class="br40"></i>
</div>