Completed
Push — master ( f161aa...d0d50d )
by
unknown
15:24
created
includes/modules/wps_statistics/wps_statistics.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 /**
3 3
  * WPShop Statistics bootstrap file
4 4
  * @author Jérôme ALLEGRE - Eoxia dev team <[email protected]>
@@ -7,20 +7,20 @@  discard block
 block discarded – undo
7 7
  * @subpackage modules
8 8
  *
9 9
  */
10
-if ( !defined( 'WPSHOP_VERSION' ) ) {
11
-	die( __("You are not allowed to use this service.", 'wpshop') );
10
+if (!defined('WPSHOP_VERSION')) {
11
+	die(__("You are not allowed to use this service.", 'wpshop'));
12 12
 }
13 13
 
14 14
 /** */
15
-DEFINE( 'WPS_STATISTICS_VERSION', '1.0.1' );
16
-DEFINE( 'WPS_STATISTICS_DIR', basename(dirname(__FILE__)));
17
-DEFINE( 'WPS_STATISTICS_PATH', dirname( __FILE__ ) );
18
-DEFINE( 'WPS_STATISTICS_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', str_replace( "\\", "/", WPS_STATISTICS_PATH ) ) );
15
+DEFINE('WPS_STATISTICS_VERSION', '1.0.1');
16
+DEFINE('WPS_STATISTICS_DIR', basename(dirname(__FILE__)));
17
+DEFINE('WPS_STATISTICS_PATH', dirname(__FILE__));
18
+DEFINE('WPS_STATISTICS_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', str_replace("\\", "/", WPS_STATISTICS_PATH)));
19 19
 
20 20
 /**	Define the templates directories	*/
21
-DEFINE( 'WPS_STATISTICS_TEMPLATES_MAIN_DIR', WPS_STATISTICS_PATH . '/templates/');
21
+DEFINE('WPS_STATISTICS_TEMPLATES_MAIN_DIR', WPS_STATISTICS_PATH . '/templates/');
22 22
 
23
-include( plugin_dir_path( __FILE__ ).'/controller/wps_statistics_ctr.php' );
24
-include( plugin_dir_path( __FILE__ ).'/model/wps_statisticsmdl.php' );
23
+include(plugin_dir_path(__FILE__) . '/controller/wps_statistics_ctr.php');
24
+include(plugin_dir_path(__FILE__) . '/model/wps_statisticsmdl.php');
25 25
 
26 26
 $wps_statistics_ctr = new wps_statistics_ctr();
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 /**
3 5
  * WPShop Statistics bootstrap file
4 6
  * @author Jérôme ALLEGRE - Eoxia dev team <[email protected]>
Please login to merge, or discard this patch.
modules/wps_statistics/templates/backend/statistic_metabox_content.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <div class="postbox">
4 4
 	<h3 class="hndle"><span><?php echo $box_title; ?></span></h3>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 ?>
3 5
 <div class="postbox">
4 6
 	<h3 class="hndle"><span><?php echo $box_title; ?></span></h3>
Please login to merge, or discard this patch.
includes/modules/wps-pos-addon/controller/wps-pos-bank-deposit-histo.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 class wps_pos_addon_bank_deposit_histo {
3 5
 	public $name_option = 'bank_deposit_historic';
4 6
 	public function __construct() {
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,47 +1,47 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 class wps_pos_addon_bank_deposit_histo {
3 3
 	public $name_option = 'bank_deposit_historic';
4 4
 	public function __construct() {
5 5
 		/**	Call metaboxes	*/
6
-		add_action( 'admin_init', array( $this, 'metaboxes' ) );
7
-		add_action( 'admin_enqueue_scripts', array( $this, 'vars_js' ), 11 );
8
-		add_option( $this->name_option, array(), '', 'yes' );
6
+		add_action('admin_init', array($this, 'metaboxes'));
7
+		add_action('admin_enqueue_scripts', array($this, 'vars_js'), 11);
8
+		add_option($this->name_option, array(), '', 'yes');
9 9
 	}
10 10
 	public function metaboxes() {
11
-		add_meta_box( 'wpspos-bank-deposit-histo-metabox', __( 'Historic bank deposit', 'wps-pos-i18n' ), array( $this, 'metabox' ), 'wpspos-bank-deposit', 'wpspos-bank-deposit-right' );
11
+		add_meta_box('wpspos-bank-deposit-histo-metabox', __('Historic bank deposit', 'wps-pos-i18n'), array($this, 'metabox'), 'wpspos-bank-deposit', 'wpspos-bank-deposit-right');
12 12
 	}
13 13
 	public function metabox() {
14
-		require( wpshop_tools::get_template_part( WPSPOS_DIR, WPSPOS_TEMPLATES_MAIN_DIR, 'backend/bank_deposit', 'metabox', 'bank_deposit_histo' ) );
14
+		require(wpshop_tools::get_template_part(WPSPOS_DIR, WPSPOS_TEMPLATES_MAIN_DIR, 'backend/bank_deposit', 'metabox', 'bank_deposit_histo'));
15 15
 	}
16
-	public function add_historic( $new_value ) {
17
-		$histo = get_option( $this->name_option );
16
+	public function add_historic($new_value) {
17
+		$histo = get_option($this->name_option);
18 18
 		$histo[] = '';
19
-		end( $histo );
20
-		$id = key( $histo );
19
+		end($histo);
20
+		$id = key($histo);
21 21
 		$new_value['id'] = $id;
22 22
 		$histo[$id] = $new_value;
23
-		update_option( $this->name_option, $histo );
23
+		update_option($this->name_option, $histo);
24 24
 	}
25 25
 	public function get_historic() {
26
-		return array_reverse( get_option( $this->name_option ) );
26
+		return array_reverse(get_option($this->name_option));
27 27
 	}
28
-	public function row_model( $id, $date, $amount, $payments ) {
29
-		return array( 'id' => $id, 'date' => $date, 'amount' => $amount, 'payments' => $payments );
28
+	public function row_model($id, $date, $amount, $payments) {
29
+		return array('id' => $id, 'date' => $date, 'amount' => $amount, 'payments' => $payments);
30 30
 	}
31 31
 	public function vars_js() {
32
-		wp_localize_script( 'wpspos-backend-bank-deposit-js', 'historics', $this->get_historic() );
33
-		wp_localize_script( 'wpspos-backend-bank-deposit-js', 'templates_url', admin_url( 'admin-post.php' ) );
32
+		wp_localize_script('wpspos-backend-bank-deposit-js', 'historics', $this->get_historic());
33
+		wp_localize_script('wpspos-backend-bank-deposit-js', 'templates_url', admin_url('admin-post.php'));
34 34
 	}
35 35
 	public function save_historic_ajax() {
36
-		$list_payments = !empty( $_POST['payments'] ) ? (array) $_POST['payments'] : array();
36
+		$list_payments = !empty($_POST['payments']) ? (array)$_POST['payments'] : array();
37 37
 		$payments = array();
38
-		foreach( $list_payments as $payment ) {
39
-			if( is_float( $payment ) ) {
40
-				$payments[] = (float) $payment;
38
+		foreach ($list_payments as $payment) {
39
+			if (is_float($payment)) {
40
+				$payments[] = (float)$payment;
41 41
 			}
42 42
 		}
43
-		$this->add_historic( $this->row_model( 0, sanitize_text_field( $_POST['date'] ), sanitize_text_field( $_POST['amount'] ), $payments ) );
44
-		echo json_encode( $this->get_historic() );
43
+		$this->add_historic($this->row_model(0, sanitize_text_field($_POST['date']), sanitize_text_field($_POST['amount']), $payments));
44
+		echo json_encode($this->get_historic());
45 45
 		wp_die();
46 46
 	}
47 47
 }
Please login to merge, or discard this patch.
includes/modules/wps-pos-addon/templates/backend/products/products.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <table class="table table-striped wps-pos-element-table">
4 4
 	<tr>
@@ -6,9 +6,9 @@  discard block
 block discarded – undo
6 6
 		<th><?php _e('Product price', 'wps-pos-i18n'); ?></th>
7 7
 		<th><?php _e('Action', 'wps-pos-i18n'); ?></th>
8 8
 	</tr>
9
-	<?php foreach ( $product_list as $product ) : ?>
10
-		<?php $product_data = wpshop_products::get_product_data( $product['ID'] ); ?>
11
-		<?php $product_variation_definition = wpshop_products::get_variation( $product['ID'] );?>
12
-		<?php require( wpshop_tools::get_template_part( WPSPOS_DIR, WPSPOS_TEMPLATES_MAIN_DIR, 'backend/products', 'product' ) ); ?>
9
+	<?php foreach ($product_list as $product) : ?>
10
+		<?php $product_data = wpshop_products::get_product_data($product['ID']); ?>
11
+		<?php $product_variation_definition = wpshop_products::get_variation($product['ID']); ?>
12
+		<?php require(wpshop_tools::get_template_part(WPSPOS_DIR, WPSPOS_TEMPLATES_MAIN_DIR, 'backend/products', 'product')); ?>
13 13
 	<?php endforeach; ?>
14 14
 </table>
15 15
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 ?>
3 5
 <table class="table table-striped wps-pos-element-table">
4 6
 	<tr>
Please login to merge, or discard this patch.
modules/wps-pos-addon/templates/backend/products/metabox_title-list.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 ?>
3 5
 <span class="dashicons dashicons-products"></span>
4 6
 <?php _e( 'Product selection', 'wps-pos-i18n' ); ?>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <span class="dashicons dashicons-products"></span>
4
-<?php _e( 'Product selection', 'wps-pos-i18n' ); ?>
5
-<a class="thickbox add-new-h2" title="<?php _e( 'New product creation', 'wps-pos-i18n' ); ?>" href="<?php echo admin_url( 'admin-ajax.php?action=wpspos-product-quick-creation&_wpnonce=' . wp_create_nonce( 'wps-product-quick-nonce' ) . '&width=550&height=600' ); ?>"><?php _e('Create a product', 'wps-pos-i18n'); ?></a>
4
+<?php _e('Product selection', 'wps-pos-i18n'); ?>
5
+<a class="thickbox add-new-h2" title="<?php _e('New product creation', 'wps-pos-i18n'); ?>" href="<?php echo admin_url('admin-ajax.php?action=wpspos-product-quick-creation&_wpnonce=' . wp_create_nonce('wps-product-quick-nonce') . '&width=550&height=600'); ?>"><?php _e('Create a product', 'wps-pos-i18n'); ?></a>
Please login to merge, or discard this patch.
modules/wps-pos-addon/templates/backend/products/modal-variation.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
2
- if ( !empty( $product_id ) ) : ?>
3
-	<?php echo wpshop_products::wpshop_variation( $product_id ); ?>
1
+<?php if (!defined('ABSPATH')) exit;
2
+ if (!empty($product_id)) : ?>
3
+	<?php echo wpshop_products::wpshop_variation($product_id); ?>
4 4
 	<div class="wpspos-product-variation-selector" >
5
-		<button class="wps-bton-first-mini-rounded alignRight" id="wpspos-product-with-variation-add-to-cart" ><?php _e( 'Add product', 'wpshop'); ?></button>
5
+		<button class="wps-bton-first-mini-rounded alignRight" id="wpspos-product-with-variation-add-to-cart" ><?php _e('Add product', 'wpshop'); ?></button>
6 6
 	</div>
7 7
 <?php else : ?>
8
-	<?php _e( 'We are unable to detect the product you want to add to order', 'wps-pos-i18n' ); ?>
8
+	<?php _e('We are unable to detect the product you want to add to order', 'wps-pos-i18n'); ?>
9 9
 <?php endif; ?>
10 10
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,14 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
  if ( !empty( $product_id ) ) : ?>
3 5
 	<?php echo wpshop_products::wpshop_variation( $product_id ); ?>
4 6
 	<div class="wpspos-product-variation-selector" >
5 7
 		<button class="wps-bton-first-mini-rounded alignRight" id="wpspos-product-with-variation-add-to-cart" ><?php _e( 'Add product', 'wpshop'); ?></button>
6 8
 	</div>
7
-<?php else : ?>
8
-	<?php _e( 'We are unable to detect the product you want to add to order', 'wps-pos-i18n' ); ?>
9
+<?php else {
10
+	: ?>
11
+	<?php _e( 'We are unable to detect the product you want to add to order', 'wps-pos-i18n' );
12
+}
13
+?>
9 14
 <?php endif; ?>
10 15
\ No newline at end of file
Please login to merge, or discard this patch.
modules/wps-pos-addon/templates/backend/customers/metabox_title-list.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 	$billing_option = get_option( 'wpshop_billing_address' );
3 5
 	if( !empty( $billing_option ) && is_array( $billing_option ) ) {
4 6
 		$attribute_set_id = $billing_option['choice'];
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
2
-	$billing_option = get_option( 'wpshop_billing_address' );
3
-	if( !empty( $billing_option ) && is_array( $billing_option ) ) {
1
+<?php if (!defined('ABSPATH')) exit;
2
+	$billing_option = get_option('wpshop_billing_address');
3
+	if (!empty($billing_option) && is_array($billing_option)) {
4 4
 		$attribute_set_id = $billing_option['choice'];
5 5
 	} else {
6 6
 		global $wpdb;
7
-		$query = $wpdb->prepare( "SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", __( 'Billing address', 'wpshop' ) );
8
-		$attribute_set_id = $wpdb->get_var( $query );
9
-		if( empty( $attribute_set_id ) ) {
7
+		$query = $wpdb->prepare("SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", __('Billing address', 'wpshop'));
8
+		$attribute_set_id = $wpdb->get_var($query);
9
+		if (empty($attribute_set_id)) {
10 10
 			global $wpdb;
11
-			$query = $wpdb->prepare( "SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", 'Billing address' );
12
-			$attribute_set_id = $wpdb->get_var( $query );
11
+			$query = $wpdb->prepare("SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", 'Billing address');
12
+			$attribute_set_id = $wpdb->get_var($query);
13 13
 		}
14 14
 	}
15 15
 ?>
16 16
 <span class="dashicons dashicons-groups"></span>
17
-<?php _e( 'Customer selection', 'wps-pos-i18n' ); ?>
18
-<a class="thickbox add-new-h2" title="<?php _e( 'New customer creation', 'wps-pos-i18n' ); ?>" href="<?php echo admin_url( 'admin-ajax.php?action=wpspos-customer-quick-creation&_wpnonce=' . wp_create_nonce( 'wps-customer-quick-nonce' ) . '&width=550&height=600&customer_set_id=' . $attribute_set_id ); ?>"><?php _e('Create a customer', 'wps-pos-i18n'); ?></a>
19
-<button type="button" class="wps-bton-third-mini-rounded alignright" id="wps-pos-change-customer" ><?php _e( 'Change customer', 'wps-pos-i18n' ); ?></button>
17
+<?php _e('Customer selection', 'wps-pos-i18n'); ?>
18
+<a class="thickbox add-new-h2" title="<?php _e('New customer creation', 'wps-pos-i18n'); ?>" href="<?php echo admin_url('admin-ajax.php?action=wpspos-customer-quick-creation&_wpnonce=' . wp_create_nonce('wps-customer-quick-nonce') . '&width=550&height=600&customer_set_id=' . $attribute_set_id); ?>"><?php _e('Create a customer', 'wps-pos-i18n'); ?></a>
19
+<button type="button" class="wps-bton-third-mini-rounded alignright" id="wps-pos-change-customer" ><?php _e('Change customer', 'wps-pos-i18n'); ?></button>
Please login to merge, or discard this patch.
modules/wps-pos-addon/templates/backend/customers/customer-not_found.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
2
-	$billing_option = get_option( 'wpshop_billing_address' );
3
-	if( !empty( $billing_option ) && is_array( $billing_option ) ) {
1
+<?php if (!defined('ABSPATH')) exit;
2
+	$billing_option = get_option('wpshop_billing_address');
3
+	if (!empty($billing_option) && is_array($billing_option)) {
4 4
 		$attribute_set_id = $billing_option['choice'];
5 5
 	} else {
6 6
 		global $wpdb;
7
-		$query = $wpdb->prepare( "SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", __( 'Billing address', 'wpshop' ) );
8
-		$attribute_set_id = $wpdb->get_var( $query );
9
-		if( empty( $attribute_set_id ) ) {
7
+		$query = $wpdb->prepare("SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", __('Billing address', 'wpshop'));
8
+		$attribute_set_id = $wpdb->get_var($query);
9
+		if (empty($attribute_set_id)) {
10 10
 			global $wpdb;
11
-			$query = $wpdb->prepare( "SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", 'Billing address' );
12
-			$attribute_set_id = $wpdb->get_var( $query );
11
+			$query = $wpdb->prepare("SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", 'Billing address');
12
+			$attribute_set_id = $wpdb->get_var($query);
13 13
 		}
14 14
 	}
15 15
 ?>
16 16
 	<tr>
17 17
 		<td>
18
-			<?php _e( 'No user has been found for current search.', 'wps-pos-i18n' ); ?>
18
+			<?php _e('No user has been found for current search.', 'wps-pos-i18n'); ?>
19 19
 		</td>
20 20
 		<td>
21
-			<a class="thickbox wps-bton-third-rounded" title="<?php _e( 'New customer creation', 'wps-pos-i18n' ); ?>" href="<?php echo admin_url( 'admin-ajax.php?action=wps-customer-quick-creation&wps-nonce=' . wp_create_nonce( 'wps-customer-quick-nonce' ) . '&width=550&height=600&customer_set_id=' . $attribute_set_id ); ?>"><?php _e('Create a customer', 'wps-pos-i18n'); ?></a>
21
+			<a class="thickbox wps-bton-third-rounded" title="<?php _e('New customer creation', 'wps-pos-i18n'); ?>" href="<?php echo admin_url('admin-ajax.php?action=wps-customer-quick-creation&wps-nonce=' . wp_create_nonce('wps-customer-quick-nonce') . '&width=550&height=600&customer_set_id=' . $attribute_set_id); ?>"><?php _e('Create a customer', 'wps-pos-i18n'); ?></a>
22 22
 		</td>
23 23
 	</tr>
24 24
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 	$billing_option = get_option( 'wpshop_billing_address' );
3 5
 	if( !empty( $billing_option ) && is_array( $billing_option ) ) {
4 6
 		$attribute_set_id = $billing_option['choice'];
Please login to merge, or discard this patch.
modules/wps-pos-addon/templates/backend/customers/metabox-customer.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <div class="wpspos-customer wpspos-customer-selected-container" >
4 4
 <?php
5 5
 	/**	Vérification du choix d'un client pour la commande en cours / Check if there is a customer already selected for current order	*/
6
-	if ( !empty( $_SESSION ) && !empty( $_SESSION[ 'cart' ] ) && !empty( $_SESSION[ 'cart' ][ 'customer_id' ] ) ) {
7
-		$this->display_selected_customer( $_SESSION[ 'cart' ][ 'customer_id' ] );
6
+	if (!empty($_SESSION) && !empty($_SESSION['cart']) && !empty($_SESSION['cart']['customer_id'])) {
7
+		$this->display_selected_customer($_SESSION['cart']['customer_id']);
8 8
 	}
9 9
 	else {
10
-		$response[ 'output' ] = __( 'No customer has been selected, please choose a customer or create a new one before try to create a new order', 'wps-pos-i18n' );
10
+		$response['output'] = __('No customer has been selected, please choose a customer or create a new one before try to create a new order', 'wps-pos-i18n');
11 11
 	}
12 12
 ?>
13 13
 </div>
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,12 +1,13 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 ?>
3 5
 <div class="wpspos-customer wpspos-customer-selected-container" >
4 6
 <?php
5 7
 	/**	Vérification du choix d'un client pour la commande en cours / Check if there is a customer already selected for current order	*/
6 8
 	if ( !empty( $_SESSION ) && !empty( $_SESSION[ 'cart' ] ) && !empty( $_SESSION[ 'cart' ][ 'customer_id' ] ) ) {
7 9
 		$this->display_selected_customer( $_SESSION[ 'cart' ][ 'customer_id' ] );
8
-	}
9
-	else {
10
+	} else {
10 11
 		$response[ 'output' ] = __( 'No customer has been selected, please choose a customer or create a new one before try to create a new order', 'wps-pos-i18n' );
11 12
 	}
12 13
 ?>
Please login to merge, or discard this patch.