@@ -25,7 +25,7 @@ |
||
| 25 | 25 | $page = @$_GET['page'] ?: 1; |
| 26 | 26 | $count = @$_GET['count'] ?: Config::instance()->module('Shop')->items_per_page; |
| 27 | 27 | if ($Session->user()) { |
| 28 | - $orders = $Orders->get( |
|
| 28 | + $orders = $Orders->get( |
|
| 29 | 29 | $Orders->search( |
| 30 | 30 | [ |
| 31 | 31 | 'user' => $Session->get_user() |
@@ -24,7 +24,8 @@ |
||
| 24 | 24 | $parent != $category['id'] // infinite loop protection |
| 25 | 25 | ) { |
| 26 | 26 | $parent = $Categories->get($category['parent']); |
| 27 | - if ($parent['parent'] == $category['id']) { // infinite loop protection |
|
| 27 | + if ($parent['parent'] == $category['id']) { |
|
| 28 | +// infinite loop protection |
|
| 28 | 29 | break; |
| 29 | 30 | } |
| 30 | 31 | $category['title'] = "$parent[title] :: $category[title]"; |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | @$_GET['asc'] |
| 56 | 56 | ) |
| 57 | 57 | ); |
| 58 | -$orders_total = $Orders->search( |
|
| 58 | +$orders_total = $Orders->search( |
|
| 59 | 59 | [ |
| 60 | 60 | 'total_count' => 1 |
| 61 | 61 | ] + (array)$_GET, |
@@ -109,8 +109,7 @@ |
||
| 109 | 109 | ) |
| 110 | 110 | ], |
| 111 | 111 | [ |
| 112 | - 'class' => $item['listed'] ? 'cs-block-success cs-text-success' : |
|
| 113 | - ($item['in_stock'] || $item['soon'] ? 'cs-block-warning cs-text-warning' : 'cs-block-error cs-text-error') |
|
| 112 | + 'class' => $item['listed'] ? 'cs-block-success cs-text-success' : ($item['in_stock'] || $item['soon'] ? 'cs-block-warning cs-text-warning' : 'cs-block-error cs-text-error') |
|
| 114 | 113 | ] |
| 115 | 114 | ]; |
| 116 | 115 | }, |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | if (!$items) { |
| 114 | 114 | return; |
| 115 | 115 | } |
| 116 | -$items_total = $Items->search( |
|
| 116 | +$items_total = $Items->search( |
|
| 117 | 117 | [ |
| 118 | 118 | 'listed' => 1, |
| 119 | 119 | 'category' => $current_category, |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | const DEFAULT_IMAGE = 'components/modules/Shop/includes/img/no-image.svg'; |
| 57 | 57 | |
| 58 | - protected $data_model = [ |
|
| 58 | + protected $data_model = [ |
|
| 59 | 59 | 'id' => 'int', |
| 60 | 60 | 'date' => 'int', |
| 61 | 61 | 'category' => 'int', |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | 'string' => '', |
| 444 | 444 | 'text' => '' |
| 445 | 445 | ]; |
| 446 | - $lang = ''; |
|
| 446 | + $lang = ''; |
|
| 447 | 447 | switch ($this->attribute_type_to_value_field($attribute_data['type'])) { |
| 448 | 448 | case 'numeric_value': |
| 449 | 449 | $value_type['numeric'] = $value; |
@@ -286,17 +286,20 @@ |
||
| 286 | 286 | $where = []; |
| 287 | 287 | $where_params = []; |
| 288 | 288 | foreach ($search_parameters as $key => $details) { |
| 289 | - if (isset($this->data_model[$key])) { // Property |
|
| 289 | + if (isset($this->data_model[$key])) { |
|
| 290 | +// Property |
|
| 290 | 291 | $where[] = "`i`.`$key` = '%s'"; |
| 291 | 292 | $where_params[] = $details; |
| 292 | - } elseif (is_numeric($key)) { // Tag |
|
| 293 | + } elseif (is_numeric($key)) { |
|
| 294 | +// Tag |
|
| 293 | 295 | $joins .= |
| 294 | 296 | "INNER JOIN `{$this->table}_tags` AS `t` |
| 295 | 297 | ON |
| 296 | 298 | `i`.`id` = `t`.`id` AND |
| 297 | 299 | `t`.`tag` = '%s'"; |
| 298 | 300 | $where_params[] = $details; |
| 299 | - } else { // Attribute |
|
| 301 | + } else { |
|
| 302 | +// Attribute |
|
| 300 | 303 | $field = @$this->attribute_type_to_value_field($Attributes->get($key)['type']); |
| 301 | 304 | if (!$field || empty($details)) { |
| 302 | 305 | continue; |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | use |
| 26 | 26 | CRUD, |
| 27 | 27 | Singleton; |
| 28 | - protected $data_model = [ |
|
| 28 | + protected $data_model = [ |
|
| 29 | 29 | 'id' => 'int:0', |
| 30 | 30 | 'user' => 'int:0', |
| 31 | 31 | 'date' => 'int:0', |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | use |
| 23 | 23 | Singleton; |
| 24 | 24 | |
| 25 | - protected $data_model = [ |
|
| 25 | + protected $data_model = [ |
|
| 26 | 26 | 'id' => 'int', |
| 27 | 27 | 'amount' => 'float:0', |
| 28 | 28 | 'currency' => 'text', |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | php build.php -M core -m Plupload,Static_pages |
| 76 | 76 | php build.php -M core -p TinyMCE -t DarkEnergy -s custom |
| 77 | 77 | php build.php -M module -m Plupload,Static_pages |
| 78 | -HELP; |
|
| 78 | +help; |
|
| 79 | 79 | } elseif ($mode == 'core') { |
| 80 | 80 | echo $Builder->core($modules, $plugins, $themes, $suffix)."\n"; |
| 81 | 81 | } else { |