Completed
Branch 2.0.0 (814c19)
by Jimmy
03:05
created
modules/settings/view/emails.view.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,24 +14,24 @@
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19 19
 <table class="wpeo-table">
20 20
 	<thead>
21 21
 		<tr>
22
-			<th><?php esc_html_e( 'E-mail', 'wpshop' ); ?></th>
22
+			<th><?php esc_html_e('E-mail', 'wpshop'); ?></th>
23 23
 			<th></th>
24 24
 		</tr>
25 25
 	</thead>
26 26
 	<tbody>
27 27
 		<?php
28
-		if ( ! empty( $emails ) ) :
29
-			foreach ( $emails as $key => $email ) :
28
+		if (!empty($emails)) :
29
+			foreach ($emails as $key => $email) :
30 30
 				?>
31 31
 				<tr>
32 32
 					<td><?php echo $email['title']; ?></td>
33 33
 					<td>
34
-						<a href="<?php echo admin_url( 'admin-post.php?action=wps_load_settings_tab&_wpnonce=' . wp_create_nonce( 'callback_load_tab' ) . '&page=wps-settings&tab=emails&section=' . $key ); ?>" class="wpeo-button button-main">
34
+						<a href="<?php echo admin_url('admin-post.php?action=wps_load_settings_tab&_wpnonce=' . wp_create_nonce('callback_load_tab') . '&page=wps-settings&tab=emails&section=' . $key); ?>" class="wpeo-button button-main">
35 35
 							<span>Gérer</span>
36 36
 						</a>
37 37
 					</td>
Please login to merge, or discard this patch.
modules/settings/view/email-single.view.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19
-<h3><a href="<?php echo admin_url( 'admin.php?page=wps-settings&tab=emails' ); ?>">Emails</a> -> <?php echo $email['title']; ?></h3>
19
+<h3><a href="<?php echo admin_url('admin.php?page=wps-settings&tab=emails'); ?>">Emails</a> -> <?php echo $email['title']; ?></h3>
20 20
 
21 21
 <p>
22 22
 	<?php
23
-	if ( $is_override ) :
23
+	if ($is_override) :
24 24
 		?>
25 25
 		Déjà override
26 26
 		<?php
@@ -32,17 +32,17 @@  discard block
 block discarded – undo
32 32
 	?>
33 33
 </p>
34 34
 
35
-<a href="<?php echo esc_attr( admin_url( 'admin-post.php?action=wps_copy_email_template&_wpnonce=' . wp_create_nonce( 'callback_copy_email_template' ) . '&section=' . $section ) ); ?>" class="wpeo-button button-light">
35
+<a href="<?php echo esc_attr(admin_url('admin-post.php?action=wps_copy_email_template&_wpnonce=' . wp_create_nonce('callback_copy_email_template') . '&section=' . $section)); ?>" class="wpeo-button button-light">
36 36
 	<span>Copié le modèle</span>
37 37
 </a>
38 38
 
39
-<form method="POST" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" class="wpeo-form">
39
+<form method="POST" action="<?php echo esc_url(admin_url('admin-post.php')); ?>" class="wpeo-form">
40 40
 	<input type="hidden" name="action" value="wps_update_email" />
41 41
 	<input type="hidden" name="tab" value="emails" />
42 42
 	<input type="hidden" name="section" value="<?php echo $section; ?>" />
43 43
 
44 44
 	<div class="form-element">
45
-		<textarea name="content" cols="25" <?php echo ! $is_override ? 'readonly="readonly"' : ''; ?> rows="20" class="form-field"><?php echo $content; ?></textarea>
45
+		<textarea name="content" cols="25" <?php echo !$is_override ? 'readonly="readonly"' : ''; ?> rows="20" class="form-field"><?php echo $content; ?></textarea>
46 46
 	</div>
47 47
 
48 48
 	<input type="submit" class="wpeo-button button-main" value="Enregister les modifications" />
Please login to merge, or discard this patch.
modules/settings/view/payment-method-single-form.view.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,21 +16,21 @@
 block discarded – undo
16 16
 
17 17
 namespace wpshop;
18 18
 
19
-defined( 'ABSPATH' ) || exit; ?>
19
+defined('ABSPATH') || exit; ?>
20 20
 
21
-<form class="wpeo-form" action="<?php echo admin_url( 'admin-post.php' ); ?>" method="POST">
21
+<form class="wpeo-form" action="<?php echo admin_url('admin-post.php'); ?>" method="POST">
22 22
 	<input type="hidden" name="action" value="wps_update_method_payment_payment_in_shop" />
23
-	<?php wp_nonce_field( 'update_method_payment_in_shop' ); ?>
23
+	<?php wp_nonce_field('update_method_payment_in_shop'); ?>
24 24
 
25 25
 	<div class="form-element">
26
-		<span class="form-label"><?php esc_html_e( 'Title', 'wpshop' ); ?></span>
26
+		<span class="form-label"><?php esc_html_e('Title', 'wpshop'); ?></span>
27 27
 		<label class="form-field-container">
28
-			<input type="text" class="form-field" name="title" value="<?php echo esc_attr( $payment_data['title'] ); ?>" />
28
+			<input type="text" class="form-field" name="title" value="<?php echo esc_attr($payment_data['title']); ?>" />
29 29
 		</label>
30 30
 	</div>
31 31
 
32 32
 	<div class="form-element">
33
-		<span class="form-label"><?php esc_html_e( 'Description', 'wpshop' ); ?></span>
33
+		<span class="form-label"><?php esc_html_e('Description', 'wpshop'); ?></span>
34 34
 		<label class="form-field-container">
35 35
 			<textarea name="description" class="form-field" rows="3" cols="20"><?php echo $payment_data['description']; ?></textarea>
36 36
 		</label>
Please login to merge, or discard this patch.
modules/settings/view/shipping-cost.view.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,28 +14,28 @@  discard block
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19 19
 
20
-<form class="wpeo-form" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" method="POST">
21
-	<input type="hidden" name="action" value="<?php echo esc_attr( 'wps_update_shipping_cost' ); ?>" />
20
+<form class="wpeo-form" action="<?php echo esc_url(admin_url('admin-post.php')); ?>" method="POST">
21
+	<input type="hidden" name="action" value="<?php echo esc_attr('wps_update_shipping_cost'); ?>" />
22 22
 	<input type="hidden" name="tab" value="shipping_cost" />
23
-	<?php wp_nonce_field( 'callback_update_shipping_cost' ); ?>
23
+	<?php wp_nonce_field('callback_update_shipping_cost'); ?>
24 24
 
25 25
 	<div class="form-element">
26
-		<span class="form-label"><?php esc_html_e( 'Select shipping product', 'wpshop' ); ?></span>
26
+		<span class="form-label"><?php esc_html_e('Select shipping product', 'wpshop'); ?></span>
27 27
 		<label class="form-field-container">
28 28
 			<select name="shipping_product_id" class="form-field">
29 29
 				<?php
30
-				if ( ! empty( $products ) ) :
31
-					foreach ( $products as $product ) :
30
+				if (!empty($products)) :
31
+					foreach ($products as $product) :
32 32
 						$selected = '';
33 33
 
34
-						if ( $product->data['id'] == $shipping_cost_option['shipping_product_id'] ) :
34
+						if ($product->data['id'] == $shipping_cost_option['shipping_product_id']) :
35 35
 							$selected = 'selected="selected"';
36 36
 						endif;
37 37
 						?>
38
-						<option <?php echo $selected; ?> value="<?php echo esc_attr( $product->data['id'] ); ?>"><?php echo esc_html( $product->data['title'] ); ?></option>
38
+						<option <?php echo $selected; ?> value="<?php echo esc_attr($product->data['id']); ?>"><?php echo esc_html($product->data['title']); ?></option>
39 39
 						<?php
40 40
 					endforeach;
41 41
 				endif;
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 	</div>
46 46
 
47 47
 	<div class="form-element">
48
-		<span class="form-label"><?php esc_html_e( 'Free delivery starting from (€) HT', 'wpshop' ); ?></span>
48
+		<span class="form-label"><?php esc_html_e('Free delivery starting from (€) HT', 'wpshop'); ?></span>
49 49
 		<label class="form-field-container">
50
-			<input type="text" name="from_price_ht" class="form-field" placeholder="00.00" value="<?php echo esc_attr( $shipping_cost_option['from_price_ht'] ); ?>" />
50
+			<input type="text" name="from_price_ht" class="form-field" placeholder="00.00" value="<?php echo esc_attr($shipping_cost_option['from_price_ht']); ?>" />
51 51
 		</label>
52 52
 	</div>
53 53
 
Please login to merge, or discard this patch.
modules/settings/view/general.view.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,31 +14,31 @@
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19
-<form class="wpeo-form" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" method="POST">
20
-	<input type="hidden" name="action" value="<?php echo esc_attr( 'wps_update_general_settings' ); ?>" />
19
+<form class="wpeo-form" action="<?php echo esc_url(admin_url('admin-post.php')); ?>" method="POST">
20
+	<input type="hidden" name="action" value="<?php echo esc_attr('wps_update_general_settings'); ?>" />
21 21
 	<input type="hidden" name="tab" value="general" />
22
-	<?php wp_nonce_field( 'callback_update_general_settings' ); ?>
22
+	<?php wp_nonce_field('callback_update_general_settings'); ?>
23 23
 
24 24
 	<div class="form-element">
25 25
 		<span class="form-label">Dolibarr URL</span>
26 26
 		<label class="form-field-container">
27
-			<input type="text" class="form-field" name="dolibarr_url" value="<?php echo esc_attr( $dolibarr_option['dolibarr_url'] ); ?>" />
27
+			<input type="text" class="form-field" name="dolibarr_url" value="<?php echo esc_attr($dolibarr_option['dolibarr_url']); ?>" />
28 28
 		</label>
29 29
 	</div>
30 30
 
31 31
 	<div class="form-element">
32 32
 		<span class="form-label">Dolibarr Secret</span>
33 33
 		<label class="form-field-container">
34
-			<input type="text" class="form-field" name="dolibarr_secret" value="<?php echo esc_attr( $dolibarr_option['dolibarr_secret'] ); ?>" />
34
+			<input type="text" class="form-field" name="dolibarr_secret" value="<?php echo esc_attr($dolibarr_option['dolibarr_secret']); ?>" />
35 35
 		</label>
36 36
 	</div>
37 37
 
38 38
 	<div class="form-element">
39 39
 		<span class="form-label">Email de la boutique</span>
40 40
 		<label class="form-field-container">
41
-			<input type="text" class="form-field" name="shop_email" value="<?php echo esc_attr( $dolibarr_option['shop_email'] ); ?>" />
41
+			<input type="text" class="form-field" name="shop_email" value="<?php echo esc_attr($dolibarr_option['shop_email']); ?>" />
42 42
 		</label>
43 43
 	</div>
44 44
 
Please login to merge, or discard this patch.
modules/settings/view/main.view.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19 19
 <div class="wrap">
20
-	<h2><?php esc_html_e( 'Settings', 'wpshop' ); ?></h2>
20
+	<h2><?php esc_html_e('Settings', 'wpshop'); ?></h2>
21 21
 
22 22
 	<?php
23
-	if ( ! empty( $transient ) ) :
23
+	if (!empty($transient)) :
24 24
 		?>
25 25
 		<div class="notice notice-success is-dismissible">
26 26
 			<p><?php echo $transient; ?></p>
@@ -31,16 +31,16 @@  discard block
 block discarded – undo
31 31
 
32 32
 	<div class="wpeo-tab">
33 33
 		<ul class="tab-list">
34
-			<a href="<?php echo esc_url( admin_url( 'admin-post.php?action=wps_load_settings_tab&_wpnonce=' . wp_create_nonce( 'callback_load_tab' ) . '&tab=general' ) ); ?>" class="tab-element <?php echo ( 'general' === $tab ) ? 'tab-active' : ''; ?>"><?php esc_html_e( 'General', 'wpshop' ); ?></a>
35
-			<a href="<?php echo esc_url( admin_url( 'admin-post.php?action=wps_load_settings_tab&_wpnonce=' . wp_create_nonce( 'callback_load_tab' ) . '&tab=pages' ) ); ?>" class="tab-element <?php echo ( 'pages' === $tab ) ? 'tab-active' : ''; ?>"><?php esc_html_e( 'Pages', 'wpshop' ); ?></a>
36
-			<a href="<?php echo esc_url( admin_url( 'admin-post.php?action=wps_load_settings_tab&_wpnonce=' . wp_create_nonce( 'callback_load_tab' ) . '&tab=emails' ) ); ?>" class="tab-element <?php echo ( 'emails' === $tab ) ? 'tab-active' : ''; ?>"><?php esc_html_e( 'Emails', 'wpshop' ); ?></a>
37
-			<a href="<?php echo esc_url( admin_url( 'admin-post.php?action=wps_load_settings_tab&_wpnonce=' . wp_create_nonce( 'callback_load_tab' ) . '&tab=payment_method' ) ); ?>" class="tab-element <?php echo ( 'payment_method' === $tab ) ? 'tab-active' : ''; ?>"><?php esc_html_e( 'Payment method', 'wpshop' ); ?></a>
38
-			<a href="<?php echo esc_url( admin_url( 'admin-post.php?action=wps_load_settings_tab&_wpnonce=' . wp_create_nonce( 'callback_load_tab' ) . '&tab=shipping_cost' ) ); ?>" class="tab-element <?php echo ( 'shipping_cost' === $tab ) ? 'tab-active' : ''; ?>"><?php esc_html_e( 'Shipping cost', 'wpshop' ); ?></a>
34
+			<a href="<?php echo esc_url(admin_url('admin-post.php?action=wps_load_settings_tab&_wpnonce=' . wp_create_nonce('callback_load_tab') . '&tab=general')); ?>" class="tab-element <?php echo ('general' === $tab) ? 'tab-active' : ''; ?>"><?php esc_html_e('General', 'wpshop'); ?></a>
35
+			<a href="<?php echo esc_url(admin_url('admin-post.php?action=wps_load_settings_tab&_wpnonce=' . wp_create_nonce('callback_load_tab') . '&tab=pages')); ?>" class="tab-element <?php echo ('pages' === $tab) ? 'tab-active' : ''; ?>"><?php esc_html_e('Pages', 'wpshop'); ?></a>
36
+			<a href="<?php echo esc_url(admin_url('admin-post.php?action=wps_load_settings_tab&_wpnonce=' . wp_create_nonce('callback_load_tab') . '&tab=emails')); ?>" class="tab-element <?php echo ('emails' === $tab) ? 'tab-active' : ''; ?>"><?php esc_html_e('Emails', 'wpshop'); ?></a>
37
+			<a href="<?php echo esc_url(admin_url('admin-post.php?action=wps_load_settings_tab&_wpnonce=' . wp_create_nonce('callback_load_tab') . '&tab=payment_method')); ?>" class="tab-element <?php echo ('payment_method' === $tab) ? 'tab-active' : ''; ?>"><?php esc_html_e('Payment method', 'wpshop'); ?></a>
38
+			<a href="<?php echo esc_url(admin_url('admin-post.php?action=wps_load_settings_tab&_wpnonce=' . wp_create_nonce('callback_load_tab') . '&tab=shipping_cost')); ?>" class="tab-element <?php echo ('shipping_cost' === $tab) ? 'tab-active' : ''; ?>"><?php esc_html_e('Shipping cost', 'wpshop'); ?></a>
39 39
 		</ul>
40 40
 
41 41
 		<div class="tab-container">
42 42
 			<div class="tab-content tab-active">
43
-				<?php call_user_func( array( Settings::g(), 'display_' . $tab ), $section ); ?>
43
+				<?php call_user_func(array(Settings::g(), 'display_' . $tab), $section); ?>
44 44
 			</div>
45 45
 		</div>
46 46
 	</div>
Please login to merge, or discard this patch.
modules/emails/action/class-emails-action.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit;
17
+defined('ABSPATH') || exit;
18 18
 
19 19
 /**
20 20
  * Emails Action Class.
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
 	 * @since 2.0.0
28 28
 	 */
29 29
 	public function __construct() {
30
-		add_action( 'admin_post_wps_copy_email_template', array( $this, 'callback_copy_email_template' ) );
30
+		add_action('admin_post_wps_copy_email_template', array($this, 'callback_copy_email_template'));
31 31
 
32
-		add_action( 'wps_email_order_details', array( $this, 'order_details' ) );
33
-		add_action( 'wps_email_order_details', array( $this, 'type_payment' ), 20, 1 );
32
+		add_action('wps_email_order_details', array($this, 'order_details'));
33
+		add_action('wps_email_order_details', array($this, 'type_payment'), 20, 1);
34 34
 	}
35 35
 
36 36
 	/**
@@ -39,19 +39,19 @@  discard block
 block discarded – undo
39 39
 	 * @since 2.0.0
40 40
 	 */
41 41
 	public function callback_copy_email_template() {
42
-		check_admin_referer( 'callback_copy_email_template' );
42
+		check_admin_referer('callback_copy_email_template');
43 43
 
44 44
 		$tab          = 'emails';
45
-		$section      = ! empty( $_GET['section'] ) ? sanitize_text_field( $_GET['section'] ) : '';
46
-		$email        = Emails::g()->emails[ $section ];
45
+		$section      = !empty($_GET['section']) ? sanitize_text_field($_GET['section']) : '';
46
+		$email        = Emails::g()->emails[$section];
47 47
 		$file_to_copy = \eoxia\Config_Util::$init['wpshop']->emails->path . '/view/' . $email['filename_template'];
48 48
 		$path         = get_template_directory() . '/wpshop/emails/view/' . $email['filename_template'];
49 49
 
50
-		if ( wp_mkdir_p( dirname( $path ) ) && ! file_exists( $path ) ) {
51
-			copy( $file_to_copy, $path );
50
+		if (wp_mkdir_p(dirname($path)) && !file_exists($path)) {
51
+			copy($file_to_copy, $path);
52 52
 		}
53 53
 
54
-		wp_redirect( admin_url( 'admin.php?page=wps-settings&tab= ' . $tab . '&section=' . $section ) );
54
+		wp_redirect(admin_url('admin.php?page=wps-settings&tab= ' . $tab . '&section=' . $section));
55 55
 	}
56 56
 
57 57
 	/**
@@ -64,29 +64,29 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @param Order_Model $order Les données de la commande.
66 66
 	 */
67
-	public function order_details( $order ) {
67
+	public function order_details($order) {
68 68
 		$tva_lines = array();
69 69
 
70
-		if ( ! empty( $order->lines ) ) {
71
-			foreach ( $order->lines as &$line ) {
72
-				if ( empty( $tva_lines[ $line->tva_tx ] ) ) {
73
-					$tva_lines[ $line->tva_tx ] = 0;
70
+		if (!empty($order->lines)) {
71
+			foreach ($order->lines as &$line) {
72
+				if (empty($tva_lines[$line->tva_tx])) {
73
+					$tva_lines[$line->tva_tx] = 0;
74 74
 				}
75 75
 
76
-				$tva_lines[ $line->tva_tx ] += $line->total_tva;
76
+				$tva_lines[$line->tva_tx] += $line->total_tva;
77 77
 
78
-				$wp_product = Product::g()->get( array(
78
+				$wp_product = Product::g()->get(array(
79 79
 					'meta_key'   => '_external_id',
80
-					'meta_value' => (int) $line->fk_product,
81
-				), true );
80
+					'meta_value' => (int)$line->fk_product,
81
+				), true);
82 82
 
83 83
 				$line->wp_id = $wp_product->data['id'];
84 84
 			}
85 85
 		}
86 86
 
87
-		unset( $line );
87
+		unset($line);
88 88
 
89
-		include( Template_Util::get_template_part( 'emails', 'order-details' ) );
89
+		include(Template_Util::get_template_part('emails', 'order-details'));
90 90
 	}
91 91
 
92 92
 	/**
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 	 *
100 100
 	 * @param Order_Model $order Les données de la commande.
101 101
 	 */
102
-	public function type_payment( $order ) {
103
-		$payment_methods = get_option( 'wps_payment_methods', Payment::g()->default_options );
102
+	public function type_payment($order) {
103
+		$payment_methods = get_option('wps_payment_methods', Payment::g()->default_options);
104 104
 
105
-		include( Template_Util::get_template_part( 'emails', 'type-payment' ) );
105
+		include(Template_Util::get_template_part('emails', 'type-payment'));
106 106
 	}
107 107
 }
108 108
 
Please login to merge, or discard this patch.
modules/emails/view/customer-new-account.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -16,37 +16,37 @@
 block discarded – undo
16 16
 
17 17
 namespace wpshop;
18 18
 
19
-defined( 'ABSPATH' ) || exit;
19
+defined('ABSPATH') || exit;
20 20
 
21
-do_action( 'wps_email_header' );  ?>
21
+do_action('wps_email_header'); ?>
22 22
 
23 23
 <p>
24 24
 	<?php
25 25
 	/* translators: %s Customer username */
26
-	printf( esc_html__( 'Hi %s,', 'wpshop' ), esc_html( $data['contact']['login'] ) );
26
+	printf(esc_html__('Hi %s,', 'wpshop'), esc_html($data['contact']['login']));
27 27
 	?>
28 28
 </p>
29 29
 <p>
30 30
 	<?php
31 31
 	/* translators: %1$s: Site title, %2$s: Username, %3$s: My account link */
32
-	printf( __( 'Thanks for creating an account on %1$s. Your username is %2$s. You can access your account area to view orders, change your password, and more at: <a target="_blank" href="%3$s">%4$s</a>', 'wpshop' ), array(
32
+	printf(__('Thanks for creating an account on %1$s. Your username is %2$s. You can access your account area to view orders, change your password, and more at: <a target="_blank" href="%3$s">%4$s</a>', 'wpshop'), array(
33 33
 		get_bloginfo(),
34
-		'<strong>' . esc_html( $data['contact']['login'] ) . '</strong>',
35
-		esc_url( Pages::g()->get_account_link() ),
34
+		'<strong>' . esc_html($data['contact']['login']) . '</strong>',
35
+		esc_url(Pages::g()->get_account_link()),
36 36
 		get_bloginfo(),
37
-	) );
37
+	));
38 38
 	?>
39 39
 </p>
40 40
 
41 41
 <p>
42 42
 	<?php
43 43
 	/* translators: Click here to create your password: <strong><a href="createpassword">Create my password</a></strong> */
44
-	printf( __( 'Click here to create your password: <strong><a href="%s">Create my password</a></strong>', 'wpshop' ), $data['url'] );
44
+	printf(__('Click here to create your password: <strong><a href="%s">Create my password</a></strong>', 'wpshop'), $data['url']);
45 45
 	?>
46 46
 </p>
47 47
 
48
-<p><?php esc_html_e( 'We look forward to seeing you soon.', 'wpshop' ); ?></p>
48
+<p><?php esc_html_e('We look forward to seeing you soon.', 'wpshop'); ?></p>
49 49
 
50 50
 <?php
51 51
 
52
-do_action( 'wps_email_footer' );
52
+do_action('wps_email_footer');
Please login to merge, or discard this patch.
modules/doli-order/class/class-doli-order.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit;
17
+defined('ABSPATH') || exit;
18 18
 
19 19
 /**
20 20
  * Doli Order Class.
@@ -81,20 +81,20 @@  discard block
 block discarded – undo
81 81
 	 * @since 2.0.0
82 82
 	 */
83 83
 	public function display() {
84
-		$orders = $this->get( array(
84
+		$orders = $this->get(array(
85 85
 			'orderby'  => 'meta_value',
86 86
 			'meta_key' => 'date_commande',
87
-		) );
87
+		));
88 88
 
89
-		if ( ! empty( $orders ) ) {
90
-			foreach ( $orders as &$element ) {
91
-				$element->data['tier'] = Third_Party::g()->get( array( 'id' => $element->data['parent_id'] ), true );
89
+		if (!empty($orders)) {
90
+			foreach ($orders as &$element) {
91
+				$element->data['tier'] = Third_Party::g()->get(array('id' => $element->data['parent_id']), true);
92 92
 			}
93 93
 		}
94 94
 
95
-		\eoxia\View_Util::exec( 'wpshop', 'doli-order', 'list', array(
95
+		\eoxia\View_Util::exec('wpshop', 'doli-order', 'list', array(
96 96
 			'orders' => $orders,
97
-		) );
97
+		));
98 98
 	}
99 99
 
100 100
 	/**
@@ -107,21 +107,21 @@  discard block
 block discarded – undo
107 107
 	 *
108 108
 	 * @return Order_Model             Les données de WP avec ceux de dolibarr.
109 109
 	 */
110
-	public function doli_to_wp( $doli_order, $wp_order ) {
111
-		$wp_order->data['external_id']    = (int) $doli_order->id;
110
+	public function doli_to_wp($doli_order, $wp_order) {
111
+		$wp_order->data['external_id']    = (int)$doli_order->id;
112 112
 		$wp_order->data['title']          = $doli_order->ref;
113 113
 		$wp_order->data['total_ht']       = $doli_order->total_ht;
114 114
 		$wp_order->data['total_ttc']      = $doli_order->total_ttc;
115
-		$wp_order->data['billed']         = (int) $doli_order->billed;
115
+		$wp_order->data['billed']         = (int)$doli_order->billed;
116 116
 		$wp_order->data['lines']          = $doli_order->lines;
117
-		$wp_order->data['date_commande']  = date( 'Y-m-d H:i:s', $doli_order->date_commande );
118
-		$wp_order->data['datec']          = date( 'Y-m-d H:i:s', $doli_order->date_creation );
119
-		$wp_order->data['parent_id']      = Doli_Third_Parties::g()->get_wp_id_by_doli_id( $doli_order->socid );
120
-		$wp_order->data['payment_method'] = ( null === $doli_order->mode_reglement_code ) ? $doli_order->data['payment_method'] : Doli_Payment::g()->convert_to_wp( $doli_order->mode_reglement_code );
117
+		$wp_order->data['date_commande']  = date('Y-m-d H:i:s', $doli_order->date_commande);
118
+		$wp_order->data['datec']          = date('Y-m-d H:i:s', $doli_order->date_creation);
119
+		$wp_order->data['parent_id']      = Doli_Third_Parties::g()->get_wp_id_by_doli_id($doli_order->socid);
120
+		$wp_order->data['payment_method'] = (null === $doli_order->mode_reglement_code) ? $doli_order->data['payment_method'] : Doli_Payment::g()->convert_to_wp($doli_order->mode_reglement_code);
121 121
 
122 122
 		$status = '';
123 123
 
124
-		switch ( $doli_order->statut ) {
124
+		switch ($doli_order->statut) {
125 125
 			case -1:
126 126
 				$status = 'wps-canceled';
127 127
 				break;
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 
144 144
 		$wp_order->data['status'] = $status;
145 145
 
146
-		return Doli_Order::g()->update( $wp_order->data );
146
+		return Doli_Order::g()->update($wp_order->data);
147 147
 	}
148 148
 
149 149
 	/**
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
 	 * @param  integer $doli_id L'ID de dolibarr.
155 155
 	 * @return integer          L'ID de WP.
156 156
 	 */
157
-	public function get_wp_id_by_doli_id( $doli_id ) {
158
-		$order = Doli_Order::g()->get( array(
157
+	public function get_wp_id_by_doli_id($doli_id) {
158
+		$order = Doli_Order::g()->get(array(
159 159
 			'meta_key'   => '_external_id',
160 160
 			'meta_value' => $doli_id,
161
-		), true );
161
+		), true);
162 162
 
163 163
 		return $order->data['id'];
164 164
 	}
Please login to merge, or discard this patch.