Completed
Pull Request — master (#2)
by Jimmy
1216:52 queued 1185:43
created
templates/frontend/checkout_step_indicator/checkout_step_indicator_step.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <div class="<?php echo $step_class; ?>" id="wps-step-indicator-<?php echo $step_id; ?>">
4
-	<?php if( $step_finished && ( $default_step <= ( max( array_keys( $steps ) ) + 1 ) ) ) :
5
-		$url = get_permalink( wpshop_tools::get_page_id($checkout_page_id)  ).( ( !empty($permalink_option) ) ? '?' : '&').'order_step='.$step_id;
4
+	<?php if ($step_finished && ($default_step <= (max(array_keys($steps)) + 1))) :
5
+		$url = get_permalink(wpshop_tools::get_page_id($checkout_page_id)) . ((!empty($permalink_option)) ? '?' : '&') . 'order_step=' . $step_id;
6 6
 		?>
7 7
 		<a href="<?php echo $url; ?>"><i class="wps-circlerounded"><?php echo $step_id; ?></i><span><?php echo $step; ?></span></a>
8 8
 	<?php else : ?>
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,11 +1,16 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 ?>
3 5
 <div class="<?php echo $step_class; ?>" id="wps-step-indicator-<?php echo $step_id; ?>">
4 6
 	<?php if( $step_finished && ( $default_step <= ( max( array_keys( $steps ) ) + 1 ) ) ) :
5 7
 		$url = get_permalink( wpshop_tools::get_page_id($checkout_page_id)  ).( ( !empty($permalink_option) ) ? '?' : '&').'order_step='.$step_id;
6 8
 		?>
7 9
 		<a href="<?php echo $url; ?>"><i class="wps-circlerounded"><?php echo $step_id; ?></i><span><?php echo $step; ?></span></a>
8
-	<?php else : ?>
9
-		<i class="wps-circlerounded"><?php echo $step_id; ?></i><span><?php echo $step; ?></span>
10
+	<?php else {
11
+	: ?>
12
+		<i class="wps-circlerounded"><?php echo $step_id;
13
+}
14
+?></i><span><?php echo $step; ?></span>
10 15
 	<?php endif ?>
11 16
 </div>
12 17
\ No newline at end of file
Please login to merge, or discard this patch.
includes/modules/wps_shipping/wps_shipping.php 2 patches
Spacing   +6 added lines, -6 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
 /**
4 4
  * Cart rules bootstrap file
@@ -12,12 +12,12 @@  discard block
 block discarded – undo
12 12
 
13 13
 /** Template Global vars **/
14 14
 DEFINE('WPS_SHIPPING_MODE_DIR', basename(dirname(__FILE__)));
15
-DEFINE('WPS_SHIPPING_MODE_PATH', str_replace( "\\", "/", str_replace( WPS_SHIPPING_MODE_DIR, "", dirname( __FILE__ ) ) ) );
16
-DEFINE('WPS_SHIPPING_MODE_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', WPS_SHIPPING_MODE_PATH ) );
15
+DEFINE('WPS_SHIPPING_MODE_PATH', str_replace("\\", "/", str_replace(WPS_SHIPPING_MODE_DIR, "", dirname(__FILE__))));
16
+DEFINE('WPS_SHIPPING_MODE_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', WPS_SHIPPING_MODE_PATH));
17 17
 
18
-include( plugin_dir_path( __FILE__ ).'/controller/wps_shipping_ctr.php' );
19
-include( plugin_dir_path( __FILE__ ).'/controller/wps_shipping_mode_ctr.php' );
20
-include( plugin_dir_path( __FILE__ ).'/controller/wps_shipping_mode_ajax_actions.php' );
18
+include(plugin_dir_path(__FILE__) . '/controller/wps_shipping_ctr.php');
19
+include(plugin_dir_path(__FILE__) . '/controller/wps_shipping_mode_ctr.php');
20
+include(plugin_dir_path(__FILE__) . '/controller/wps_shipping_mode_ajax_actions.php');
21 21
 
22 22
 
23 23
 $wps_shipping_mode_ctr = new wps_shipping_mode_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
  * Fichier de définition du modèle des taxinomies / File for term model definition
4 6
  *
Please login to merge, or discard this patch.
includes/modules/wps_shipping/templates/frontend/shipping-infos-summary.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <div class="wps-resume-address">
4
-<?php if( !empty($shipping_content) ) : ?>
4
+<?php if (!empty($shipping_content)) : ?>
5 5
 	<div class="wps-item-resume-address">
6
-		<div class="entry-title"><?php _e( 'Shipping address', 'wpshop')?></div>
6
+		<div class="entry-title"><?php _e('Shipping address', 'wpshop')?></div>
7 7
 		<div class="entry-content">
8 8
 			<?php echo $shipping_content; ?>
9 9
 		</div>
10 10
 	</div>
11 11
 	<?php endif; ?>
12 12
 	<div class="wps-item-resume-address">
13
-		<div class="entry-title"><?php _e( 'Billing address', 'wpshop')?></div>
13
+		<div class="entry-title"><?php _e('Billing address', 'wpshop')?></div>
14 14
 		<div class="entry-content">
15 15
 			<?php echo $billing_content; ?>
16 16
 		</div>
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
  * Fichier de définition du modèle des taxinomies / File for term model definition
4 6
  *
Please login to merge, or discard this patch.
includes/modules/wps_shipping/templates/frontend/shipping-mode-element.php 2 patches
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
  if( !empty( $shipping_mode['active'] ) ) : ?>
3 5
 	<?php
4 6
 	$checked = $class = '';
@@ -10,17 +12,14 @@  discard block
 block discarded – undo
10 12
 	if( !empty($selected_shipping_method) && $shipping_mode_id == $selected_shipping_method ) {
11 13
 		$class = 'wps-activ';
12 14
 		$checked = 'checked="checked"';
13
-	}
14
-	else {
15
+	} else {
15 16
 		if( empty($selected_shipping_method) && ( !empty($shipping_modes) && !empty($shipping_modes['default_choice']) && $shipping_mode_id == $shipping_modes['default_choice'] )  ) {
16 17
 			$checked = 'checked="checked"';
17 18
 			$class = 'wps-activ';
18
-		}
19
-		else if( $count == 0 && empty($selected_shipping_method) ) {
19
+		} else if( $count == 0 && empty($selected_shipping_method) ) {
20 20
 			$checked = 'checked="checked"';
21 21
 			$class = 'wps-activ';
22
-		}
23
-		else {
22
+		} else {
24 23
 			$checked = $class = '';
25 24
 		}
26 25
 	}
@@ -43,8 +42,7 @@  discard block
 block discarded – undo
43 42
 		if ( $order_amount  < $shipping_mode['free_from'] ) {
44 43
 			$free_in = ($shipping_mode['free_from'] - $order_amount);
45 44
 			$shipping_cost .= ' ' . sprintf(__('Free in %s', 'wpshop'), $free_in. ' ' . $currency);
46
-		}
47
-		else {
45
+		} else {
48 46
 			$shipping_cost = '<span class="wps-badge-vert">'.__('Free shipping cost', 'wpshop').'</span>';
49 47
 			$shipping_cost_are_free = true;
50 48
 		}
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
2
- if( !empty( $shipping_mode['active'] ) ) : ?>
1
+<?php if (!defined('ABSPATH')) exit;
2
+ if (!empty($shipping_mode['active'])) : ?>
3 3
 	<?php
4 4
 	$checked = $class = '';
5 5
 
6
-	$selected_shipping_method = ( !empty($_SESSION['shipping_method']) ) ? $_SESSION['shipping_method'] : '';
6
+	$selected_shipping_method = (!empty($_SESSION['shipping_method'])) ? $_SESSION['shipping_method'] : '';
7 7
 
8
-	$count = count( $shipping_modes );
9
-	$shipping_modes = get_option( 'wps_shipping_mode' );
10
-	if( !empty($selected_shipping_method) && $shipping_mode_id == $selected_shipping_method ) {
8
+	$count = count($shipping_modes);
9
+	$shipping_modes = get_option('wps_shipping_mode');
10
+	if (!empty($selected_shipping_method) && $shipping_mode_id == $selected_shipping_method) {
11 11
 		$class = 'wps-activ';
12 12
 		$checked = 'checked="checked"';
13 13
 	}
14 14
 	else {
15
-		if( empty($selected_shipping_method) && ( !empty($shipping_modes) && !empty($shipping_modes['default_choice']) && $shipping_mode_id == $shipping_modes['default_choice'] )  ) {
15
+		if (empty($selected_shipping_method) && (!empty($shipping_modes) && !empty($shipping_modes['default_choice']) && $shipping_mode_id == $shipping_modes['default_choice'])) {
16 16
 			$checked = 'checked="checked"';
17 17
 			$class = 'wps-activ';
18 18
 		}
19
-		else if( $count == 0 && empty($selected_shipping_method) ) {
19
+		else if ($count == 0 && empty($selected_shipping_method)) {
20 20
 			$checked = 'checked="checked"';
21 21
 			$class = 'wps-activ';
22 22
 		}
@@ -28,24 +28,24 @@  discard block
 block discarded – undo
28 28
 	$shipping_cost_are_free = false;
29 29
 	$free_shipping_cost_alert = '';
30 30
 	$currency = wpshop_tools::wpshop_get_currency();
31
-	$cart_items = ( !empty($_SESSION) && !empty($_SESSION['cart']) && !empty($_SESSION['cart']['order_items'])  ) ? $_SESSION['cart']['order_items'] : '';
32
-	$price_piloting = get_option( 'wpshop_shop_price_piloting' );
33
-	if( !empty($cart_items) ) {
31
+	$cart_items = (!empty($_SESSION) && !empty($_SESSION['cart']) && !empty($_SESSION['cart']['order_items'])) ? $_SESSION['cart']['order_items'] : '';
32
+	$price_piloting = get_option('wpshop_shop_price_piloting');
33
+	if (!empty($cart_items)) {
34 34
 		$wps_shipping = new wps_shipping();
35
-		$cart_weight = $wps_shipping->calcul_cart_weight( $cart_items );
36
-		$total_cart_ht_or_ttc_regarding_config = ( !empty($price_piloting) && $price_piloting == 'HT' )  ? $_SESSION['cart']['order_total_ht'] : $_SESSION['cart']['order_total_ttc'];
37
-		$total_shipping_cost_for_products = $wps_shipping->calcul_cart_items_shipping_cost( $cart_items );
38
-		$shipping_cost = $wps_shipping->get_shipping_cost( count( $cart_items ), $total_cart_ht_or_ttc_regarding_config, $total_shipping_cost_for_products, $cart_weight, $shipping_mode_id ).' '.$currency;
35
+		$cart_weight = $wps_shipping->calcul_cart_weight($cart_items);
36
+		$total_cart_ht_or_ttc_regarding_config = (!empty($price_piloting) && $price_piloting == 'HT') ? $_SESSION['cart']['order_total_ht'] : $_SESSION['cart']['order_total_ttc'];
37
+		$total_shipping_cost_for_products = $wps_shipping->calcul_cart_items_shipping_cost($cart_items);
38
+		$shipping_cost = $wps_shipping->get_shipping_cost(count($cart_items), $total_cart_ht_or_ttc_regarding_config, $total_shipping_cost_for_products, $cart_weight, $shipping_mode_id) . ' ' . $currency;
39 39
 	}
40 40
 
41
-	if (  !empty($shipping_mode['free_from']) ) {
42
-		$order_amount = ( !empty($price_piloting_option) && $price_piloting_option == 'HT' ) ? number_format((float)$_SESSION['cart']['order_total_ht'], 2, '.', '') : number_format((float)$_SESSION['cart']['order_total_ttc'], 2, '.', '');
43
-		if ( $order_amount  < $shipping_mode['free_from'] ) {
41
+	if (!empty($shipping_mode['free_from'])) {
42
+		$order_amount = (!empty($price_piloting_option) && $price_piloting_option == 'HT') ? number_format((float)$_SESSION['cart']['order_total_ht'], 2, '.', '') : number_format((float)$_SESSION['cart']['order_total_ttc'], 2, '.', '');
43
+		if ($order_amount < $shipping_mode['free_from']) {
44 44
 			$free_in = ($shipping_mode['free_from'] - $order_amount);
45
-			$shipping_cost .= ' ' . sprintf(__('Free in %s', 'wpshop'), $free_in. ' ' . $currency);
45
+			$shipping_cost .= ' ' . sprintf(__('Free in %s', 'wpshop'), $free_in . ' ' . $currency);
46 46
 		}
47 47
 		else {
48
-			$shipping_cost = '<span class="wps-badge-vert">'.__('Free shipping cost', 'wpshop').'</span>';
48
+			$shipping_cost = '<span class="wps-badge-vert">' . __('Free shipping cost', 'wpshop') . '</span>';
49 49
 			$shipping_cost_are_free = true;
50 50
 		}
51 51
 	}
@@ -55,24 +55,24 @@  discard block
 block discarded – undo
55 55
 
56 56
 
57 57
 	<li class="<?php echo $class; ?> wps-bloc-loader">
58
-			<span><input type="radio" name="wps-shipping-method" data-nonce="<?php echo wp_create_nonce( 'wps_calculate_shipping_cost' ); ?>" value="<?php echo $shipping_mode_id; ?>" id="<?php echo $shipping_mode_id ; ?>" <?php echo $checked; ?> /> <?php apply_filters( 'wps-extra-fields-'.$shipping_mode_id, '' ); ?></span>
58
+			<span><input type="radio" name="wps-shipping-method" data-nonce="<?php echo wp_create_nonce('wps_calculate_shipping_cost'); ?>" value="<?php echo $shipping_mode_id; ?>" id="<?php echo $shipping_mode_id; ?>" <?php echo $checked; ?> /> <?php apply_filters('wps-extra-fields-' . $shipping_mode_id, ''); ?></span>
59 59
 
60
-			<?php echo ( !empty($shipping_mode['logo']) ? '<span class="wps-shipping-method-logo">'.wp_get_attachment_image( $shipping_mode['logo'], 'thumbnail' ).'</span>': '' ); ?>
60
+			<?php echo (!empty($shipping_mode['logo']) ? '<span class="wps-shipping-method-logo">' . wp_get_attachment_image($shipping_mode['logo'], 'thumbnail') . '</span>' : ''); ?>
61 61
 
62
-			<span class="wps-shipping-method-name"><strong><?php _e( $shipping_mode['name'], 'wpshop' ); ?></strong></span>
62
+			<span class="wps-shipping-method-name"><strong><?php _e($shipping_mode['name'], 'wpshop'); ?></strong></span>
63 63
 			<span class="alignright">
64
-				<?php if ( false === $shipping_cost_are_free ) : _e('Cost of postage ', 'wpshop'); endif; ?>
64
+				<?php if (false === $shipping_cost_are_free) : _e('Cost of postage ', 'wpshop'); endif; ?>
65 65
 				<?php echo $shipping_cost; ?>
66
-				<?php if ( false === $shipping_cost_are_free ) : echo $price_piloting; endif; ?>
66
+				<?php if (false === $shipping_cost_are_free) : echo $price_piloting; endif; ?>
67 67
 			</span>
68 68
 
69
-			<div class="wps-shipping-method-explanation"><?php if( !empty( $shipping_mode['explanation'] ) ) :
70
-				_e( $shipping_mode['explanation'], 'wpshop' );
69
+			<div class="wps-shipping-method-explanation"><?php if (!empty($shipping_mode['explanation'])) :
70
+				_e($shipping_mode['explanation'], 'wpshop');
71 71
 			endif; ?></div>
72
-			<div id="container_<?php echo $shipping_mode_id ; ?>" >
72
+			<div id="container_<?php echo $shipping_mode_id; ?>" >
73 73
 			<?php
74 74
 				$result_filter = apply_filters('wps_shipping_mode_additional_content', $shipping_mode_id);
75
-				if($result_filter != $shipping_mode_id) {
75
+				if ($result_filter != $shipping_mode_id) {
76 76
 					echo $result_filter;
77 77
 				}
78 78
 			?></div>
Please login to merge, or discard this patch.
includes/modules/wps_shipping/templates/backend/shipping-modes.php 2 patches
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
  if( !empty($shipping_mode_option) && !empty($shipping_mode_option['modes']) ) : ?>
3 5
 <div class="wps-alert-error" id="wps_shipping_config_save_message" style="display : none"><span class="dashicons dashicons-info"></span> <?php _e( 'Process saving, please wait...', 'wpshop'); ?></div>
4 6
 <div class="wps-alert-info"><span class="dashicons dashicons-lightbulb"></span> <?php printf( __( 'Offer a new shipping service to your customer with <a href="%s" target="_blank">So Colissimo or another shipping mode</a>', 'wpshop'), 'http://shop.eoxia.com/boutique/shop/modules-wpshop/modules-de-livraison/'); ?></div>
@@ -18,6 +20,9 @@  discard block
 block discarded – undo
18 20
 	endforeach; ?>
19 21
 </div>
20 22
 <div><a class="wps-bton-mini-rounded-fourth wps_create_new_shipping_mode"><i class="wps-icon-pencil"></i> <?php _e( 'Add a new shipping mode', 'wpshop'); ?></a></div>
21
-<?php else : ?>
22
-	<div class="wps-alert-info"><?php _e( 'No shipping mode available', 'wpshop'); ?></div>
23
+<?php else {
24
+	: ?>
25
+	<div class="wps-alert-info"><?php _e( 'No shipping mode available', 'wpshop');
26
+}
27
+?></div>
23 28
 <?php endif; ?>
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
2
- if( !empty($shipping_mode_option) && !empty($shipping_mode_option['modes']) ) : ?>
3
-<div class="wps-alert-error" id="wps_shipping_config_save_message" style="display : none"><span class="dashicons dashicons-info"></span> <?php _e( 'Process saving, please wait...', 'wpshop'); ?></div>
4
-<div class="wps-alert-info"><span class="dashicons dashicons-lightbulb"></span> <?php printf( __( 'Offer a new shipping service to your customer with <a href="%s" target="_blank">So Colissimo or another shipping mode</a>', 'wpshop'), 'http://shop.eoxia.com/boutique/shop/modules-wpshop/modules-de-livraison/'); ?></div>
1
+<?php if (!defined('ABSPATH')) exit;
2
+ if (!empty($shipping_mode_option) && !empty($shipping_mode_option['modes'])) : ?>
3
+<div class="wps-alert-error" id="wps_shipping_config_save_message" style="display : none"><span class="dashicons dashicons-info"></span> <?php _e('Process saving, please wait...', 'wpshop'); ?></div>
4
+<div class="wps-alert-info"><span class="dashicons dashicons-lightbulb"></span> <?php printf(__('Offer a new shipping service to your customer with <a href="%s" target="_blank">So Colissimo or another shipping mode</a>', 'wpshop'), 'http://shop.eoxia.com/boutique/shop/modules-wpshop/modules-de-livraison/'); ?></div>
5 5
 <div class="wps-table" id="wps_shipping_mode_list_container">
6 6
 	<div class="wps-table-header wps-table-row" >
7 7
 			<div class="wps-table-cell"></div>
8
-			<div class="wps-table-cell"><?php _e( 'Logo', 'wpshop'); ?></div>
9
-			<div class="wps-table-cell"><?php _e( 'Shipping mode Name', 'wpshop'); ?></div>
10
-			<div class="wps-table-cell"><?php _e( 'Configure', 'wpshop'); ?></div>
11
-			<div class="wps-table-cell"><?php _e( 'Activate', 'wpshop'); ?></div>
12
-			<div class="wps-table-cell"><?php _e( 'Default shipping mode', 'wpshop'); ?></div>
8
+			<div class="wps-table-cell"><?php _e('Logo', 'wpshop'); ?></div>
9
+			<div class="wps-table-cell"><?php _e('Shipping mode Name', 'wpshop'); ?></div>
10
+			<div class="wps-table-cell"><?php _e('Configure', 'wpshop'); ?></div>
11
+			<div class="wps-table-cell"><?php _e('Activate', 'wpshop'); ?></div>
12
+			<div class="wps-table-cell"><?php _e('Default shipping mode', 'wpshop'); ?></div>
13 13
 	</div>
14
-	<?php foreach( $shipping_mode_option['modes'] as $k => $shipping_mode ) :
15
-		if( $k != 'default_choice' ) :
16
-			require( wpshop_tools::get_template_part( WPS_SHIPPING_MODE_DIR, $this->template_dir, "backend", "shipping-mode") );
14
+	<?php foreach ($shipping_mode_option['modes'] as $k => $shipping_mode) :
15
+		if ($k != 'default_choice') :
16
+			require(wpshop_tools::get_template_part(WPS_SHIPPING_MODE_DIR, $this->template_dir, "backend", "shipping-mode"));
17 17
 		endif;
18 18
 	endforeach; ?>
19 19
 </div>
20
-<div><a data-nonce="<?php echo wp_create_nonce( 'wps_add_new_shipping_mode' ); ?>" class="wps-bton-mini-rounded-fourth wps_create_new_shipping_mode"><i class="wps-icon-pencil"></i> <?php _e( 'Add a new shipping mode', 'wpshop'); ?></a></div>
20
+<div><a data-nonce="<?php echo wp_create_nonce('wps_add_new_shipping_mode'); ?>" class="wps-bton-mini-rounded-fourth wps_create_new_shipping_mode"><i class="wps-icon-pencil"></i> <?php _e('Add a new shipping mode', 'wpshop'); ?></a></div>
21 21
 <?php else : ?>
22
-	<div class="wps-alert-info"><?php _e( 'No shipping mode available', 'wpshop'); ?></div>
22
+	<div class="wps-alert-info"><?php _e('No shipping mode available', 'wpshop'); ?></div>
23 23
 <?php endif; ?>
Please login to merge, or discard this patch.
includes/modules/wps_shipping/templates/backend/order-shipping-infos.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
2
- if( !empty($shipping_method_name) ) : ?>
3
-	<div class="wps-alert-info"><strong><?php _e( 'Selected shipping method', 'wpshop'); ?></strong> : <?php echo $shipping_method_name; ?></div>
1
+<?php if (!defined('ABSPATH')) exit;
2
+ if (!empty($shipping_method_name)) : ?>
3
+	<div class="wps-alert-info"><strong><?php _e('Selected shipping method', 'wpshop'); ?></strong> : <?php echo $shipping_method_name; ?></div>
4 4
 <?php else : ?>
5
-	<div class="wps-alert-info"><?php _e( 'No selected shipping method', 'wpshop'); ?></div>
5
+	<div class="wps-alert-info"><?php _e('No selected shipping method', 'wpshop'); ?></div>
6 6
 <?php endif; ?>
7 7
 
8 8
 <div class="wps-boxed">
9
-	<span class="wps-h5"><?php _e( 'Shipping informations', 'wpshop');?></span>
10
-	<?php if ( !empty($order_postmeta['order_status']) && $order_postmeta['order_status'] != 'shipped' ) : ?>
9
+	<span class="wps-h5"><?php _e('Shipping informations', 'wpshop'); ?></span>
10
+	<?php if (!empty($order_postmeta['order_status']) && $order_postmeta['order_status'] != 'shipped') : ?>
11 11
 			<div><a data-id="<?php echo $order->ID; ?>" class="wps-bton-first-mini-rounded markAsShipped order_<?php echo $order->ID; ?>"><?php _e('Mark as shipped', 'wpshop'); ?></a></div>
12 12
 			<ul id="wps-order-shipping-informations"></ul>
13 13
 	<?php else : ?>
14 14
 		<div>
15 15
 			<ul id="wps-order-shipping-informations">
16
-				<li><strong><?php _e('Order shipping date','wpshop') ?> :</strong><?php echo ( empty($order_postmeta['order_shipping_date']) ? __('Unknow','wpshop') : mysql2date('d F Y H:i:s', $order_postmeta['order_shipping_date'],true) ); ?></li>
17
-				<li><strong><?php _e('Tracking number','wpshop'); ?> :</strong> <?php echo ( !empty($order_postmeta['order_trackingNumber']) ) ? $order_postmeta['order_trackingNumber'] : __('Unknow','wpshop'); ?></li>
18
-				<li><strong><?php _e('Tracking link','wpshop'); ?> :</strong> <?php echo ( !empty($order_postmeta['order_trackingLink']) ) ? $order_postmeta['order_trackingLink'] : __('Unknow','wpshop'); ?></li>
16
+				<li><strong><?php _e('Order shipping date', 'wpshop') ?> :</strong><?php echo (empty($order_postmeta['order_shipping_date']) ? __('Unknow', 'wpshop') : mysql2date('d F Y H:i:s', $order_postmeta['order_shipping_date'], true)); ?></li>
17
+				<li><strong><?php _e('Tracking number', 'wpshop'); ?> :</strong> <?php echo (!empty($order_postmeta['order_trackingNumber'])) ? $order_postmeta['order_trackingNumber'] : __('Unknow', 'wpshop'); ?></li>
18
+				<li><strong><?php _e('Tracking link', 'wpshop'); ?> :</strong> <?php echo (!empty($order_postmeta['order_trackingLink'])) ? $order_postmeta['order_trackingLink'] : __('Unknow', 'wpshop'); ?></li>
19 19
 			</ul>
20 20
 		</div>
21 21
 <?php endif; ?>
22 22
 
23
-<?php if ( !empty($order_postmeta['order_invoice_ref']) ) : ?>
23
+<?php if (!empty($order_postmeta['order_invoice_ref'])) : ?>
24 24
 	<div><a href="<?php echo WPSHOP_TEMPLATES_URL; ?>invoice.php?order_id=<?php echo $order->ID; ?>&invoice_ref=<?php echo $order_postmeta['order_invoice_ref']; ?>&bon_colisage=ok&mode=pdf" target="_blank" class="wps-bton-second-mini-rounded" ><?php _e('Download the product list', 'wpshop'); ?></a></div>
25 25
 <?php endif; ?>
26 26
 </div>
Please login to merge, or discard this patch.
Braces   +13 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,8 +1,13 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
  if( !empty($shipping_method_name) ) : ?>
3 5
 	<div class="wps-alert-info"><strong><?php _e( 'Selected shipping method', 'wpshop'); ?></strong> : <?php echo $shipping_method_name; ?></div>
4
-<?php else : ?>
5
-	<div class="wps-alert-info"><?php _e( 'No selected shipping method', 'wpshop'); ?></div>
6
+<?php else {
7
+	: ?>
8
+	<div class="wps-alert-info"><?php _e( 'No selected shipping method', 'wpshop');
9
+}
10
+?></div>
6 11
 <?php endif; ?>
7 12
 
8 13
 <div class="wps-boxed">
@@ -10,10 +15,13 @@  discard block
 block discarded – undo
10 15
 	<?php if ( !empty($order_postmeta['order_status']) && $order_postmeta['order_status'] != 'shipped' ) : ?>
11 16
 			<div><a data-id="<?php echo $order->ID; ?>" class="wps-bton-first-mini-rounded markAsShipped order_<?php echo $order->ID; ?>"><?php _e('Mark as shipped', 'wpshop'); ?></a></div>
12 17
 			<ul id="wps-order-shipping-informations"></ul>
13
-	<?php else : ?>
18
+	<?php else {
19
+	: ?>
14 20
 		<div>
15 21
 			<ul id="wps-order-shipping-informations">
16
-				<li><strong><?php _e('Order shipping date','wpshop') ?> :</strong><?php echo ( empty($order_postmeta['order_shipping_date']) ? __('Unknow','wpshop') : mysql2date('d F Y H:i:s', $order_postmeta['order_shipping_date'],true) ); ?></li>
22
+				<li><strong><?php _e('Order shipping date','wpshop') ?> :</strong><?php echo ( empty($order_postmeta['order_shipping_date']) ? __('Unknow','wpshop') : mysql2date('d F Y H:i:s', $order_postmeta['order_shipping_date'],true) );
23
+}
24
+?></li>
17 25
 				<li><strong><?php _e('Tracking number','wpshop'); ?> :</strong> <?php echo ( !empty($order_postmeta['order_trackingNumber']) ) ? $order_postmeta['order_trackingNumber'] : __('Unknow','wpshop'); ?></li>
18 26
 				<li><strong><?php _e('Tracking link','wpshop'); ?> :</strong> <?php echo ( !empty($order_postmeta['order_trackingLink']) ) ? $order_postmeta['order_trackingLink'] : __('Unknow','wpshop'); ?></li>
19 27
 			</ul>
Please login to merge, or discard this patch.
includes/modules/wps_shipping/templates/backend/shipping-mode.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if (!defined('ABSPATH')) exit;
2 2
 ?>
3 3
 <div class="wps-table-content wps-table-row wps_shipping_mode_container">
4 4
 		<div class="wps-table-cell wps-cart-item-img">
5 5
 			<div id="wps_shipping_mode_logo_container_<?php echo $k; ?>">
6
-				<?php echo ( !empty($shipping_mode['logo']) ? ( (strstr($shipping_mode['logo'], 'http://') === FALSE ) ? wp_get_attachment_image( $shipping_mode['logo'], 'thumbnail') : '<img src="' .$shipping_mode['logo']. '" alt="" />' ) : '' ); ?>
6
+				<?php echo (!empty($shipping_mode['logo']) ? ((strstr($shipping_mode['logo'], 'http://') === FALSE) ? wp_get_attachment_image($shipping_mode['logo'], 'thumbnail') : '<img src="' . $shipping_mode['logo'] . '" alt="" />') : ''); ?>
7 7
 			</div>
8 8
 		</div>
9 9
 		<div class="wps-table-cell">
10
-			<a class="wps-bton-first-mini-rounded add_logo_to_shipping_mode" id="add_logo_to_shipping_mode_<?php echo $k; ?>" href="#"><?php _e( 'Add a logo', 'wpshop'); ?></a>
11
-			<input type="hidden" name="wps_shipping_mode[modes][<?php echo $k; ?>][logo]"  id="wps_shipping_mode_logo_<?php echo $k; ?>" value="<?php echo ( !empty($shipping_mode['logo']) ) ? $shipping_mode['logo'] : ''; ?>" />
10
+			<a class="wps-bton-first-mini-rounded add_logo_to_shipping_mode" id="add_logo_to_shipping_mode_<?php echo $k; ?>" href="#"><?php _e('Add a logo', 'wpshop'); ?></a>
11
+			<input type="hidden" name="wps_shipping_mode[modes][<?php echo $k; ?>][logo]"  id="wps_shipping_mode_logo_<?php echo $k; ?>" value="<?php echo (!empty($shipping_mode['logo'])) ? $shipping_mode['logo'] : ''; ?>" />
12 12
 		</div>
13 13
 		<div class="wps-table-cell">
14
-			<input type="text" name="wps_shipping_mode[modes][<?php echo $k; ?>][name]" id="wps_shipping_mode_configuration_<?php echo $k; ?>_name" value="<?php echo ( !empty($shipping_mode['name']) ) ? $shipping_mode['name'] : ''; ?>" />
14
+			<input type="text" name="wps_shipping_mode[modes][<?php echo $k; ?>][name]" id="wps_shipping_mode_configuration_<?php echo $k; ?>_name" value="<?php echo (!empty($shipping_mode['name'])) ? $shipping_mode['name'] : ''; ?>" />
15 15
 		</div>
16
-		<div class="wps-table-cell"><a href="#TB_inline?width=780&amp;height=700&amp;inlineId=<?php echo $k; ?>_shipping_configuration_interface" class="thickbox wps-bton-first-mini-rounded" title="<?php _e('Configure the shipping mode', 'wpshop'); ?>" ><?php _e( 'Configure', 'wpshop'); ?></a></div>
17
-		<div class="wps-table-cell"><input type="checkbox" id="wps_shipping_mode_<?php echo $k; ?>" class="wps_shipping_mode_active" name="wps_shipping_mode[modes][<?php echo $k; ?>][active]" <?php echo ( (!empty($shipping_mode) && !empty($shipping_mode['active']) ) ? 'checked="checked"' : '' ); ?> /></div>
18
-		<?php $shipping_mode_option = get_option( 'wps_shipping_mode' ); ?>
19
-		<div class="wps-table-cell"><input type="radio" id="wps_shipping_mode_<?php echo $k; ?>_radio_default" name="wps_shipping_mode[default_choice]" value="<?php echo $k; ?>" <?php echo ( !empty( $shipping_mode_option['default_choice'] ) && $shipping_mode_option['default_choice'] == $k ) ? 'checked="checked"' : ''; echo ( (!empty($shipping_mode) && !empty($shipping_mode['active']) ) ? '' : 'disabled="disabled"' ); ?> /></div>
16
+		<div class="wps-table-cell"><a href="#TB_inline?width=780&amp;height=700&amp;inlineId=<?php echo $k; ?>_shipping_configuration_interface" class="thickbox wps-bton-first-mini-rounded" title="<?php _e('Configure the shipping mode', 'wpshop'); ?>" ><?php _e('Configure', 'wpshop'); ?></a></div>
17
+		<div class="wps-table-cell"><input type="checkbox" id="wps_shipping_mode_<?php echo $k; ?>" class="wps_shipping_mode_active" name="wps_shipping_mode[modes][<?php echo $k; ?>][active]" <?php echo ((!empty($shipping_mode) && !empty($shipping_mode['active'])) ? 'checked="checked"' : ''); ?> /></div>
18
+		<?php $shipping_mode_option = get_option('wps_shipping_mode'); ?>
19
+		<div class="wps-table-cell"><input type="radio" id="wps_shipping_mode_<?php echo $k; ?>_radio_default" name="wps_shipping_mode[default_choice]" value="<?php echo $k; ?>" <?php echo (!empty($shipping_mode_option['default_choice']) && $shipping_mode_option['default_choice'] == $k) ? 'checked="checked"' : ''; echo ((!empty($shipping_mode) && !empty($shipping_mode['active'])) ? '' : 'disabled="disabled"'); ?> /></div>
20 20
 		<!-- Configuration interface -->
21 21
 		<div id="<?php echo $k; ?>_shipping_configuration_interface" style="display : none">	
22 22
 			<?php 
23 23
 			$wps_shipping_mode_ctr = new wps_shipping_mode_ctr();
24
-			echo $wps_shipping_mode_ctr->generate_shipping_mode_interface( $k, $shipping_mode ); ?>
24
+			echo $wps_shipping_mode_ctr->generate_shipping_mode_interface($k, $shipping_mode); ?>
25 25
 		</div>
26 26
 </div>
27 27
\ 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
  * Fichier de définition du modèle des taxinomies / File for term model definition
4 6
  *
Please login to merge, or discard this patch.
includes/modules/wps-modal/wps-modal.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
 
15 15
 	class wps_modal {
16 16
 		/** Define the main directory containing the template for the current plugin
17
-		* @var string
18
-		*/
17
+		 * @var string
18
+		 */
19 19
 		private $template_dir;
20 20
 		/**
21 21
 		 * Define the directory name for the module in order to check into frontend
Please login to merge, or discard this patch.
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
 /**
4 4
  * Bootstrap file
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  * @version 1.0
7 7
  */
8 8
 
9
-if ( !class_exists('wps_modal') ) {
9
+if (!class_exists('wps_modal')) {
10 10
 	/** Template Global vars **/
11 11
 	DEFINE('WPS_MODAL_DIR', basename(dirname(__FILE__)));
12
-	DEFINE('WPS_MODAL_PATH', str_replace( "\\", "/", str_replace( WPS_MODAL_DIR, "", dirname( __FILE__ ) ) ) );
13
-	DEFINE('WPS_MODAL_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', WPS_MODAL_PATH ) );
12
+	DEFINE('WPS_MODAL_PATH', str_replace("\\", "/", str_replace(WPS_MODAL_DIR, "", dirname(__FILE__))));
13
+	DEFINE('WPS_MODAL_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', WPS_MODAL_PATH));
14 14
 
15 15
 	class wps_modal {
16 16
 		/** Define the main directory containing the template for the current plugin
@@ -26,19 +26,19 @@  discard block
 block discarded – undo
26 26
 		function __construct() {
27 27
 			/** Template Load **/
28 28
 			$this->template_dir = WPS_MODAL_PATH . WPS_MODAL_DIR . "/templates/";
29
-			add_action('wp_enqueue_scripts', array( $this, 'add_scripts') );
30
-			add_action( 'wp_footer', array( $this, 'display_modal') );
29
+			add_action('wp_enqueue_scripts', array($this, 'add_scripts'));
30
+			add_action('wp_footer', array($this, 'display_modal'));
31 31
 		}
32 32
 
33 33
 		function add_scripts() {
34
-			wp_enqueue_script( 'jquery' );
35
-			wp_enqueue_script( 'wps_modal_script', plugins_url( 'assets/js/wps_modal.js' , __FILE__ ) );
34
+			wp_enqueue_script('jquery');
35
+			wp_enqueue_script('wps_modal_script', plugins_url('assets/js/wps_modal.js', __FILE__));
36 36
 		}
37 37
 
38 38
 		function display_modal() {
39 39
 			$output = '';
40 40
 			ob_start();
41
-			require_once( wpshop_tools::get_template_part( WPS_MODAL_DIR, $this->template_dir, "frontend", "modal") );
41
+			require_once(wpshop_tools::get_template_part(WPS_MODAL_DIR, $this->template_dir, "frontend", "modal"));
42 42
 			$output = ob_get_contents();
43 43
 			ob_end_clean();
44 44
 			echo $output;
@@ -46,6 +46,6 @@  discard block
 block discarded – undo
46 46
 	}
47 47
 
48 48
 }
49
-if ( class_exists('wps_modal') ) {
49
+if (class_exists('wps_modal')) {
50 50
 	$wps_modal = new wps_modal();
51 51
 }
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
  * Fichier de définition du modèle des taxinomies / File for term model definition
4 6
  *
Please login to merge, or discard this patch.
includes/modules/wps_dashboard/config/config.php 2 patches
Spacing   +6 added lines, -6 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
  * Main plugin configuration file
4 4
  *
@@ -9,16 +9,16 @@  discard block
 block discarded – undo
9 9
  */
10 10
 
11 11
 /** Check if the plugin version is defined. If not defined script will be stopped here	*/
12
-if ( !defined( 'WPS_DASHBOARD_VERSION' ) ) {
13
-	die( __("You are not allowed to use this service.", 'wps_installer') );
12
+if (!defined('WPS_DASHBOARD_VERSION')) {
13
+	die(__("You are not allowed to use this service.", 'wps_installer'));
14 14
 }
15 15
 
16 16
 /** Define librairies directory */
17
-DEFINE( 'WPSDASHBOARD_LIBS_DIR', plugin_dir_path( __FILE__ ) . '/' . WPS_DASHBOARD_DIR . '/');
17
+DEFINE('WPSDASHBOARD_LIBS_DIR', plugin_dir_path(__FILE__) . '/' . WPS_DASHBOARD_DIR . '/');
18 18
 
19 19
 /** Define template directory */
20
-DEFINE( 'WPSDASHBOARD_TPL_DIR', WPS_DASHBOARD_PATH . WPS_DASHBOARD_DIR . '/templates/');
21
-DEFINE( 'WPSDASHBOARD_TPL_URL', WPS_DASHBOARD_URL . WPS_DASHBOARD_DIR . '/templates/');
20
+DEFINE('WPSDASHBOARD_TPL_DIR', WPS_DASHBOARD_PATH . WPS_DASHBOARD_DIR . '/templates/');
21
+DEFINE('WPSDASHBOARD_TPL_URL', WPS_DASHBOARD_URL . WPS_DASHBOARD_DIR . '/templates/');
22 22
 
23 23
 
24 24
 ?>
25 25
\ 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
  * Fichier de définition du modèle des taxinomies / File for term model definition
4 6
  *
Please login to merge, or discard this patch.