Commit 137fb94f415cc68ac12ddb31cfd6da84212780ad

Authored by Alex Savenko
1 parent 651af250

price display item

src/app/frontend/controllers/PageController.php
@@ -1030,10 +1030,8 @@ @@ -1030,10 +1030,8 @@
1030 { 1030 {
1031 $item_id = $this->request->getPost( 'item_id', 'int', '' ); 1031 $item_id = $this->request->getPost( 'item_id', 'int', '' );
1032 $group_alias = $this->request->getPost( 'group_alias', 'string', '' ); 1032 $group_alias = $this->request->getPost( 'group_alias', 'string', '' );
1033 -  
1034 $item = $this->models->getItems()->getOneItem( $this->lang_id, $item_id ); 1033 $item = $this->models->getItems()->getOneItem( $this->lang_id, $item_id );
1035 $filters = $this->models->getFilters()->getFiltersByItemId( $this->lang_id, $item_id ); 1034 $filters = $this->models->getFilters()->getFiltersByItemId( $this->lang_id, $item_id );
1036 -  
1037 $colors_info = $this->models->getItems()->getColorsInfoByColorId( $this->lang_id, $item['0']['color_id'] ); 1035 $colors_info = $this->models->getItems()->getColorsInfoByColorId( $this->lang_id, $item['0']['color_id'] );
1038 1036
1039 $item['0']['color_title'] = NULL; 1037 $item['0']['color_title'] = NULL;
@@ -1051,11 +1049,10 @@ @@ -1051,11 +1049,10 @@
1051 '<div class="float properties" style="color:'.$colors_info['0']['absolute_color'].'">'.$colors_info['0']['color_title'].'</div>'; 1049 '<div class="float properties" style="color:'.$colors_info['0']['absolute_color'].'">'.$colors_info['0']['color_title'].'</div>';
1052 } 1050 }
1053 1051
1054 - $item['0']['explode'] = explode( '/', $item['0']['full_alias'] );  
1055 - $item['0']['type_alias'] = $item['0']['explode']['1'];  
1056 - $item['0']['subtype_alias'] = $item['0']['explode']['2'];  
1057 - unset( $item['0']['explode'] );  
1058 - 1052 + $item['0']['explode'] = explode( '/', $item['0']['full_alias'] );
  1053 + $item['0']['type_alias'] = $item['0']['explode']['1'];
  1054 + $item['0']['subtype_alias'] = $item['0']['explode']['2'];
  1055 + unset( $item['0']['explode'] );
1059 $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 ]); 1056 $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 ]);
1060 $item['0']['filters'] = $filters; 1057 $item['0']['filters'] = $filters;
1061 $item['0']['images'] = $this->etc->int2arr( $item['0']['photogallery'] ); 1058 $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,13 +9,22 @@ if(isset($special_user)) {
9 $old_price = $data['price']; 9 $old_price = $data['price'];
10 $data['price'] = $data['price']*(1-$discount/100); 10 $data['price'] = $data['price']*(1-$discount/100);
11 $data['price'] = number_format($data['price'], 2, '.', ' '); 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 $data['html'] .= '</ul></div><div data-group_id="' . $item['group_id'] .'" class="one_item_buttons float">'; 29 $data['html'] .= '</ul></div><div data-group_id="' . $item['group_id'] .'" class="one_item_buttons float">';
21 30