@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | $value = $this->currencies[$currency]['value']; |
59 | 59 | } |
60 | 60 | |
61 | - $amount = $value ? (float) $number * $value : (float) $number; |
|
61 | + $amount = $value ? (float)$number * $value : (float)$number; |
|
62 | 62 | |
63 | - $amount = round($amount, (int) $decimal_place); |
|
63 | + $amount = round($amount, (int)$decimal_place); |
|
64 | 64 | |
65 | 65 | if (!$format) { |
66 | 66 | return $amount; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $string .= $symbol_left; |
73 | 73 | } |
74 | 74 | |
75 | - $string .= number_format($amount, (int) $decimal_place, $this->language->get('decimal_point'), $this->language->get('thousand_point')); |
|
75 | + $string .= number_format($amount, (int)$decimal_place, $this->language->get('decimal_point'), $this->language->get('thousand_point')); |
|
76 | 76 | |
77 | 77 | if ($symbol_right) { |
78 | 78 | $string .= $symbol_right; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $this->db->query(" |
46 | 46 | UPDATE cart |
47 | 47 | SET session_id = '" . $this->db->escape($this->session->getId()) . "' |
48 | - WHERE customer_id = '" . (int) $this->customer->getId() . "' |
|
48 | + WHERE customer_id = '" . (int)$this->customer->getId() . "' |
|
49 | 49 | "); |
50 | 50 | |
51 | 51 | // Once the customer is logged in we want to update the customers cart |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | foreach ($cart_query->rows as $cart) { |
60 | 60 | $this->db->query(" |
61 | 61 | DELETE FROM cart |
62 | - WHERE cart_id = '" . (int) $cart['cart_id'] . "' |
|
62 | + WHERE cart_id = '" . (int)$cart['cart_id'] . "' |
|
63 | 63 | "); |
64 | 64 | |
65 | 65 | // The advantage of using $this->add is that it will check if the products already exist and increaser the quantity if necessary. |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $cart_query = $this->db->query(" |
76 | 76 | SELECT * |
77 | 77 | FROM cart |
78 | - WHERE customer_id = '" . (int) $this->customer->getId() . "' |
|
78 | + WHERE customer_id = '" . (int)$this->customer->getId() . "' |
|
79 | 79 | AND session_id = '" . $this->db->escape($this->session->getId()) . "' |
80 | 80 | "); |
81 | 81 | |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | SELECT * |
87 | 87 | FROM product p |
88 | 88 | LEFT JOIN product_description pd ON (p.product_id = pd.product_id) |
89 | - WHERE p.product_id = '" . (int) $cart['product_id'] . "' |
|
90 | - AND pd.language_id = '" . (int) $this->config->get('config_language_id') . "' |
|
89 | + WHERE p.product_id = '" . (int)$cart['product_id'] . "' |
|
90 | + AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' |
|
91 | 91 | AND p.status = '1' |
92 | 92 | "); |
93 | 93 | |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | FROM product_option po |
104 | 104 | LEFT JOIN `option` o ON (po.option_id = o.option_id) |
105 | 105 | LEFT JOIN option_description od ON (o.option_id = od.option_id) |
106 | - WHERE po.product_option_id = '" . (int) $product_option_id . "' |
|
107 | - AND po.product_id = '" . (int) $cart['product_id'] . "' |
|
108 | - AND od.language_id = '" . (int) $this->config->get('config_language_id') . "' |
|
106 | + WHERE po.product_option_id = '" . (int)$product_option_id . "' |
|
107 | + AND po.product_id = '" . (int)$cart['product_id'] . "' |
|
108 | + AND od.language_id = '" . (int)$this->config->get('config_language_id') . "' |
|
109 | 109 | "); |
110 | 110 | |
111 | 111 | if ($option_query->num_rows) { |
@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | FROM product_option_value pov |
116 | 116 | LEFT JOIN option_value ov ON (pov.option_value_id = ov.option_value_id) |
117 | 117 | LEFT JOIN option_value_description ovd ON (ov.option_value_id = ovd.option_value_id) |
118 | - WHERE pov.product_option_value_id = '" . (int) $value . "' |
|
119 | - AND pov.product_option_id = '" . (int) $product_option_id . "' |
|
120 | - AND ovd.language_id = '" . (int) $this->config->get('config_language_id') . "' |
|
118 | + WHERE pov.product_option_value_id = '" . (int)$value . "' |
|
119 | + AND pov.product_option_id = '" . (int)$product_option_id . "' |
|
120 | + AND ovd.language_id = '" . (int)$this->config->get('config_language_id') . "' |
|
121 | 121 | "); |
122 | 122 | |
123 | 123 | if ($option_value_query->num_rows) { |
@@ -159,9 +159,9 @@ discard block |
||
159 | 159 | SELECT pov.option_value_id, pov.quantity, pov.subtract, pov.price, pov.price_prefix, pov.points, pov.points_prefix, ovd.name |
160 | 160 | FROM product_option_value pov |
161 | 161 | LEFT JOIN option_value_description ovd ON (pov.option_value_id = ovd.option_value_id) |
162 | - WHERE pov.product_option_value_id = '" . (int) $product_option_value_id . "' |
|
163 | - AND pov.product_option_id = '" . (int) $product_option_id . "' |
|
164 | - AND ovd.language_id = '" . (int) $this->config->get('config_language_id') . "' |
|
162 | + WHERE pov.product_option_value_id = '" . (int)$product_option_value_id . "' |
|
163 | + AND pov.product_option_id = '" . (int)$product_option_id . "' |
|
164 | + AND ovd.language_id = '" . (int)$this->config->get('config_language_id') . "' |
|
165 | 165 | "); |
166 | 166 | |
167 | 167 | if ($option_value_query->num_rows) { |
@@ -232,9 +232,9 @@ discard block |
||
232 | 232 | $product_discount_query = $this->db->query(" |
233 | 233 | SELECT price |
234 | 234 | FROM product_discount |
235 | - WHERE product_id = '" . (int) $cart['product_id'] . "' |
|
236 | - AND customer_group_id = '" . (int) $this->config->get('config_customer_group_id') . "' |
|
237 | - AND quantity <= '" . (int) $discount_quantity . "' |
|
235 | + WHERE product_id = '" . (int)$cart['product_id'] . "' |
|
236 | + AND customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' |
|
237 | + AND quantity <= '" . (int)$discount_quantity . "' |
|
238 | 238 | AND ((date_start = '2000-01-01' OR date_start < NOW()) |
239 | 239 | AND (date_end = '2000-01-01' OR date_end > NOW())) |
240 | 240 | ORDER BY quantity DESC, priority ASC, price ASC |
@@ -249,8 +249,8 @@ discard block |
||
249 | 249 | $product_special_query = $this->db->query(" |
250 | 250 | SELECT price |
251 | 251 | FROM product_special |
252 | - WHERE product_id = '" . (int) $cart['product_id'] . "' |
|
253 | - AND customer_group_id = '" . (int) $this->config->get('config_customer_group_id') . "' |
|
252 | + WHERE product_id = '" . (int)$cart['product_id'] . "' |
|
253 | + AND customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' |
|
254 | 254 | AND ((date_start = '2000-01-01' OR date_start < NOW()) |
255 | 255 | AND (date_end = '2000-01-01' OR date_end > NOW())) |
256 | 256 | ORDER BY priority ASC, price ASC |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | $product_reward_query = $this->db->query(" |
266 | 266 | SELECT points |
267 | 267 | FROM product_reward |
268 | - WHERE product_id = '" . (int) $cart['product_id'] . "' |
|
269 | - AND customer_group_id = '" . (int) $this->config->get('config_customer_group_id') . "' |
|
268 | + WHERE product_id = '" . (int)$cart['product_id'] . "' |
|
269 | + AND customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' |
|
270 | 270 | "); |
271 | 271 | |
272 | 272 | if ($product_reward_query->num_rows) { |
@@ -283,8 +283,8 @@ discard block |
||
283 | 283 | FROM product_to_download p2d |
284 | 284 | LEFT JOIN download d ON (p2d.download_id = d.download_id) |
285 | 285 | LEFT JOIN download_description dd ON (d.download_id = dd.download_id) |
286 | - WHERE p2d.product_id = '" . (int) $cart['product_id'] . "' |
|
287 | - AND dd.language_id = '" . (int) $this->config->get('config_language_id') . "' |
|
286 | + WHERE p2d.product_id = '" . (int)$cart['product_id'] . "' |
|
287 | + AND dd.language_id = '" . (int)$this->config->get('config_language_id') . "' |
|
288 | 288 | "); |
289 | 289 | |
290 | 290 | foreach ($download_query->rows as $download) { |
@@ -334,29 +334,29 @@ discard block |
||
334 | 334 | $query = $this->db->query(" |
335 | 335 | SELECT COUNT(*) AS total |
336 | 336 | FROM cart |
337 | - WHERE customer_id = '" . (int) $this->customer->getId() . "' |
|
337 | + WHERE customer_id = '" . (int)$this->customer->getId() . "' |
|
338 | 338 | AND session_id = '" . $this->db->escape($this->session->getId()) . "' |
339 | - AND product_id = '" . (int) $product_id . "' |
|
339 | + AND product_id = '" . (int)$product_id . "' |
|
340 | 340 | AND `option` = '" . $this->db->escape(json_encode($option)) . "' |
341 | 341 | "); |
342 | 342 | |
343 | 343 | if (!$query->row['total']) { |
344 | 344 | $this->db->query(" |
345 | 345 | INSERT cart |
346 | - SET customer_id = '" . (int) $this->customer->getId() . "', |
|
346 | + SET customer_id = '" . (int)$this->customer->getId() . "', |
|
347 | 347 | session_id = '" . $this->db->escape($this->session->getId()) . "', |
348 | - product_id = '" . (int) $product_id . "', |
|
348 | + product_id = '" . (int)$product_id . "', |
|
349 | 349 | `option` = '" . $this->db->escape(json_encode($option)) . "', |
350 | - quantity = '" . (int) $quantity . "', |
|
350 | + quantity = '" . (int)$quantity . "', |
|
351 | 351 | date_added = NOW() |
352 | 352 | "); |
353 | 353 | } else { |
354 | 354 | $this->db->query(" |
355 | 355 | UPDATE cart |
356 | - SET quantity = (quantity + " . (int) $quantity . ") |
|
357 | - WHERE customer_id = '" . (int) $this->customer->getId() . "' |
|
356 | + SET quantity = (quantity + " . (int)$quantity . ") |
|
357 | + WHERE customer_id = '" . (int)$this->customer->getId() . "' |
|
358 | 358 | AND session_id = '" . $this->db->escape($this->session->getId()) . "' |
359 | - AND product_id = '" . (int) $product_id . "' |
|
359 | + AND product_id = '" . (int)$product_id . "' |
|
360 | 360 | AND `option` = '" . $this->db->escape(json_encode($option)) . "' |
361 | 361 | "); |
362 | 362 | } |
@@ -366,9 +366,9 @@ discard block |
||
366 | 366 | { |
367 | 367 | $this->db->query(" |
368 | 368 | UPDATE cart |
369 | - SET quantity = '" . (int) $quantity . "' |
|
370 | - WHERE cart_id = '" . (int) $cart_id . "' |
|
371 | - AND customer_id = '" . (int) $this->customer->getId() . "' |
|
369 | + SET quantity = '" . (int)$quantity . "' |
|
370 | + WHERE cart_id = '" . (int)$cart_id . "' |
|
371 | + AND customer_id = '" . (int)$this->customer->getId() . "' |
|
372 | 372 | AND session_id = '" . $this->db->escape($this->session->getId()) . "' |
373 | 373 | "); |
374 | 374 | } |
@@ -377,8 +377,8 @@ discard block |
||
377 | 377 | { |
378 | 378 | $this->db->query(" |
379 | 379 | DELETE FROM cart |
380 | - WHERE cart_id = '" . (int) $cart_id . "' |
|
381 | - AND customer_id = '" . (int) $this->customer->getId() . "' |
|
380 | + WHERE cart_id = '" . (int)$cart_id . "' |
|
381 | + AND customer_id = '" . (int)$this->customer->getId() . "' |
|
382 | 382 | AND session_id = '" . $this->db->escape($this->session->getId()) . "' |
383 | 383 | "); |
384 | 384 | } |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | { |
388 | 388 | $this->db->query(" |
389 | 389 | DELETE FROM cart |
390 | - WHERE customer_id = '" . (int) $this->customer->getId() . "' |
|
390 | + WHERE customer_id = '" . (int)$this->customer->getId() . "' |
|
391 | 391 | AND session_id = '" . $this->db->escape($this->session->getId()) . "' |
392 | 392 | "); |
393 | 393 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | { |
33 | 33 | $this->id = $route; |
34 | 34 | |
35 | - $parts = explode('/', preg_replace('/[^a-zA-Z0-9_\/]/', '', (string) $route)); |
|
35 | + $parts = explode('/', preg_replace('/[^a-zA-Z0-9_\/]/', '', (string)$route)); |
|
36 | 36 | |
37 | 37 | // Break apart the route |
38 | 38 | while ($parts) { |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | |
420 | 420 | private function getPathByProduct($product_id) |
421 | 421 | { |
422 | - $product_id = (int) $product_id; |
|
422 | + $product_id = (int)$product_id; |
|
423 | 423 | |
424 | 424 | if ($product_id < 1) { |
425 | 425 | return false; |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | LIMIT 1 |
445 | 445 | "); |
446 | 446 | |
447 | - $path[$product_id] = $this->getPathByCategory($query->num_rows ? (int) $query->row['category_id'] : 0); |
|
447 | + $path[$product_id] = $this->getPathByCategory($query->num_rows ? (int)$query->row['category_id'] : 0); |
|
448 | 448 | |
449 | 449 | $this->cache->set( |
450 | 450 | 'product.seopath', |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | |
458 | 458 | private function getPathByCategory($category_id) |
459 | 459 | { |
460 | - $category_id = (int) $category_id; |
|
460 | + $category_id = (int)$category_id; |
|
461 | 461 | |
462 | 462 | if ($category_id < 1) { |
463 | 463 | return false; |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | //blog |
507 | 507 | private function getPathByBlogCategory($blog_category_id) |
508 | 508 | { |
509 | - $blog_category_id = (int) $blog_category_id; |
|
509 | + $blog_category_id = (int)$blog_category_id; |
|
510 | 510 | |
511 | 511 | if ($blog_category_id < 1) { |
512 | 512 | return false; |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | |
556 | 556 | private function getPathByArticle($article_id) |
557 | 557 | { |
558 | - $article_id = (int) $article_id; |
|
558 | + $article_id = (int)$article_id; |
|
559 | 559 | |
560 | 560 | if ($article_id < 1) { |
561 | 561 | return false; |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | if (!isset($path[$article_id])) { |
576 | 576 | $query = $this->db->query("SELECT blog_category_id FROM article_to_blog_category WHERE article_id = '" . $article_id . "' ORDER BY main_blog_category DESC LIMIT 1"); |
577 | 577 | |
578 | - $path[$article_id] = $this->getPathByBlogCategory($query->num_rows ? (int) $query->row['blog_category_id'] : 0); |
|
578 | + $path[$article_id] = $this->getPathByBlogCategory($query->num_rows ? (int)$query->row['blog_category_id'] : 0); |
|
579 | 579 | |
580 | 580 | // $this->cache->set( |
581 | 581 | // 'article.seopath', |