Blame view

src/app/frontend/views/page/changeWithSize.php 2.42 KB
dce46e80   Alex Savenko   first push project
1
2
3
4
5
6
7
8
  <?php
  if(isset($special_user)) {
      $data['price'] = number_format(isset($item['prices'][$special_user['status']])
          ? $item['prices'][$special_user['status']]
          : $item['price2'], 2, '.', '');
  } else {
      $data['price'] = $item['price2'];
  }
3f8fb5b8   Alex Savenko   price display
9
  $old_price = $data['price'];
c784a5c9   Alex Savenko   price display
10
  $data['price'] = $data['price']*(1-$discount/100);
9a8fc30a   Alex Savenko   price display
11
  $data['price'] = number_format($data['price'], 2, '.', ' ');
3b3559e1   Alex Savenko   price display
12
  
dce46e80   Alex Savenko   first push project
13
14
  $data['html'] = '<div class="clearfix buy_compare">
                      <div class="one_item_price float">'. $t->_("price") .
09bc72b1   Alex Savenko   price display
15
      ' <span style="text-decoration: line-through;"><span>' . $old_price . '</span> грн</span>
3f8fb5b8   Alex Savenko   price display
16
17
18
       <br/>
       <span>' . $data['price'] . '</span> грн
  ';
dce46e80   Alex Savenko   first push project
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
  
  $data['html'] .= '</ul></div><div data-group_id="' . $item['group_id'] .'" class="one_item_buttons float">';
  
  $data['html'] .= '<a data-group_id="' . $item['group_id'] .'" href="javascript:;" title="" class="';
  
  if($item['status_real'] == 1) {
      $data['html'] .= 'btn green buy';
  } else {
      $data['html'] .= 'not_available grey';
  }
  $data['html'] .= '">' . $t->_("buy") . '</a>';
  
  $data['html'] .= '</div><div class="one_item_compare float">' .
  '<input type="checkbox" id="compare_item_' . $item['id'] . '" value="' . $item['type'] . '-'. $item['catalog'] . '-' . $item['id'] . '" />' .
  '<label for="compare_item_'. $item['id'] .'"><span></span>' . $t->_("compared_to") . '</label>' .
  '<input type="hidden" class="item_id_for_basket" value="'. $item['id'] .'">' .
  '<input type="hidden" class="current_item_size" value="'. $item['size'] .'">' .
  '</div>' .
  '</div>' .
  '<div class="clearfix features">';
  
  
  foreach($item['filters'] as $v) {
      $data['html'] .= '<a href="#" class="float">' . $v['value_value'] . '</a>';
  }
  
  $data['image'] = $item['image'];
  $data['status'] = $item['status'];
  $data['product_id'] = $item['product_id'];
  $data['color'] = $item['color'];
  $data['group_id'] = $item['group_id'];
  
  if(!empty($item['prices'][0])) {
      $data['recommended_prices']['name'] = $t->_('recommended_prices');
      $data['recommended_prices']['stock_availability'] = $item['stock_availability'];
      $data['recommended_prices']['firm'] = $item['firm'];
      $data['recommended_prices']['firm_product'] = $t->_('firm_product');
      for($i = 0; $i < $special_user['status']; $i++) {
          $data['recommended_prices']['dealer'][$i]['dealer_price'] = $item['prices'][$i];
          $data['recommended_prices']['dealer'][$i]['dealer_name'] = $special_users[$i]['title'];
      }
  }
  
dce46e80   Alex Savenko   first push project
62
  echo json_encode($data);