Commit 5b8bce99b56781c75e3d9260e9e7c0a2d099d3c0
1 parent
33e7bf86
hot fix
Showing
1 changed file
with
66 additions
and
66 deletions
Show diff stats
src/app/frontend/controllers/PageController.php
... | ... | @@ -1027,72 +1027,72 @@ |
1027 | 1027 | public function changeWithSizeAction() |
1028 | 1028 | { |
1029 | 1029 | |
1030 | -// if( $this->request->isAjax() && $this->request->isPost() ) | |
1031 | -// { | |
1032 | -// $item_id = $this->request->getPost( 'item_id', 'int', '' ); | |
1033 | -// $group_alias = $this->request->getPost( 'group_alias', 'string', '' ); | |
1034 | -// $item = $this->models->getItems()->getOneItem( $this->lang_id, $item_id ); | |
1035 | -// $filters = $this->models->getFilters()->getFiltersByItemId( $this->lang_id, $item_id ); | |
1036 | -// $colors_info = $this->models->getItems()->getColorsInfoByColorId( $this->lang_id, $item['0']['color_id'] ); | |
1037 | -// | |
1038 | -// $item['0']['color_title'] = NULL; | |
1039 | -// $item['0']['absolute_color'] = NULL; | |
1040 | -// $item['0']['color'] = NULL; | |
1041 | -// | |
1042 | -// if( !empty( $colors_info ) ) | |
1043 | -// { | |
1044 | -// $item['0']['color_title'] = $colors_info['0']['color_title']; | |
1045 | -// $item['0']['absolute_color'] = $colors_info['0']['absolute_color']; | |
1046 | -// | |
1047 | -// | |
1048 | -// $item['0']['color'] = | |
1049 | -// '<div class="float properties">'.$this->languages->getTranslation()->_("choose_color").': </div>'. | |
1050 | -// '<div class="float properties" style="color:'.$colors_info['0']['absolute_color'].'">'.$colors_info['0']['color_title'].'</div>'; | |
1051 | -// } | |
1052 | -// | |
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'] ); | |
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 ]); | |
1058 | -// $item['0']['filters'] = $filters; | |
1059 | -// $item['0']['images'] = $this->etc->int2arr( $item['0']['photogallery'] ); | |
1060 | -// $item['0']['status_real'] = $item['0']['status']; | |
1061 | -// $item['0']['status'] = $item['0']['status'] == 1 ? '<div data-stock="'.$item['0']['status'].'" id="stock" class="properties properties_presence ">'.$this->languages->getTranslation()->_("in_stock").'</div>' : ($item['0']['status'] == 2 ? '<div data-stock="'.$item['0']['status'].'" id="stock" class="properties properties_absent">'.$this->languages->getTranslation()->_("znyt").'</div>' : '<div data-stock="'.$item['0']['status'].'" id="stock" class="properties properties_absent">'.$this->languages->getTranslation()->_("missing").'</div>'); | |
1062 | -// $item['0']['image'] = ''; | |
1063 | -// | |
1064 | -// | |
1065 | -// $item['0']['image'] .= | |
1066 | -// '<li class="float width_400">'. | |
1067 | -// '<a href="'.$this->storage->getPhotoUrl( $item['0']['cover'], 'avatar', '400x' ).'" title="'.$item['0']['title'].'" data-options="thumbnail: \''.$this->storage->getPhotoUrl( $item['0']['cover'], 'avatar', '800x' ).'\'" class="thumbnail">'. | |
1068 | -// '<img src="'.$this->storage->getPhotoUrl( $item['0']['cover'], 'avatar', '400x' ).'" alt="'.$item['0']['title'].'" class="image_400">'. | |
1069 | -// '</a>'. | |
1070 | -// '</li>'; | |
1071 | -// | |
1072 | -// if( !empty( $item['0']['images'] ) && !empty( $item['0']['cover'] ) ) | |
1073 | -// { | |
1074 | -// foreach( $item['0']['images'] as $k => $i ) | |
1075 | -// { | |
1076 | -// | |
1077 | -// $item['0']['image'] .= | |
1078 | -// '<li class="float width_128 '.($k%3==0 ? 'last' : '').'">'. | |
1079 | -// '<a href="'.$this->storage->getPhotoUrl( $i, 'group', '800x' ).'" title="'.$item['0']['title'].'" data-options="thumbnail: \''.$this->storage->getPhotoUrl( $i, 'group', '128x128' ).'\'" class="thumbnail">'. | |
1080 | -// '<img src="'.$this->storage->getPhotoUrl( $i, 'group', '128x128' ).'" alt="'.$item['0']['title'].'" class="image_128">'. | |
1081 | -// '</a>'. | |
1082 | -// '</li>'; | |
1083 | -// | |
1084 | -// } | |
1085 | -// | |
1086 | -// $item['0']['image'] .= | |
1087 | -// '<li class="float width_128 '.(count($item['0']['images'])%3==0 ? 'last' : '').'">'. | |
1088 | -// '<a href="'.$this->storage->getPhotoUrl( $item['0']['cover'], 'avatar', '800x' ).'" title="'.$item['0']['title'].'" data-options="thumbnail: \''.$this->storage->getPhotoUrl( $item['0']['cover'], 'avatar', '128x' ).'\'" class="thumbnail">'. | |
1089 | -// '<img src="'.$this->storage->getPhotoUrl( $item['0']['cover'], 'avatar', '128x' ).'" alt="'.$item['0']['title'].'" class="image_128">'. | |
1090 | -// '</a>'. | |
1091 | -// '</li>'; | |
1092 | -// } | |
1093 | -// | |
1094 | -// } | |
1095 | -// | |
1030 | + if( $this->request->isAjax() && $this->request->isPost() ) | |
1031 | + { | |
1032 | + $item_id = $this->request->getPost( 'item_id', 'int', '' ); | |
1033 | + $group_alias = $this->request->getPost( 'group_alias', 'string', '' ); | |
1034 | + $item = $this->models->getItems()->getOneItem( $this->lang_id, $item_id ); | |
1035 | + $filters = $this->models->getFilters()->getFiltersByItemId( $this->lang_id, $item_id ); | |
1036 | + $colors_info = $this->models->getItems()->getColorsInfoByColorId( $this->lang_id, $item['0']['color_id'] ); | |
1037 | + | |
1038 | + $item['0']['color_title'] = NULL; | |
1039 | + $item['0']['absolute_color'] = NULL; | |
1040 | + $item['0']['color'] = NULL; | |
1041 | + | |
1042 | + if( !empty( $colors_info ) ) | |
1043 | + { | |
1044 | + $item['0']['color_title'] = $colors_info['0']['color_title']; | |
1045 | + $item['0']['absolute_color'] = $colors_info['0']['absolute_color']; | |
1046 | + | |
1047 | + | |
1048 | + $item['0']['color'] = | |
1049 | + '<div class="float properties">'.$this->languages->getTranslation()->_("choose_color").': </div>'. | |
1050 | + '<div class="float properties" style="color:'.$colors_info['0']['absolute_color'].'">'.$colors_info['0']['color_title'].'</div>'; | |
1051 | + } | |
1052 | + | |
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'] ); | |
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 ]); | |
1058 | + $item['0']['filters'] = $filters; | |
1059 | + $item['0']['images'] = $this->etc->int2arr( $item['0']['photogallery'] ); | |
1060 | + $item['0']['status_real'] = $item['0']['status']; | |
1061 | + $item['0']['status'] = $item['0']['status'] == 1 ? '<div data-stock="'.$item['0']['status'].'" id="stock" class="properties properties_presence ">'.$this->languages->getTranslation()->_("in_stock").'</div>' : ($item['0']['status'] == 2 ? '<div data-stock="'.$item['0']['status'].'" id="stock" class="properties properties_absent">'.$this->languages->getTranslation()->_("znyt").'</div>' : '<div data-stock="'.$item['0']['status'].'" id="stock" class="properties properties_absent">'.$this->languages->getTranslation()->_("missing").'</div>'); | |
1062 | + $item['0']['image'] = ''; | |
1063 | + | |
1064 | + | |
1065 | + $item['0']['image'] .= | |
1066 | + '<li class="float width_400">'. | |
1067 | + '<a href="'.$this->storage->getPhotoUrl( $item['0']['cover'], 'avatar', '400x' ).'" title="'.$item['0']['title'].'" data-options="thumbnail: \''.$this->storage->getPhotoUrl( $item['0']['cover'], 'avatar', '800x' ).'\'" class="thumbnail">'. | |
1068 | + '<img src="'.$this->storage->getPhotoUrl( $item['0']['cover'], 'avatar', '400x' ).'" alt="'.$item['0']['title'].'" class="image_400">'. | |
1069 | + '</a>'. | |
1070 | + '</li>'; | |
1071 | + | |
1072 | + if( !empty( $item['0']['images'] ) && !empty( $item['0']['cover'] ) ) | |
1073 | + { | |
1074 | + foreach( $item['0']['images'] as $k => $i ) | |
1075 | + { | |
1076 | + | |
1077 | + $item['0']['image'] .= | |
1078 | + '<li class="float width_128 '.($k%3==0 ? 'last' : '').'">'. | |
1079 | + '<a href="'.$this->storage->getPhotoUrl( $i, 'group', '800x' ).'" title="'.$item['0']['title'].'" data-options="thumbnail: \''.$this->storage->getPhotoUrl( $i, 'group', '128x128' ).'\'" class="thumbnail">'. | |
1080 | + '<img src="'.$this->storage->getPhotoUrl( $i, 'group', '128x128' ).'" alt="'.$item['0']['title'].'" class="image_128">'. | |
1081 | + '</a>'. | |
1082 | + '</li>'; | |
1083 | + | |
1084 | + } | |
1085 | + | |
1086 | + $item['0']['image'] .= | |
1087 | + '<li class="float width_128 '.(count($item['0']['images'])%3==0 ? 'last' : '').'">'. | |
1088 | + '<a href="'.$this->storage->getPhotoUrl( $item['0']['cover'], 'avatar', '800x' ).'" title="'.$item['0']['title'].'" data-options="thumbnail: \''.$this->storage->getPhotoUrl( $item['0']['cover'], 'avatar', '128x' ).'\'" class="thumbnail">'. | |
1089 | + '<img src="'.$this->storage->getPhotoUrl( $item['0']['cover'], 'avatar', '128x' ).'" alt="'.$item['0']['title'].'" class="image_128">'. | |
1090 | + '</a>'. | |
1091 | + '</li>'; | |
1092 | + } | |
1093 | + | |
1094 | + } | |
1095 | + | |
1096 | 1096 | if($this->session->get('special_users_id') != null) { |
1097 | 1097 | $special_users_id = $this->session->get('special_users_id'); |
1098 | 1098 | ... | ... |