Commit a4fcfb7f6358c59ff5ff8f2a7c061addb6841b44

Authored by Alex Savenko
2 parents 4ccf380f 137fb94f

Merge branch 'discount' of gitlab.artweb.com.ua:Alex/semena

src/app/frontend/controllers/PageController.php
... ... @@ -1031,10 +1031,8 @@
1031 1031 {
1032 1032 $item_id = $this->request->getPost( 'item_id', 'int', '' );
1033 1033 $group_alias = $this->request->getPost( 'group_alias', 'string', '' );
1034   -
1035 1034 $item = $this->models->getItems()->getOneItem( $this->lang_id, $item_id );
1036 1035 $filters = $this->models->getFilters()->getFiltersByItemId( $this->lang_id, $item_id );
1037   -
1038 1036 $colors_info = $this->models->getItems()->getColorsInfoByColorId( $this->lang_id, $item['0']['color_id'] );
1039 1037  
1040 1038 $item['0']['color_title'] = NULL;
... ... @@ -1052,11 +1050,10 @@
1052 1050 '<div class="float properties" style="color:'.$colors_info['0']['absolute_color'].'">'.$colors_info['0']['color_title'].'</div>';
1053 1051 }
1054 1052  
1055   - $item['0']['explode'] = explode( '/', $item['0']['full_alias'] );
1056   - $item['0']['type_alias'] = $item['0']['explode']['1'];
1057   - $item['0']['subtype_alias'] = $item['0']['explode']['2'];
1058   - unset( $item['0']['explode'] );
1059   -
  1053 + $item['0']['explode'] = explode( '/', $item['0']['full_alias'] );
  1054 + $item['0']['type_alias'] = $item['0']['explode']['1'];
  1055 + $item['0']['subtype_alias'] = $item['0']['explode']['2'];
  1056 + unset( $item['0']['explode'] );
1060 1057 $item['0']['alias'] = $this->url->get([ 'for' => 'item', 'type' => $item['0']['type_alias'], 'subtype' => $item['0']['subtype_alias'], 'group_alias' => $group_alias, 'item_id' => $item_id ]);
1061 1058 $item['0']['filters'] = $filters;
1062 1059 $item['0']['images'] = $this->etc->int2arr( $item['0']['photogallery'] );
... ...
src/app/frontend/views/page/changeWithSize.php
... ... @@ -9,13 +9,22 @@ if(isset($special_user)) {
9 9 $old_price = $data['price'];
10 10 $data['price'] = $data['price']*(1-$discount/100);
11 11 $data['price'] = number_format($data['price'], 2, '.', ' ');
12   -
13   -$data['html'] = '<div class="clearfix buy_compare">
14   - <div class="one_item_price float">'. $t->_("price") .
15   - ' <span style="text-decoration: line-through;"><span>' . $old_price . '</span> грн</span>
16   - <br/>
17   - <span>' . $data['price'] . '</span> грн
18   -';
  12 +if ($discount == 0) {
  13 + $data['html'] =
  14 + '<div class="clearfix buy_compare">
  15 + <div class="one_item_price float">'. $t->_("price") .
  16 + '<span>' . $data['price'] . '</span> грн
  17 + ';
  18 +}
  19 +else {
  20 + $data['html'] = '
  21 + <div class="clearfix buy_compare">
  22 + <div class="one_item_price float">'. $t->_("price") .
  23 + ' <span style="text-decoration: line-through;"><span>' . $old_price . '</span> грн</span>
  24 + <br/>
  25 + <span>' . $data['price'] . '</span> грн
  26 + ';
  27 +}
19 28  
20 29 $data['html'] .= '</ul></div><div data-group_id="' . $item['group_id'] .'" class="one_item_buttons float">';
21 30  
... ...