@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
2 | -if( !empty($order_metadata) ) : |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | +if (!empty($order_metadata)) : |
|
3 | 3 | ?> |
4 | 4 | <div class="wps-gridwrapper3-padded"> |
5 | 5 | <div> |
@@ -9,13 +9,13 @@ discard block |
||
9 | 9 | |
10 | 10 | <div> |
11 | 11 | <div class="wps-boxed summary_shipping_boxed"> |
12 | - <div class="wps-h5"><?php _e( 'Billing address', 'wpshop')?></div> |
|
12 | + <div class="wps-h5"><?php _e('Billing address', 'wpshop')?></div> |
|
13 | 13 | <?php |
14 | - if( !empty($billing_address_content) ) : |
|
14 | + if (!empty($billing_address_content)) : |
|
15 | 15 | echo $billing_address_content; |
16 | 16 | else : |
17 | 17 | ?> |
18 | - <div class="wps-alert-error"><?php _e( 'No billing address informations are found', 'wpshop'); ?></div> |
|
18 | + <div class="wps-alert-error"><?php _e('No billing address informations are found', 'wpshop'); ?></div> |
|
19 | 19 | <?php |
20 | 20 | endif; |
21 | 21 | ?> |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | </div> |
24 | 24 | <div> |
25 | 25 | <div class="wps-boxed summary_shipping_boxed"> |
26 | - <div class="wps-h5"><?php _e( 'Shipping address', 'wpshop')?></div> |
|
26 | + <div class="wps-h5"><?php _e('Shipping address', 'wpshop')?></div> |
|
27 | 27 | <?php |
28 | - if( !empty($shipping_address_content) ) : |
|
28 | + if (!empty($shipping_address_content)) : |
|
29 | 29 | echo $shipping_address_content; |
30 | 30 | else : |
31 | 31 | ?> |
32 | - <div class="wps-alert-error"><?php _e( 'No shipping address informations are found', 'wpshop'); ?></div> |
|
32 | + <div class="wps-alert-error"><?php _e('No shipping address informations are found', 'wpshop'); ?></div> |
|
33 | 33 | <?php |
34 | 34 | endif; |
35 | 35 | ?> |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | <?php |
42 | 42 | else : |
43 | 43 | ?> |
44 | -<div class="wps-alert-info"><?php _e( 'Please choose a customer or create one', 'wpshop'); ?></div> |
|
44 | +<div class="wps-alert-info"><?php _e('Please choose a customer or create one', 'wpshop'); ?></div> |
|
45 | 45 | <?php |
46 | 46 | endif; |
47 | 47 | ?> |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | if( !empty($order_metadata) ) : |
3 | 5 | ?> |
4 | 6 | <div class="wps-gridwrapper3-padded"> |
@@ -13,9 +15,12 @@ discard block |
||
13 | 15 | <?php |
14 | 16 | if( !empty($billing_address_content) ) : |
15 | 17 | echo $billing_address_content; |
16 | - else : |
|
18 | + else { |
|
19 | + : |
|
17 | 20 | ?> |
18 | - <div class="wps-alert-error"><?php _e( 'No billing address informations are found', 'wpshop'); ?></div> |
|
21 | + <div class="wps-alert-error"><?php _e( 'No billing address informations are found', 'wpshop'); |
|
22 | + } |
|
23 | + ?></div> |
|
19 | 24 | <?php |
20 | 25 | endif; |
21 | 26 | ?> |
@@ -27,9 +32,12 @@ discard block |
||
27 | 32 | <?php |
28 | 33 | if( !empty($shipping_address_content) ) : |
29 | 34 | echo $shipping_address_content; |
30 | - else : |
|
35 | + else { |
|
36 | + : |
|
31 | 37 | ?> |
32 | - <div class="wps-alert-error"><?php _e( 'No shipping address informations are found', 'wpshop'); ?></div> |
|
38 | + <div class="wps-alert-error"><?php _e( 'No shipping address informations are found', 'wpshop'); |
|
39 | + } |
|
40 | + ?></div> |
|
33 | 41 | <?php |
34 | 42 | endif; |
35 | 43 | ?> |
@@ -39,9 +47,12 @@ discard block |
||
39 | 47 | </div> |
40 | 48 | |
41 | 49 | <?php |
42 | -else : |
|
50 | +else { |
|
51 | + : |
|
43 | 52 | ?> |
44 | -<div class="wps-alert-info"><?php _e( 'Please choose a customer or create one', 'wpshop'); ?></div> |
|
53 | +<div class="wps-alert-info"><?php _e( 'Please choose a customer or create one', 'wpshop'); |
|
54 | +} |
|
55 | +?></div> |
|
45 | 56 | <?php |
46 | 57 | endif; |
47 | 58 | ?> |
@@ -1,5 +1,5 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
2 | - if( !empty($comment) ) : ?> |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | + if (!empty($comment)) : ?> |
|
3 | 3 | <div class="wps-boxed"><?php echo $comment; ?></div> |
4 | 4 | <?php else : ?> |
5 | 5 | <div class="wps-alert-info"> |
@@ -1,9 +1,14 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | if( !empty($comment) ) : ?> |
3 | 5 | <div class="wps-boxed"><?php echo $comment; ?></div> |
4 | -<?php else : ?> |
|
6 | +<?php else { |
|
7 | + : ?> |
|
5 | 8 | <div class="wps-alert-info"> |
6 | - <?php _e('No comment for this order', 'wpshop'); ?> |
|
9 | + <?php _e('No comment for this order', 'wpshop'); |
|
10 | +} |
|
11 | +?> |
|
7 | 12 | </div> |
8 | 13 | <?php endif; ?> |
9 | 14 |
@@ -1,11 +1,16 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | if ( !empty($order_postmeta['order_payment']) ) : |
3 | 5 | $total_amount = ( !empty($order_postmeta['order_grand_total']) ) ? $order_postmeta['order_grand_total'] : ''; |
4 | 6 | $waited_amount_sum = $received_amount_sum = $i = 0; |
5 | 7 | ?> |
6 | 8 | <?php $payment_modes = get_option( 'wps_payment_mode' ); ?> |
7 | - <?php if( !empty( $order_postmeta['order_payment']['customer_choice'] ) && !empty( $order_postmeta['order_payment']['customer_choice']['method'] ) )?> |
|
8 | - <div class="wps-alert-info"><strong><?php _e( 'Payment method customer select', 'wpshop'); ?> : </strong><br/> |
|
9 | + <?php if( !empty( $order_postmeta['order_payment']['customer_choice'] ) && !empty( $order_postmeta['order_payment']['customer_choice']['method'] ) ) { |
|
10 | + ?> |
|
11 | + <div class="wps-alert-info"><strong><?php _e( 'Payment method customer select', 'wpshop'); |
|
12 | +} |
|
13 | +?> : </strong><br/> |
|
9 | 14 | <?php echo ( !empty( $order_postmeta ) && !empty( $order_postmeta['order_payment']['customer_choice']['method'] ) && !empty( $payment_modes['mode'][ strtolower( (string)$order_postmeta['order_payment']['customer_choice']['method'] ) ][ 'name' ] ) ? $payment_modes['mode'][ strtolower( (string)$order_postmeta['order_payment']['customer_choice']['method'] ) ]['name'] : sprintf( __( 'Unknow (%s)', 'wpshop'), strtolower( (string)$order_postmeta['order_payment']['customer_choice']['method'] ) ) ); ?></div> |
10 | 15 | |
11 | 16 | <?php |
@@ -43,8 +48,11 @@ discard block |
||
43 | 48 | <span class="wps-label-orange"><?php _e( 'Incorrect amount', 'wpshop'); ?></span> |
44 | 49 | <?php elseif( $received_payment['status'] == 'waiting_payment') : ?> |
45 | 50 | <span class="wps-label-rouge"><?php _e( 'Waiting payment', 'wpshop'); ?></span> |
46 | - <?php else : ?> |
|
47 | - <span class="wps-label-rouge"><?php echo $received_payment['status']; ?></span> |
|
51 | + <?php else { |
|
52 | + : ?> |
|
53 | + <span class="wps-label-rouge"><?php echo $received_payment['status']; |
|
54 | +} |
|
55 | +?></span> |
|
48 | 56 | <?php endif; ?> |
49 | 57 | </div> |
50 | 58 | </div> |
@@ -144,6 +152,9 @@ discard block |
||
144 | 152 | <div class="wps-alert-<?php echo ( ( ($order_postmeta['order_amount_to_pay_now']) <= 0 ) ? 'success': 'warning' ); ?>"><u><?php _e( 'Due amount for this order', 'wpshop'); ?></u> : <span class="alignright"><strong><?php echo $order_postmeta['order_amount_to_pay_now'];?> <?php echo wpshop_tools::wpshop_get_currency(); ?></strong></span></div> |
145 | 153 | |
146 | 154 | <?php endif; ?> |
147 | -<?php else: ?> |
|
148 | - <div class="wps-alert-info"><?php _e('No information available for this order payment', 'wpshop'); ?></div> |
|
155 | +<?php else { |
|
156 | + : ?> |
|
157 | + <div class="wps-alert-info"><?php _e('No information available for this order payment', 'wpshop'); |
|
158 | +} |
|
159 | +?></div> |
|
149 | 160 | <?php endif;?> |
@@ -1,91 +1,91 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
2 | - if ( !empty($order_postmeta['order_payment']) ) : |
|
3 | -$total_amount = ( !empty($order_postmeta['order_grand_total']) ) ? $order_postmeta['order_grand_total'] : ''; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | + if (!empty($order_postmeta['order_payment'])) : |
|
3 | +$total_amount = (!empty($order_postmeta['order_grand_total'])) ? $order_postmeta['order_grand_total'] : ''; |
|
4 | 4 | $waited_amount_sum = $received_amount_sum = $i = 0; |
5 | 5 | ?> |
6 | - <?php $payment_modes = get_option( 'wps_payment_mode' ); ?> |
|
7 | - <?php if( !empty( $order_postmeta['order_payment']['customer_choice'] ) && !empty( $order_postmeta['order_payment']['customer_choice']['method'] ) )?> |
|
8 | - <div class="wps-alert-info"><strong><?php _e( 'Payment method customer select', 'wpshop'); ?> : </strong><br/> |
|
9 | - <?php echo ( !empty( $order_postmeta ) && !empty( $order_postmeta['order_payment']['customer_choice']['method'] ) && !empty( $payment_modes['mode'][ strtolower( (string)$order_postmeta['order_payment']['customer_choice']['method'] ) ][ 'name' ] ) ? $payment_modes['mode'][ strtolower( (string)$order_postmeta['order_payment']['customer_choice']['method'] ) ]['name'] : sprintf( __( 'Unknow (%s)', 'wpshop'), strtolower( (string)$order_postmeta['order_payment']['customer_choice']['method'] ) ) ); ?></div> |
|
6 | + <?php $payment_modes = get_option('wps_payment_mode'); ?> |
|
7 | + <?php if (!empty($order_postmeta['order_payment']['customer_choice']) && !empty($order_postmeta['order_payment']['customer_choice']['method']))?> |
|
8 | + <div class="wps-alert-info"><strong><?php _e('Payment method customer select', 'wpshop'); ?> : </strong><br/> |
|
9 | + <?php echo (!empty($order_postmeta) && !empty($order_postmeta['order_payment']['customer_choice']['method']) && !empty($payment_modes['mode'][strtolower((string)$order_postmeta['order_payment']['customer_choice']['method'])]['name']) ? $payment_modes['mode'][strtolower((string)$order_postmeta['order_payment']['customer_choice']['method'])]['name'] : sprintf(__('Unknow (%s)', 'wpshop'), strtolower((string)$order_postmeta['order_payment']['customer_choice']['method']))); ?></div> |
|
10 | 10 | |
11 | 11 | <?php |
12 | - $payment_method_filter = apply_filters( 'wps_administration_order_payment_informations', $order->ID ); |
|
13 | - if ( $order->ID != $payment_method_filter ) { |
|
12 | + $payment_method_filter = apply_filters('wps_administration_order_payment_informations', $order->ID); |
|
13 | + if ($order->ID != $payment_method_filter) { |
|
14 | 14 | echo $payment_method_filter; |
15 | 15 | } |
16 | 16 | ?> |
17 | 17 | |
18 | - <?php if( !empty( $order_postmeta['order_payment']['received'] ) ) : ?> |
|
18 | + <?php if (!empty($order_postmeta['order_payment']['received'])) : ?> |
|
19 | 19 | <div class="wps-boxed"> |
20 | - <div class="wps-h2"><?php _e( 'Received payments', 'wpshop'); ?></div> |
|
21 | - <?php foreach( $order_postmeta['order_payment']['received'] as $index_payment => $received_payment ) : |
|
22 | - if( !empty( $received_payment['method'] ) ) : |
|
20 | + <div class="wps-h2"><?php _e('Received payments', 'wpshop'); ?></div> |
|
21 | + <?php foreach ($order_postmeta['order_payment']['received'] as $index_payment => $received_payment) : |
|
22 | + if (!empty($received_payment['method'])) : |
|
23 | 23 | $i++; |
24 | 24 | ?> |
25 | 25 | <?php |
26 | - if ( !empty($received_payment['waited_amount']) ) { |
|
26 | + if (!empty($received_payment['waited_amount'])) { |
|
27 | 27 | $waited_amount_sum += $received_payment['waited_amount']; |
28 | 28 | } |
29 | - if ( !empty($received_payment['received_amount']) && ($received_payment['status'] == 'payment_received') ) { |
|
29 | + if (!empty($received_payment['received_amount']) && ($received_payment['status'] == 'payment_received')) { |
|
30 | 30 | $received_amount_sum += $received_payment['received_amount']; |
31 | 31 | } |
32 | 32 | ?> |
33 | 33 | <div> |
34 | - <div class="wps-h5"><span class="dashicons dashicons-arrow-right"></span><strong><?php echo ( !empty( $received_payment ) && !empty( $received_payment['method'] ) && !empty( $payment_modes['mode'][ strtolower( $received_payment['method'] ) ] ) && !empty( $payment_modes['mode'][ strtolower( $received_payment['method'] ) ][ 'name' ] ) ? $payment_modes['mode'][ strtolower( $received_payment['method'] ) ]['name'] : sprintf( __( 'Unknow (%s)', 'wpshop'), strtolower( $received_payment['method'] ) ) ); ?></strong></div> |
|
34 | + <div class="wps-h5"><span class="dashicons dashicons-arrow-right"></span><strong><?php echo (!empty($received_payment) && !empty($received_payment['method']) && !empty($payment_modes['mode'][strtolower($received_payment['method'])]) && !empty($payment_modes['mode'][strtolower($received_payment['method'])]['name']) ? $payment_modes['mode'][strtolower($received_payment['method'])]['name'] : sprintf(__('Unknow (%s)', 'wpshop'), strtolower($received_payment['method']))); ?></strong></div> |
|
35 | 35 | <div class="wps-product-section"> |
36 | - <div><strong><?php _e( 'Payment date', 'wpshop'); ?> :</strong> <?php echo ( !empty( $received_payment ) && !empty($received_payment['date']) ) ? mysql2date('d F Y H:i', $received_payment['date'], true) : __( 'Unknow', 'wpshop'); ?></div> |
|
37 | - <div><strong><?php _e( 'Payment reference', 'wpshop'); ?> :</strong> <?php echo ( !empty( $received_payment ) && !empty($received_payment['payment_reference']) ) ? $received_payment['payment_reference'] : __( 'Unknow', 'wpshop'); ?></div> |
|
38 | - <div><strong><?php _e( 'Amount', 'wpshop'); ?> :</strong> <?php echo ( !empty( $received_payment ) && !empty($received_payment['received_amount']) ) ? $received_payment['received_amount'].' '.wpshop_tools::wpshop_get_currency() : __( 'Unknow', 'wpshop'); ?></div> |
|
39 | - <div><strong><?php _e( 'Status', 'wpshop'); ?> :</strong> |
|
40 | - <?php if( !empty($received_payment['status']) && $received_payment['status'] == 'payment_received' ) : ?> |
|
41 | - <span class="wps-label-vert"><?php _e( 'Received payment', 'wpshop'); ?></span> |
|
42 | - <?php elseif( $received_payment['status'] == 'incorrect_amount' ) : ?> |
|
43 | - <span class="wps-label-orange"><?php _e( 'Incorrect amount', 'wpshop'); ?></span> |
|
44 | - <?php elseif( $received_payment['status'] == 'waiting_payment') : ?> |
|
45 | - <span class="wps-label-rouge"><?php _e( 'Waiting payment', 'wpshop'); ?></span> |
|
36 | + <div><strong><?php _e('Payment date', 'wpshop'); ?> :</strong> <?php echo (!empty($received_payment) && !empty($received_payment['date'])) ? mysql2date('d F Y H:i', $received_payment['date'], true) : __('Unknow', 'wpshop'); ?></div> |
|
37 | + <div><strong><?php _e('Payment reference', 'wpshop'); ?> :</strong> <?php echo (!empty($received_payment) && !empty($received_payment['payment_reference'])) ? $received_payment['payment_reference'] : __('Unknow', 'wpshop'); ?></div> |
|
38 | + <div><strong><?php _e('Amount', 'wpshop'); ?> :</strong> <?php echo (!empty($received_payment) && !empty($received_payment['received_amount'])) ? $received_payment['received_amount'] . ' ' . wpshop_tools::wpshop_get_currency() : __('Unknow', 'wpshop'); ?></div> |
|
39 | + <div><strong><?php _e('Status', 'wpshop'); ?> :</strong> |
|
40 | + <?php if (!empty($received_payment['status']) && $received_payment['status'] == 'payment_received') : ?> |
|
41 | + <span class="wps-label-vert"><?php _e('Received payment', 'wpshop'); ?></span> |
|
42 | + <?php elseif ($received_payment['status'] == 'incorrect_amount') : ?> |
|
43 | + <span class="wps-label-orange"><?php _e('Incorrect amount', 'wpshop'); ?></span> |
|
44 | + <?php elseif ($received_payment['status'] == 'waiting_payment') : ?> |
|
45 | + <span class="wps-label-rouge"><?php _e('Waiting payment', 'wpshop'); ?></span> |
|
46 | 46 | <?php else : ?> |
47 | 47 | <span class="wps-label-rouge"><?php echo $received_payment['status']; ?></span> |
48 | 48 | <?php endif; ?> |
49 | 49 | </div> |
50 | 50 | </div> |
51 | - <?php if( !empty( $received_payment ) && !empty($received_payment['invoice_ref']) ) { ?> |
|
51 | + <?php if (!empty($received_payment) && !empty($received_payment['invoice_ref'])) { ?> |
|
52 | 52 | <div> |
53 | - <div class="wps-product-section"><a href="<?php echo WPSHOP_TEMPLATES_URL; ?>invoice.php?order_id=<?php echo $order->ID; ?>&invoice_ref=<?php echo $received_payment['invoice_ref']; ?>&mode=pdf" target="_blank" class="wps-bton-second-mini-rounded" role="button"><i class="dashicons dashicons-download"></i><?php _e( 'Download invoice', 'wpshop' ); ?></a></div> |
|
54 | - <div class="wps-product-section"><a href="<?php echo WPSHOP_TEMPLATES_URL; ?>invoice.php?order_id=<?php echo $order->ID; ?>&invoice_ref=<?php echo $received_payment['invoice_ref']; ?>" target="_blank" class="wps-bton-fourth-mini-third" role="button"><i class="dashicons dashicons-welcome-view-site"></i><?php _e( 'Watch invoice', 'wpshop' ); ?></a></div> |
|
53 | + <div class="wps-product-section"><a href="<?php echo WPSHOP_TEMPLATES_URL; ?>invoice.php?order_id=<?php echo $order->ID; ?>&invoice_ref=<?php echo $received_payment['invoice_ref']; ?>&mode=pdf" target="_blank" class="wps-bton-second-mini-rounded" role="button"><i class="dashicons dashicons-download"></i><?php _e('Download invoice', 'wpshop'); ?></a></div> |
|
54 | + <div class="wps-product-section"><a href="<?php echo WPSHOP_TEMPLATES_URL; ?>invoice.php?order_id=<?php echo $order->ID; ?>&invoice_ref=<?php echo $received_payment['invoice_ref']; ?>" target="_blank" class="wps-bton-fourth-mini-third" role="button"><i class="dashicons dashicons-welcome-view-site"></i><?php _e('Watch invoice', 'wpshop'); ?></a></div> |
|
55 | 55 | </div> |
56 | - <?php } elseif( !empty( $received_payment ) && empty( $received_payment['invoice_ref'] ) && $received_payment['status'] == 'payment_received' ) { ?> |
|
56 | + <?php } elseif (!empty($received_payment) && empty($received_payment['invoice_ref']) && $received_payment['status'] == 'payment_received') { ?> |
|
57 | 57 | <div> |
58 | 58 | <input type="hidden" name="order_id" class="wps-regerate-invoice-payment-input<?php $idregen = uniqid(); echo $idregen; ?>" value="<?php echo $order->ID; ?>"> |
59 | 59 | <input type="hidden" name="index_payment" class="wps-regerate-invoice-payment-input<?php echo $idregen; ?>" value="<?php echo $index_payment; ?>"> |
60 | - <div class="wps-product-section"><button data-nonce="<?php echo wp_create_nonce( 'wps_reverify_payment_invoice_ref' ); ?>" id="wps-regerate-invoice-payment-btn" class="wps-bton-fourth-mini-third" data-class="<?php echo $idregen; ?>"><i class="dashicons dashicons-controls-repeat"></i><?php _e( 'Regerate invoice payment', 'wpshop' ); ?></button></div> |
|
60 | + <div class="wps-product-section"><button data-nonce="<?php echo wp_create_nonce('wps_reverify_payment_invoice_ref'); ?>" id="wps-regerate-invoice-payment-btn" class="wps-bton-fourth-mini-third" data-class="<?php echo $idregen; ?>"><i class="dashicons dashicons-controls-repeat"></i><?php _e('Regerate invoice payment', 'wpshop'); ?></button></div> |
|
61 | 61 | </div> |
62 | 62 | <?php } ?> |
63 | 63 | <br/> |
64 | 64 | </div> |
65 | 65 | <?php |
66 | 66 | endif; |
67 | - endforeach;?> |
|
67 | + endforeach; ?> |
|
68 | 68 | |
69 | - <?php if( $i == 0 ) : ?> |
|
70 | - <div class="wps-alert-info"><?php _e( 'No received payment for the moment', 'wpshop'); ?></div> |
|
71 | - <?php endif;?> |
|
69 | + <?php if ($i == 0) : ?> |
|
70 | + <div class="wps-alert-info"><?php _e('No received payment for the moment', 'wpshop'); ?></div> |
|
71 | + <?php endif; ?> |
|
72 | 72 | </div> |
73 | 73 | |
74 | - <?php if ( ( ($total_amount - $received_amount_sum ) > 0) && ($order_postmeta['order_grand_total'] > 0) ) : ?> |
|
74 | + <?php if ((($total_amount - $received_amount_sum) > 0) && ($order_postmeta['order_grand_total'] > 0)) : ?> |
|
75 | 75 | <div class="wps-boxed"> |
76 | - <div class="wps-h5"><?php _e( 'Add a new payment', 'wpshop'); ?></div> |
|
76 | + <div class="wps-h5"><?php _e('Add a new payment', 'wpshop'); ?></div> |
|
77 | 77 | <div class="wps-gridwrapper2-padded"> |
78 | 78 | <div class="wps-form-group"> |
79 | 79 | <label><?php _e('Method', 'wpshop'); ?> :</label> |
80 | 80 | <div class="wps-form"> |
81 | 81 | <select name="wpshop_admin_order_payment_received[method]"> |
82 | - <?php if(!empty( $payment_modes ) && !empty($payment_modes['mode']) ) : ?> |
|
83 | - <?php foreach( $payment_modes['mode'] as $mode_id => $mode ) : ?> |
|
84 | - <?php if( !empty($mode['active']) ) : ?> |
|
82 | + <?php if (!empty($payment_modes) && !empty($payment_modes['mode'])) : ?> |
|
83 | + <?php foreach ($payment_modes['mode'] as $mode_id => $mode) : ?> |
|
84 | + <?php if (!empty($mode['active'])) : ?> |
|
85 | 85 | <option value="<?php echo $mode_id; ?>"><?php echo $mode['name']; ?></option> |
86 | - <?php endif;?> |
|
86 | + <?php endif; ?> |
|
87 | 87 | <?php endforeach; ?> |
88 | - <?php endif;?> |
|
88 | + <?php endif; ?> |
|
89 | 89 | </select> |
90 | 90 | </div> |
91 | 91 | </div> |
@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | </div> |
116 | 116 | |
117 | 117 | </div> |
118 | - <input type="hidden" value="<?php echo ($waited_amount_sum - $received_amount_sum ); ?>" id="wpshop_admin_order_due_amount" /> |
|
118 | + <input type="hidden" value="<?php echo ($waited_amount_sum - $received_amount_sum); ?>" id="wpshop_admin_order_due_amount" /> |
|
119 | 119 | <input type="hidden" value="" id="action_triggered_from" name="action_triggered_from" /> |
120 | - <div><button class="wps-bton-first-mini-rounded" id="wpshop_order_arrived_payment_amount_add_button"><?php _e( 'Add the payment', 'wpshop' ); ?></button></div> |
|
120 | + <div><button class="wps-bton-first-mini-rounded" id="wpshop_order_arrived_payment_amount_add_button"><?php _e('Add the payment', 'wpshop'); ?></button></div> |
|
121 | 121 | </div> |
122 | 122 | |
123 | 123 | <script type="text/javascript" > |
@@ -141,9 +141,9 @@ discard block |
||
141 | 141 | |
142 | 142 | |
143 | 143 | <?php endif; ?> |
144 | - <div class="wps-alert-<?php echo ( ( ($order_postmeta['order_amount_to_pay_now']) <= 0 ) ? 'success': 'warning' ); ?>"><u><?php _e( 'Due amount for this order', 'wpshop'); ?></u> : <span class="alignright"><strong><?php echo $order_postmeta['order_amount_to_pay_now'];?> <?php echo wpshop_tools::wpshop_get_currency(); ?></strong></span></div> |
|
144 | + <div class="wps-alert-<?php echo ((($order_postmeta['order_amount_to_pay_now']) <= 0) ? 'success' : 'warning'); ?>"><u><?php _e('Due amount for this order', 'wpshop'); ?></u> : <span class="alignright"><strong><?php echo $order_postmeta['order_amount_to_pay_now']; ?> <?php echo wpshop_tools::wpshop_get_currency(); ?></strong></span></div> |
|
145 | 145 | |
146 | 146 | <?php endif; ?> |
147 | 147 | <?php else: ?> |
148 | 148 | <div class="wps-alert-info"><?php _e('No information available for this order payment', 'wpshop'); ?></div> |
149 | -<?php endif;?> |
|
149 | +<?php endif; ?> |
@@ -1,24 +1,24 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
2 | - if( !empty($sales_informations) ): ?> |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | + if (!empty($sales_informations)): ?> |
|
3 | 3 | <div class="wps-table"> |
4 | 4 | <div class="wps-table-header wps-table-row"> |
5 | - <div class="wps-table-cell"><?php _e( 'Date', 'wpshop'); ?></div> |
|
6 | - <div class="wps-table-cell"><?php _e( 'Order ID', 'wpshop'); ?></div> |
|
7 | - <div class="wps-table-cell"><?php _e( 'Customer', 'wpshop'); ?></div> |
|
8 | - <div class="wps-table-cell"><?php _e( 'Order Status', 'wpshop'); ?></div> |
|
5 | + <div class="wps-table-cell"><?php _e('Date', 'wpshop'); ?></div> |
|
6 | + <div class="wps-table-cell"><?php _e('Order ID', 'wpshop'); ?></div> |
|
7 | + <div class="wps-table-cell"><?php _e('Customer', 'wpshop'); ?></div> |
|
8 | + <div class="wps-table-cell"><?php _e('Order Status', 'wpshop'); ?></div> |
|
9 | 9 | <div class="wps-table-cell"></div> |
10 | 10 | </div> |
11 | - <?php foreach( $sales_informations as $sale_informations) : ?> |
|
11 | + <?php foreach ($sales_informations as $sale_informations) : ?> |
|
12 | 12 | <div class="wps-table-content wps-table-row"> |
13 | - <div class="wps-table-cell"><?php echo mysql2date('d F Y, H:i:s',$sale_informations['order_date'], true);?></div> |
|
13 | + <div class="wps-table-cell"><?php echo mysql2date('d F Y, H:i:s', $sale_informations['order_date'], true); ?></div> |
|
14 | 14 | <div class="wps-table-cell"><?php echo $sale_informations['order_key']; ?></div> |
15 | - <div class="wps-table-cell"><?php echo $sale_informations['customer_name']. ' '.$sale_informations['customer_firstname'].' ('.$sale_informations['customer_email'].')'; ?></div> |
|
16 | - <div class="wps-table-cell"><span class="wps-label-<?php echo $color_label[ strtolower($sale_informations['order_status']) ]; ?>"><?php _e( $order_status[ strtolower($sale_informations['order_status']) ], 'wpshop' ); ?></span></div> |
|
17 | - <div class="wps-table-cell"><a href="<?php echo admin_url('post.php?post=' .$sale_informations['order_id']. '&action=edit'); ?>" class="wps-bton-mini-rounded-first" target="_blank"><?php _e( 'See the order', 'wpshop'); ?></a></div> |
|
15 | + <div class="wps-table-cell"><?php echo $sale_informations['customer_name'] . ' ' . $sale_informations['customer_firstname'] . ' (' . $sale_informations['customer_email'] . ')'; ?></div> |
|
16 | + <div class="wps-table-cell"><span class="wps-label-<?php echo $color_label[strtolower($sale_informations['order_status'])]; ?>"><?php _e($order_status[strtolower($sale_informations['order_status'])], 'wpshop'); ?></span></div> |
|
17 | + <div class="wps-table-cell"><a href="<?php echo admin_url('post.php?post=' . $sale_informations['order_id'] . '&action=edit'); ?>" class="wps-bton-mini-rounded-first" target="_blank"><?php _e('See the order', 'wpshop'); ?></a></div> |
|
18 | 18 | </div> |
19 | 19 | <?php endforeach; ?> |
20 | 20 | </div> |
21 | 21 | <?php else : ?> |
22 | - <div class="wps-alert-info"><?php _e( 'This product has never been ordered', 'wpshop'); ?></div> |
|
22 | + <div class="wps-alert-info"><?php _e('This product has never been ordered', 'wpshop'); ?></div> |
|
23 | 23 | <?php endif; ?> |
24 | 24 |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | if( !empty($sales_informations) ): ?> |
3 | 5 | <div class="wps-table"> |
4 | 6 | <div class="wps-table-header wps-table-row"> |
@@ -18,7 +20,10 @@ discard block |
||
18 | 20 | </div> |
19 | 21 | <?php endforeach; ?> |
20 | 22 | </div> |
21 | -<?php else : ?> |
|
22 | - <div class="wps-alert-info"><?php _e( 'This product has never been ordered', 'wpshop'); ?></div> |
|
23 | +<?php else { |
|
24 | + : ?> |
|
25 | + <div class="wps-alert-info"><?php _e( 'This product has never been ordered', 'wpshop'); |
|
26 | +} |
|
27 | +?></div> |
|
23 | 28 | <?php endif; ?> |
24 | 29 |
@@ -1,19 +1,19 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
2 | - $order_private_comments = get_post_meta( $oid, '_order_private_comments', true); ?> |
|
3 | -<?php if( !empty($order_private_comments) ) : ?> |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | + $order_private_comments = get_post_meta($oid, '_order_private_comments', true); ?> |
|
3 | +<?php if (!empty($order_private_comments)) : ?> |
|
4 | 4 | <?php $order_private_comments = array_reverse($order_private_comments); |
5 | 5 | ?> |
6 | - <?php foreach($order_private_comments as $order_private_comment ) : ?> |
|
6 | + <?php foreach ($order_private_comments as $order_private_comment) : ?> |
|
7 | 7 | <div class="wps_private_comment"> |
8 | 8 | <div class="wps_private_comment_avatar"> |
9 | - <?php $user_id = ( !empty($order_private_comment) && !empty($order_private_comment['author']) ) ? $order_private_comment['author'] : get_current_user_id() ; ?> |
|
10 | - <?php echo get_avatar( $user_id, 30 ); ?> |
|
11 | - <?php $user_data = get_userdata( $user_id ); ?> |
|
9 | + <?php $user_id = (!empty($order_private_comment) && !empty($order_private_comment['author'])) ? $order_private_comment['author'] : get_current_user_id(); ?> |
|
10 | + <?php echo get_avatar($user_id, 30); ?> |
|
11 | + <?php $user_data = get_userdata($user_id); ?> |
|
12 | 12 | </div> |
13 | 13 | <div class="wps_private_comment_author_informations"> |
14 | 14 | <span class="wps_private_comment_author"> |
15 | - <?php echo ( !empty($order_private_comment['send_email']) && $order_private_comment['send_email'] === true ) ? '<span class="dashicons dashicons-email-alt"></span>' : ''; ?> |
|
16 | - <?php printf( __( '%s says on', 'wpshop'), $user_data->user_login ); ?></span> |
|
15 | + <?php echo (!empty($order_private_comment['send_email']) && $order_private_comment['send_email'] === true) ? '<span class="dashicons dashicons-email-alt"></span>' : ''; ?> |
|
16 | + <?php printf(__('%s says on', 'wpshop'), $user_data->user_login); ?></span> |
|
17 | 17 | <span class="wps_private_comment_date"><?php echo mysql2date('d F Y H:i:s', $order_private_comment['comment_date'], true); ?></span> |
18 | 18 | </div> |
19 | 19 | <div class="wps_private_comment_message"><?php echo $order_private_comment['comment']; ?></div> |
@@ -1,4 +1,6 @@ |
||
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 | * |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | $order_post_meta = !empty($post) ? get_post_meta( $post->ID, '_wpshop_order_status', true ) : ""; ?> |
3 | 5 | <div class="wps-table"> |
4 | 6 | <div class="wps-table-header wps-table-row"> |
@@ -39,8 +41,11 @@ discard block |
||
39 | 41 | <?php endif; ?> |
40 | 42 | </div> |
41 | 43 | <?php endforeach; ?> |
42 | - <?php else : |
|
43 | - $letter_display = ( strtoupper( $current_letter ) != 'ALL' ) ? $current_letter : __('ALL', 'wpshop' ); ?> |
|
44 | + <?php else { |
|
45 | + : |
|
46 | + $letter_display = ( strtoupper( $current_letter ) != 'ALL' ) ? $current_letter : __('ALL', 'wpshop' ); |
|
47 | +} |
|
48 | +?> |
|
44 | 49 | <div class="wps-alert-info"><?php printf( __( 'No products corresponds to the letter <strong>"%s"</strong> search', 'wpshop'), strtoupper( $letter_display ) ); ?></div> |
45 | 50 | <?php endif; ?> |
46 | 51 | </div> |
@@ -1,46 +1,46 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
2 | - $order_post_meta = !empty($post) ? get_post_meta( $post->ID, '_wpshop_order_status', true ) : ""; ?> |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | + $order_post_meta = !empty($post) ? get_post_meta($post->ID, '_wpshop_order_status', true) : ""; ?> |
|
3 | 3 | <div class="wps-table"> |
4 | 4 | <div class="wps-table-header wps-table-row"> |
5 | - <div class="wps-table-cell"><?php _e( 'Picture', 'wpshop'); ?></div> |
|
6 | - <div class="wps-table-cell"><?php _e( 'Product reference', 'wpshop'); ?></div> |
|
7 | - <div class="wps-table-cell"><?php _e( 'Product name', 'wpshop'); ?></div> |
|
8 | - <div class="wps-table-cell"><?php _e( 'Price', 'wpshop'); ?></div> |
|
5 | + <div class="wps-table-cell"><?php _e('Picture', 'wpshop'); ?></div> |
|
6 | + <div class="wps-table-cell"><?php _e('Product reference', 'wpshop'); ?></div> |
|
7 | + <div class="wps-table-cell"><?php _e('Product name', 'wpshop'); ?></div> |
|
8 | + <div class="wps-table-cell"><?php _e('Price', 'wpshop'); ?></div> |
|
9 | 9 | |
10 | - <?php if ( 'completed' != $order_post_meta ) : ?> |
|
11 | - <div class="wps-table-cell"><?php _e( 'Quantity', 'wpshop'); ?></div> |
|
12 | - <div class="wps-table-cell"><?php _e( 'Add to order', 'wpshop'); ?></div> |
|
10 | + <?php if ('completed' != $order_post_meta) : ?> |
|
11 | + <div class="wps-table-cell"><?php _e('Quantity', 'wpshop'); ?></div> |
|
12 | + <div class="wps-table-cell"><?php _e('Add to order', 'wpshop'); ?></div> |
|
13 | 13 | <?php endif; ?> |
14 | 14 | </div> |
15 | - <?php if( !empty($products) ) : ?> |
|
16 | - <?php foreach ( $products as $product ) : |
|
15 | + <?php if (!empty($products)) : ?> |
|
16 | + <?php foreach ($products as $product) : |
|
17 | 17 | $pid = $product->ID; |
18 | 18 | ?> |
19 | - <?php $product_metadata = get_post_meta( $product->ID, '_wpshop_product_metadata', true ); ?> |
|
19 | + <?php $product_metadata = get_post_meta($product->ID, '_wpshop_product_metadata', true); ?> |
|
20 | 20 | <div class="wps-table-content wps-table-row"> |
21 | - <div class="wps-table-cell wps-cart-item-img"><?php echo get_the_post_thumbnail( $product->ID, 'thumbnail' ); ?></div> |
|
22 | - <div class="wps-table-cell"><?php echo ( !empty( $product_metadata) && $product_metadata['product_reference']) ? $product_metadata['product_reference'] : ''; ?></div> |
|
21 | + <div class="wps-table-cell wps-cart-item-img"><?php echo get_the_post_thumbnail($product->ID, 'thumbnail'); ?></div> |
|
22 | + <div class="wps-table-cell"><?php echo (!empty($product_metadata) && $product_metadata['product_reference']) ? $product_metadata['product_reference'] : ''; ?></div> |
|
23 | 23 | <div class="wps-table-cell"><?php echo $product->post_title; ?></div> |
24 | 24 | <div class="wps-table-cell"> |
25 | 25 | <?php |
26 | 26 | $product = wpshop_products::get_product_data($product->ID); |
27 | - echo wpshop_prices::get_product_price($product, 'price_display', array('mini_output', 'grid') ); |
|
27 | + echo wpshop_prices::get_product_price($product, 'price_display', array('mini_output', 'grid')); |
|
28 | 28 | ?> |
29 | 29 | </div> |
30 | - <?php if ( 'completed' != $order_post_meta ) : ?> |
|
30 | + <?php if ('completed' != $order_post_meta) : ?> |
|
31 | 31 | <div class="wps-table-cell"> |
32 | - <a class="wps-bton-icon-minus-small wps-cart-reduce-product-qty" data-nonce="<?php echo wp_create_nonce( 'ajax_wpshop_set_qty_for_product_into_cart' ); ?>" href=""></a> |
|
32 | + <a class="wps-bton-icon-minus-small wps-cart-reduce-product-qty" data-nonce="<?php echo wp_create_nonce('ajax_wpshop_set_qty_for_product_into_cart'); ?>" href=""></a> |
|
33 | 33 | <input id="wps-cart-product-qty-<?php echo $pid; ?>" class="wps-cart-product-qty" type="text" value="1" name="french-hens" size="3" style="text-align : center"> |
34 | - <a class="wps-bton-icon-plus-small wps-cart-add-product-qty" data-nonce="<?php echo wp_create_nonce( 'ajax_wpshop_set_qty_for_product_into_cart' ); ?>" href=""></a> |
|
34 | + <a class="wps-bton-icon-plus-small wps-cart-add-product-qty" data-nonce="<?php echo wp_create_nonce('ajax_wpshop_set_qty_for_product_into_cart'); ?>" href=""></a> |
|
35 | 35 | </div> |
36 | 36 | <div class="wps-table-cell"> |
37 | - <a href="#" data-nonce="<?php echo wp_create_nonce( 'wps_add_product_to_order_admin' ); ?>" class="wps-bton-first-mini-rounded wps-order-add-product" id="wps-order-add-product-<?php echo $pid; ?>"><i class="wps-icon-basket"></i> <?php _e( 'Add to order', 'wpshop'); ?></a> |
|
37 | + <a href="#" data-nonce="<?php echo wp_create_nonce('wps_add_product_to_order_admin'); ?>" class="wps-bton-first-mini-rounded wps-order-add-product" id="wps-order-add-product-<?php echo $pid; ?>"><i class="wps-icon-basket"></i> <?php _e('Add to order', 'wpshop'); ?></a> |
|
38 | 38 | </div> |
39 | 39 | <?php endif; ?> |
40 | 40 | </div> |
41 | 41 | <?php endforeach; ?> |
42 | 42 | <?php else : |
43 | - $letter_display = ( strtoupper( $current_letter ) != 'ALL' ) ? $current_letter : __('ALL', 'wpshop' ); ?> |
|
44 | - <div class="wps-alert-info"><?php printf( __( 'No products corresponds to the letter <strong>"%s"</strong> search', 'wpshop'), strtoupper( $letter_display ) ); ?></div> |
|
43 | + $letter_display = (strtoupper($current_letter) != 'ALL') ? $current_letter : __('ALL', 'wpshop'); ?> |
|
44 | + <div class="wps-alert-info"><?php printf(__('No products corresponds to the letter <strong>"%s"</strong> search', 'wpshop'), strtoupper($letter_display)); ?></div> |
|
45 | 45 | <?php endif; ?> |
46 | 46 | </div> |
@@ -2,7 +2,7 @@ |
||
2 | 2 | DEFINE('WPS_ORDERS_DIR', basename(dirname(__FILE__))); |
3 | 3 | DEFINE('WPS_ORDERS_PATH', str_replace( "\\", "/", str_replace( WPS_ORDERS_DIR, "", dirname( __FILE__ ) ) ) ); |
4 | 4 | DEFINE('WPS_ORDERS_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', WPS_ORDERS_PATH ) ); |
5 | - DEFINE( 'WPS_ORDERS_BASE', plugin_dir_path( __FILE__ ) ); |
|
5 | + DEFINE( 'WPS_ORDERS_BASE', plugin_dir_path( __FILE__ ) ); |
|
6 | 6 | include( plugin_dir_path( __FILE__ ).'/controller/wps_orders_ctr.php' ); include( plugin_dir_path( __FILE__ ).'/controller/wps_orders_in_back_office.php' ); |
7 | 7 | include( plugin_dir_path( __FILE__ ).'/model/wps_orders_mdl.php' ); include( plugin_dir_path( __FILE__ ).'/model/wps_back_office_orders_mdl.php' ); |
8 | 8 | $wps_orders_in_back_office = new wps_orders_in_back_office(); |
@@ -1,9 +1,9 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | DEFINE('WPS_ORDERS_DIR', basename(dirname(__FILE__))); |
3 | -DEFINE('WPS_ORDERS_PATH', str_replace( "\\", "/", str_replace( WPS_ORDERS_DIR, "", dirname( __FILE__ ) ) ) ); |
|
4 | -DEFINE('WPS_ORDERS_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', WPS_ORDERS_PATH ) ); |
|
5 | - DEFINE( 'WPS_ORDERS_BASE', plugin_dir_path( __FILE__ ) ); |
|
6 | -include( plugin_dir_path( __FILE__ ).'/controller/wps_orders_ctr.php' ); include( plugin_dir_path( __FILE__ ).'/controller/wps_orders_in_back_office.php' ); |
|
7 | -include( plugin_dir_path( __FILE__ ).'/model/wps_orders_mdl.php' ); include( plugin_dir_path( __FILE__ ).'/model/wps_back_office_orders_mdl.php' ); |
|
3 | +DEFINE('WPS_ORDERS_PATH', str_replace("\\", "/", str_replace(WPS_ORDERS_DIR, "", dirname(__FILE__)))); |
|
4 | +DEFINE('WPS_ORDERS_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', WPS_ORDERS_PATH)); |
|
5 | + DEFINE('WPS_ORDERS_BASE', plugin_dir_path(__FILE__)); |
|
6 | +include(plugin_dir_path(__FILE__) . '/controller/wps_orders_ctr.php'); include(plugin_dir_path(__FILE__) . '/controller/wps_orders_in_back_office.php'); |
|
7 | +include(plugin_dir_path(__FILE__) . '/model/wps_orders_mdl.php'); include(plugin_dir_path(__FILE__) . '/model/wps_back_office_orders_mdl.php'); |
|
8 | 8 | $wps_orders_in_back_office = new wps_orders_in_back_office(); |
9 | 9 | $wps_orders = new wps_orders_ctr(); |
10 | 10 | \ No newline at end of file |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | DEFINE('WPS_ORDERS_DIR', basename(dirname(__FILE__))); |
3 | 5 | DEFINE('WPS_ORDERS_PATH', str_replace( "\\", "/", str_replace( WPS_ORDERS_DIR, "", dirname( __FILE__ ) ) ) ); |
4 | 6 | DEFINE('WPS_ORDERS_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', WPS_ORDERS_PATH ) ); |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | class wps_back_office_orders_mdl { |
3 | 3 | function __construct() { |
4 | 4 | |
@@ -12,25 +12,25 @@ discard block |
||
12 | 12 | $order_meta = get_post_meta($oid, '_order_postmeta', true); |
13 | 13 | |
14 | 14 | // Send email is checked |
15 | - if( !empty($send_email) ) { |
|
15 | + if (!empty($send_email)) { |
|
16 | 16 | // New object wps_message_ctr |
17 | 17 | $wps_message = new wps_message_ctr(); |
18 | 18 | |
19 | 19 | // Get order current content |
20 | 20 | $user = get_post_meta($oid, '_order_info', true); |
21 | 21 | |
22 | - $email = isset($user['billing']['address']['address_user_email']) ? $user['billing']['address']['address_user_email'] :''; |
|
22 | + $email = isset($user['billing']['address']['address_user_email']) ? $user['billing']['address']['address_user_email'] : ''; |
|
23 | 23 | |
24 | 24 | /** Si pas d'email trouvé, utilises l'adresse email par défault du client */ |
25 | - if(empty($email)) { |
|
26 | - $customer_id = get_post_meta( $oid, '_wpshop_order_customer_id', true ); |
|
25 | + if (empty($email)) { |
|
26 | + $customer_id = get_post_meta($oid, '_wpshop_order_customer_id', true); |
|
27 | 27 | $user_info = get_userdata($customer_id); |
28 | 28 | $email = $user_info->user_email; |
29 | 29 | } |
30 | - $first_name = isset($user['billing']['address']['address_first_name'])?$user['billing']['address']['address_first_name']:''; |
|
31 | - $last_name = isset($user['billing']['address']['address_last_name'])?$user['billing']['address']['address_last_name']:''; |
|
30 | + $first_name = isset($user['billing']['address']['address_first_name']) ? $user['billing']['address']['address_first_name'] : ''; |
|
31 | + $last_name = isset($user['billing']['address']['address_last_name']) ? $user['billing']['address']['address_last_name'] : ''; |
|
32 | 32 | |
33 | - $object = array('object_type'=>'order','object_id'=>$oid); |
|
33 | + $object = array('object_type'=>'order', 'object_id'=>$oid); |
|
34 | 34 | /* Envoie du message de confirmation de commande au client */ |
35 | 35 | $wps_message->wpshop_prepared_email( |
36 | 36 | $email, |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | $object |
40 | 40 | ); |
41 | 41 | // Copy to Administrator |
42 | - if ( !empty($copy_to_administrator) ) { |
|
43 | - $email = get_option( 'wpshop_emails' ); |
|
42 | + if (!empty($copy_to_administrator)) { |
|
43 | + $email = get_option('wpshop_emails'); |
|
44 | 44 | $email = $email['contact_email']; |
45 | 45 | $wps_message->wpshop_prepared_email( |
46 | 46 | $email, |
47 | 47 | 'WPSHOP_ORDER_UPDATE_PRIVATE_MESSAGE', |
48 | - array( 'order_id' => $oid, 'customer_first_name' => $first_name, 'customer_last_name' => $last_name, 'order_key' => $order_meta['order_key'], 'message' => $comment, 'order_addresses' => '', 'order_billing_address' => '', 'order_shipping_address' => ''), |
|
48 | + array('order_id' => $oid, 'customer_first_name' => $first_name, 'customer_last_name' => $last_name, 'order_key' => $order_meta['order_key'], 'message' => $comment, 'order_addresses' => '', 'order_billing_address' => '', 'order_shipping_address' => ''), |
|
49 | 49 | $object |
50 | 50 | ); |
51 | 51 | } |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | |
54 | 54 | // Private comment informations |
55 | 55 | $order_private_comments[] = array( |
56 | - 'comment_date' => current_time('mysql',0), |
|
56 | + 'comment_date' => current_time('mysql', 0), |
|
57 | 57 | 'send_email' => $send_email, |
58 | 58 | 'send_sms' => $send_sms, |
59 | 59 | 'comment' => $comment, |
60 | 60 | 'author' => get_current_user_id() |
61 | 61 | ); |
62 | 62 | // Save it |
63 | - if(is_array($order_private_comments)) { |
|
63 | + if (is_array($order_private_comments)) { |
|
64 | 64 | update_post_meta($oid, '_order_private_comments', $order_private_comments); |
65 | 65 | return true; |
66 | 66 | } |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | class wps_back_office_orders_mdl { |
3 | 5 | function __construct() { |
4 | 6 | |
@@ -63,7 +65,8 @@ discard block |
||
63 | 65 | if(is_array($order_private_comments)) { |
64 | 66 | update_post_meta($oid, '_order_private_comments', $order_private_comments); |
65 | 67 | return true; |
68 | + } else { |
|
69 | + return false; |
|
66 | 70 | } |
67 | - else return false; |
|
68 | 71 | } |
69 | 72 | } |
70 | 73 | \ No newline at end of file |
@@ -1,14 +1,14 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
2 | -class wps_orders_mdl{ |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | +class wps_orders_mdl { |
|
3 | 3 | |
4 | 4 | function __construct() { |
5 | 5 | |
6 | 6 | } |
7 | 7 | |
8 | - function get_customer_orders( $customer_id ) { |
|
8 | + function get_customer_orders($customer_id) { |
|
9 | 9 | global $wpdb; |
10 | - $query = $wpdb->prepare( 'SELECT * FROM '.$wpdb->posts. ' WHERE post_author = %d AND post_type = %s AND post_status != %s AND post_status != %s ORDER BY ID DESC', $customer_id, WPSHOP_NEWTYPE_IDENTIFIER_ORDER, 'auto-draft', 'trash' ); |
|
11 | - $orders = $wpdb->get_results( $query ); |
|
10 | + $query = $wpdb->prepare('SELECT * FROM ' . $wpdb->posts . ' WHERE post_author = %d AND post_type = %s AND post_status != %s AND post_status != %s ORDER BY ID DESC', $customer_id, WPSHOP_NEWTYPE_IDENTIFIER_ORDER, 'auto-draft', 'trash'); |
|
11 | + $orders = $wpdb->get_results($query); |
|
12 | 12 | |
13 | 13 | return $orders; |
14 | 14 | } |
@@ -1,4 +1,6 @@ |
||
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 | * |