Completed
Branch master (0964ce)
by Nazar
04:13
created
components/modules/Shop/Items.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -286,17 +286,20 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Shop
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2014-2015, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Shop
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2014-2015, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Shop;
10 10
 use
11 11
 	cs\Config,
Please login to merge, or discard this patch.
components/modules/Shop/Orders.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
 
68 68
 	const PAYMENT_METHOD_CASH = 'shop:cash';
69 69
 
70
-	protected $data_model            = [
70
+	protected $data_model = [
71 71
 		'id'                => 'int',
72 72
 		'user'              => 'int',
73 73
 		'date'              => 'int',
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Shop
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2014-2015, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Shop
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2014-2015, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Shop;
10 10
 use
11 11
 	cs\Config,
Please login to merge, or discard this patch.
components/modules/Shop/admin/attributes.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package    Shop
4
- * @attribute  modules
5
- * @author     Nazar Mokrynskyi <[email protected]>
6
- * @copyright  Copyright (c) 2014-2015, Nazar Mokrynskyi
7
- * @license    MIT License, see license.txt
8
- */
3
+	 * @package    Shop
4
+	 * @attribute  modules
5
+	 * @author     Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright  Copyright (c) 2014-2015, Nazar Mokrynskyi
7
+	 * @license    MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Shop;
10 10
 use
11 11
 	h,
Please login to merge, or discard this patch.
components/modules/Shop/admin/categories.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 		$parent &&
27 27
 		$parent != $category['id'] // infinite loop protection
28 28
 	) {
29
-		$parent            = $Categories->get($category['parent']);
29
+		$parent = $Categories->get($category['parent']);
30 30
 		if ($parent['parent'] == $category['id']) { // infinite loop protection
31 31
 			break;
32 32
 		}
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,8 @@
 block discarded – undo
27 27
 		$parent != $category['id'] // infinite loop protection
28 28
 	) {
29 29
 		$parent            = $Categories->get($category['parent']);
30
-		if ($parent['parent'] == $category['id']) { // infinite loop protection
30
+		if ($parent['parent'] == $category['id']) {
31
+// infinite loop protection
31 32
 			break;
32 33
 		}
33 34
 		$category['title'] = "$parent[title] :: $category[title]";
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Shop
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2014-2015, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Shop
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2014-2015, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Shop;
10 10
 use
11 11
 	cs\Config,
Please login to merge, or discard this patch.
components/modules/Shop/admin/items.php 2 patches
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,8 +110,7 @@
 block discarded – undo
110 110
 							)
111 111
 						],
112 112
 						[
113
-							'class' => $item['listed'] ? 'cs-block-success cs-text-success' :
114
-								($item['in_stock'] || $item['soon'] ? 'cs-block-warning cs-text-warning' : 'cs-block-error cs-text-error')
113
+							'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')
115 114
 						]
116 115
 					];
117 116
 				},
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Shop
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2014-2015, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Shop
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2014-2015, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Shop;
10 10
 use
11 11
 	cs\Config,
Please login to merge, or discard this patch.
components/modules/Shop/admin/orders.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
 		@$_GET['asc']
59 59
 	)
60 60
 );
61
-$orders_total              = $Orders->search(
61
+$orders_total = $Orders->search(
62 62
 	[
63 63
 		'total_count' => 1
64 64
 	] + (array)$_GET,
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Shop
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2014-2015, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Shop
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2014-2015, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Shop;
10 10
 use
11 11
 	cs\Config,
Please login to merge, or discard this patch.
components/modules/Shop/api/attributes.get.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,8 @@
 block discarded – undo
34 34
 	$Page->json(
35 35
 		$Attributes->get_type_to_name_array()
36 36
 	);
37
-} elseif (User::instance()->admin()) { //Hack to re-use contents of this file from `api/admin/attributes.get.php`
37
+} elseif (User::instance()->admin()) {
38
+//Hack to re-use contents of this file from `api/admin/attributes.get.php`
38 39
 	$Page->json(
39 40
 		$Attributes->get(
40 41
 			$Attributes->get_all()
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Shop
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2014-2015, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Shop
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2014-2015, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Shop;
10 10
 use
11 11
 	cs\Config,
Please login to merge, or discard this patch.
components/modules/Shop/api/cart.get.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Shop
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2015, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Shop
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2015, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 /**
10
- * Provides next events:
11
- *  Shop/Cart/calculate
12
- *  [
13
- *   'items'    => &$items,   // Array of array elements [id => item_id, units => units, price => total_price]
14
- *   'shipping' => &$shipping // Array in form [type => shipping_type_id, price => shipping_type_price]
15
- *  ]
16
- */
10
+	 * Provides next events:
11
+	 *  Shop/Cart/calculate
12
+	 *  [
13
+	 *   'items'    => &$items,   // Array of array elements [id => item_id, units => units, price => total_price]
14
+	 *   'shipping' => &$shipping // Array in form [type => shipping_type_id, price => shipping_type_price]
15
+	 *  ]
16
+	 */
17 17
 
18 18
 namespace cs\modules\Shop;
19 19
 use
Please login to merge, or discard this patch.
components/modules/Shop/api/payment_methods.get.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Shop
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2015, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Shop
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2015, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Shop;
10 10
 use
11 11
 	cs\Page;
Please login to merge, or discard this patch.