@@ -109,9 +109,11 @@ |
||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | // Validate cart has products and has stock. |
| 112 | - if (!$this->cart->hasProducts()) || (!$this->cart->hasStock() && !$this->config->get('config_stock_checkout'))) { |
|
| 112 | + if (!$this->cart->hasProducts()) { |
|
| 113 | + || (!$this->cart->hasStock() && !$this->config->get('config_stock_checkout'))) { |
|
| 113 | 114 | $json['redirect'] = $this->url->link('checkout/cart'); |
| 114 | 115 | } |
| 116 | + } |
|
| 115 | 117 | |
| 116 | 118 | // Validate minimum quantity requirements. |
| 117 | 119 | $products = $this->cart->getProducts(); |
@@ -23,9 +23,11 @@ |
||
| 23 | 23 | class ControllerCheckoutCheckout extends \Sunrise\Engine\Core\Controller { |
| 24 | 24 | public function index() { |
| 25 | 25 | // Validate cart has products and has stock. |
| 26 | - if (!$this->cart->hasProducts()) || (!$this->cart->hasStock() && !$this->config->get('config_stock_checkout'))) { |
|
| 26 | + if (!$this->cart->hasProducts()) { |
|
| 27 | + || (!$this->cart->hasStock() && !$this->config->get('config_stock_checkout'))) { |
|
| 27 | 28 | $this->response->redirect($this->url->link('checkout/cart')); |
| 28 | 29 | } |
| 30 | + } |
|
| 29 | 31 | |
| 30 | 32 | // Validate minimum quantity requirements. |
| 31 | 33 | $products = $this->cart->getProducts(); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | $this->load->language('checkout/success'); |
| 28 | 28 | |
| 29 | - if (isset($this->session->data['order_id']) && (! empty($this->session->data['order_id']))) { |
|
| 29 | + if (isset($this->session->data['order_id']) && (!empty($this->session->data['order_id']))) { |
|
| 30 | 30 | $this->session->data['last_order_id'] = $this->session->data['order_id']; |
| 31 | 31 | } |
| 32 | 32 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | unset($this->session->data['totals']); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - if (! empty($this->session->data['last_order_id'])) { |
|
| 47 | + if (!empty($this->session->data['last_order_id'])) { |
|
| 48 | 48 | $this->document->setTitle(sprintf($this->language->get('heading_title_customer'), $this->session->data['last_order_id'])); |
| 49 | 49 | } else { |
| 50 | 50 | $this->document->setTitle($this->language->get('heading_title')); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | 'href' => $this->url->link('checkout/success') |
| 73 | 73 | ); |
| 74 | 74 | |
| 75 | - if (! empty($this->session->data['last_order_id'])) { |
|
| 75 | + if (!empty($this->session->data['last_order_id'])) { |
|
| 76 | 76 | $data['heading_title'] = sprintf($this->language->get('heading_title_customer'), $this->session->data['last_order_id']); |
| 77 | 77 | } else { |
| 78 | 78 | $data['heading_title'] = $this->language->get('heading_title'); |
@@ -124,9 +124,11 @@ |
||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | // Validate cart has products and has stock. |
| 127 | - if (!$this->cart->hasProducts()) || (!$this->cart->hasStock() && !$this->config->get('config_stock_checkout'))) { |
|
| 127 | + if (!$this->cart->hasProducts()) { |
|
| 128 | + || (!$this->cart->hasStock() && !$this->config->get('config_stock_checkout'))) { |
|
| 128 | 129 | $json['redirect'] = $this->url->link('checkout/cart'); |
| 129 | 130 | } |
| 131 | + } |
|
| 130 | 132 | |
| 131 | 133 | // Check if guest checkout is available. |
| 132 | 134 | if (!$this->config->get('config_checkout_guest') || $this->config->get('config_customer_price') || $this->cart->hasDownload()) { |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | if (isset($this->request->get['manufacturer_id'])) { |
| 60 | 60 | $manufacturer_id = ($this->request->get['manufacturer_id']); |
| 61 | 61 | } else { |
| 62 | - $manufacturer_id = null; |
|
| 62 | + $manufacturer_id = null; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | $filter_data = array( |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | if (isset($this->request->get['manufacturer_id'])) { |
| 67 | 67 | $manufacturer_id = ($this->request->get['manufacturer_id']); |
| 68 | 68 | } else { |
| 69 | - $manufacturer_id = null; |
|
| 69 | + $manufacturer_id = null; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | 40 | if (isset($this->request->get['information_id'])) { |
| 41 | - $information_id = (int) $this->request->get['information_id']; |
|
| 41 | + $information_id = (int)$this->request->get['information_id']; |
|
| 42 | 42 | } else { |
| 43 | 43 | $information_id = 0; |
| 44 | 44 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | $data['breadcrumbs'][] = array( |
| 67 | 67 | 'text' => $information_info['title'], |
| 68 | - 'href' => $this->url->link('information/information', 'information_id=' . $information_id) |
|
| 68 | + 'href' => $this->url->link('information/information', 'information_id=' . $information_id) |
|
| 69 | 69 | ); |
| 70 | 70 | |
| 71 | 71 | $data['button_continue'] = $this->language->get('button_continue'); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $this->load->model('catalog/information'); |
| 116 | 116 | |
| 117 | 117 | if (isset($this->request->get['information_id'])) { |
| 118 | - $information_id = (int) $this->request->get['information_id']; |
|
| 118 | + $information_id = (int)$this->request->get['information_id']; |
|
| 119 | 119 | } else { |
| 120 | 120 | $information_id = 0; |
| 121 | 121 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | if (isset($this->request->get['limit'])) { |
| 70 | - $limit = ((int) $this->request->get['limit'] > 100 ? 100 : (int) $this->request->get['limit']); |
|
| 70 | + $limit = ((int)$this->request->get['limit'] > 100 ? 100 : (int)$this->request->get['limit']); |
|
| 71 | 71 | $this->document->setRobots('noindex,follow'); |
| 72 | 72 | } else { |
| 73 | 73 | $limit = $this->config->get('config_limit_store'); |
@@ -97,15 +97,15 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | $path = ''; |
| 99 | 99 | |
| 100 | - $parts = explode('_', (string) $this->request->get['path']); |
|
| 100 | + $parts = explode('_', (string)$this->request->get['path']); |
|
| 101 | 101 | |
| 102 | - $category_id = (int) array_pop($parts); |
|
| 102 | + $category_id = (int)array_pop($parts); |
|
| 103 | 103 | |
| 104 | 104 | foreach ($parts as $path_id) { |
| 105 | 105 | if (!$path) { |
| 106 | - $path = (int) $path_id; |
|
| 106 | + $path = (int)$path_id; |
|
| 107 | 107 | } else { |
| 108 | - $path .= '_' . (int) $path_id; |
|
| 108 | + $path .= '_' . (int)$path_id; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | $category_info = $this->model_catalog_category->getCategory($path_id); |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | $price = false; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - if ((float) $result['special']) { |
|
| 244 | + if ((float)$result['special']) { |
|
| 245 | 245 | $special = $this->currency->format($result['special'], $this->session->data['currency']); |
| 246 | 246 | } else { |
| 247 | 247 | $special = false; |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | $description = \voku\helper\UTF8::substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..'; |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | - if ((float) $result['special']) { |
|
| 256 | + if ((float)$result['special']) { |
|
| 257 | 257 | $yousave_percent = round(((($result['price'] - $result['special']) / $result['price']) * 100), 0); |
| 258 | 258 | } else { |
| 259 | 259 | $yousave_percent = false; |
@@ -51,9 +51,9 @@ discard block |
||
| 51 | 51 | if (isset($this->request->get['path'])) { |
| 52 | 52 | $path = ''; |
| 53 | 53 | |
| 54 | - $parts = explode('_', (string) $this->request->get['path']); |
|
| 54 | + $parts = explode('_', (string)$this->request->get['path']); |
|
| 55 | 55 | |
| 56 | - $category_id = (int) array_pop($parts); |
|
| 56 | + $category_id = (int)array_pop($parts); |
|
| 57 | 57 | |
| 58 | 58 | foreach ($parts as $path_id) { |
| 59 | 59 | if (!$path) { |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | // product_id |
| 188 | 188 | if (isset($this->request->get['product_id'])) { |
| 189 | - $product_id = (int) $this->request->get['product_id']; |
|
| 189 | + $product_id = (int)$this->request->get['product_id']; |
|
| 190 | 190 | } else { |
| 191 | 191 | $product_id = 0; |
| 192 | 192 | } |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | $data['tab_attribute'] = $this->language->get('tab_attribute'); |
| 326 | 326 | $data['tab_review'] = sprintf($this->language->get('tab_review'), $product_info['reviews']); |
| 327 | 327 | |
| 328 | - $data['product_id'] = (int) $this->request->get['product_id']; |
|
| 328 | + $data['product_id'] = (int)$this->request->get['product_id']; |
|
| 329 | 329 | $data['manufacturer'] = $product_info['manufacturer']; |
| 330 | 330 | |
| 331 | 331 | // +++ category-in-the-product-page | All linked categories |
@@ -378,19 +378,19 @@ discard block |
||
| 378 | 378 | $data['price'] = false; |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | - if ((float) $product_info['special']) { |
|
| 381 | + if ((float)$product_info['special']) { |
|
| 382 | 382 | $data['special'] = $this->currency->format($product_info['special'], $this->session->data['currency']); |
| 383 | 383 | } else { |
| 384 | 384 | $data['special'] = false; |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | - if ((float) $product_info['special']) { |
|
| 387 | + if ((float)$product_info['special']) { |
|
| 388 | 388 | $data['yousave_money'] = $this->currency->format(($product_info['price'] - $product_info['special']), $this->session->data['currency']); |
| 389 | 389 | } else { |
| 390 | 390 | $data['yousave_money'] = false; |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | - if ((float) $product_info['special']) { |
|
| 393 | + if ((float)$product_info['special']) { |
|
| 394 | 394 | $data['yousave_percent'] = round(((($product_info['price'] - $product_info['special']) / $product_info['price']) * 100), 0); |
| 395 | 395 | } else { |
| 396 | 396 | $data['yousave_percent'] = false; |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | |
| 443 | 443 | foreach ($option['product_option_value'] as $option_value) { |
| 444 | 444 | if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) { |
| 445 | - if ((($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) && (float) $option_value['price']) { |
|
| 445 | + if ((($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) && (float)$option_value['price']) { |
|
| 446 | 446 | $price = $this->currency->format($option_value['price'], $this->session->data['currency']); |
| 447 | 447 | } else { |
| 448 | 448 | $price = false; |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | $data['customer_name'] = ''; |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | - $data['reviews'] = sprintf($this->language->get('text_reviews'), (int) $product_info['reviews']); |
|
| 495 | + $data['reviews'] = sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']); |
|
| 496 | 496 | |
| 497 | 497 | $data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($this->request->get['product_id']); |
| 498 | 498 | |
@@ -513,13 +513,13 @@ discard block |
||
| 513 | 513 | $price = false; |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | - if ((float) $result['special']) { |
|
| 516 | + if ((float)$result['special']) { |
|
| 517 | 517 | $special = $this->currency->format($result['special'], $this->session->data['currency']); |
| 518 | 518 | } else { |
| 519 | 519 | $special = false; |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | - if ((float) $result['special']) { |
|
| 522 | + if ((float)$result['special']) { |
|
| 523 | 523 | $yousave_percent = round(((($result['price'] - $result['special']) / $result['price']) * 100), 0); |
| 524 | 524 | } else { |
| 525 | 525 | $yousave_percent = false; |