@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <div class="wps-table wps-my-message"> |
4 | 6 | <div class="wps-table-header wps-table-row"> |
@@ -1,39 +1,39 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <div class="wps-table wps-my-message"> |
4 | 4 | <div class="wps-table-header wps-table-row"> |
5 | - <div class="wps-table-cell"><?php _e( 'Message title', 'wpshop' ); ?></div> |
|
6 | - <div class="wps-table-cell"><?php _e( 'Send date', 'wpshop' ); ?></div> |
|
5 | + <div class="wps-table-cell"><?php _e('Message title', 'wpshop'); ?></div> |
|
6 | + <div class="wps-table-cell"><?php _e('Send date', 'wpshop'); ?></div> |
|
7 | 7 | </div> |
8 | - <?php if( !empty($messages_data) && is_array($messages_data) ) :?> |
|
9 | - <?php foreach( $messages_data as $meta_id => $message ) : ?> |
|
8 | + <?php if (!empty($messages_data) && is_array($messages_data)) :?> |
|
9 | + <?php foreach ($messages_data as $meta_id => $message) : ?> |
|
10 | 10 | |
11 | - <div class="wps-table-content wps-table-row" data-nonce="<?php echo wp_create_nonce( 'get_content_message' ); ?>" data-id="<?php echo $meta_id; ?>" data-date="<?php echo substr($message[0]['mess_dispatch_date'][0], 0, 7); ?>"> |
|
11 | + <div class="wps-table-content wps-table-row" data-nonce="<?php echo wp_create_nonce('get_content_message'); ?>" data-id="<?php echo $meta_id; ?>" data-date="<?php echo substr($message[0]['mess_dispatch_date'][0], 0, 7); ?>"> |
|
12 | 12 | <div class="wps-table-cell"> |
13 | 13 | <span class="wps-message-title"><?php echo $message[0]['mess_title']; ?></span> |
14 | - <?php if( !empty($message[0]['mess_object_id']) ) { |
|
15 | - $order_meta = get_post_meta( $message[0]['mess_object_id'], '_order_postmeta', true ); |
|
16 | - $comments = get_post_meta( $message[0]['mess_object_id'], '_order_private_comments', true); |
|
17 | - if(!empty($comments)) { |
|
18 | - foreach ( $comments as $comment ) { |
|
19 | - $user_data = get_userdata( $comment['author'] ); |
|
14 | + <?php if (!empty($message[0]['mess_object_id'])) { |
|
15 | + $order_meta = get_post_meta($message[0]['mess_object_id'], '_order_postmeta', true); |
|
16 | + $comments = get_post_meta($message[0]['mess_object_id'], '_order_private_comments', true); |
|
17 | + if (!empty($comments)) { |
|
18 | + foreach ($comments as $comment) { |
|
19 | + $user_data = get_userdata($comment['author']); |
|
20 | 20 | echo '<br><b>' . $order_meta['order_key'] . '</b> <i>'; |
21 | - printf( __( '%s says on', 'wpshop'), $user_data->user_login ); |
|
22 | - echo ' ' . mysql2date( get_option('links_updated_date_format'), $comment['comment_date'], true ) . '</i> : <br>' . $comment['comment']; |
|
21 | + printf(__('%s says on', 'wpshop'), $user_data->user_login); |
|
22 | + echo ' ' . mysql2date(get_option('links_updated_date_format'), $comment['comment_date'], true) . '</i> : <br>' . $comment['comment']; |
|
23 | 23 | } |
24 | 24 | } |
25 | 25 | } ?> |
26 | 26 | </div> |
27 | 27 | <div class="wps-table-cell"> |
28 | - <?php if( !empty($message[0]['mess_dispatch_date']) ) : ?> |
|
28 | + <?php if (!empty($message[0]['mess_dispatch_date'])) : ?> |
|
29 | 29 | <ul> |
30 | - <?php foreach( $message[0]['mess_dispatch_date'] as $date ) : ?> |
|
31 | - <li><?php echo mysql2date( get_option('date_format') . ' ' . get_option('time_format') , $date, true ); ?></li> |
|
30 | + <?php foreach ($message[0]['mess_dispatch_date'] as $date) : ?> |
|
31 | + <li><?php echo mysql2date(get_option('date_format') . ' ' . get_option('time_format'), $date, true); ?></li> |
|
32 | 32 | <?php endforeach; ?> |
33 | 33 | </ul> |
34 | 34 | <?php endif; ?> |
35 | 35 | </div> |
36 | 36 | </div> |
37 | 37 | <?php endforeach; ?> |
38 | - <?php endif;?> |
|
38 | + <?php endif; ?> |
|
39 | 39 | </div> |
@@ -1,2 +1,2 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | \ No newline at end of file |
@@ -1,2 +1,4 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | \ No newline at end of file |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <div style="font: 11px/1.35em Arial, Helvetica, sans-serif; color: #000;"> |
4 | 4 | <table style="width: 100%;" border="0" cellspacing="0" cellpadding="0" bgcolor="#F0F0F0"> |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | </tr> |
21 | 21 | <tr> |
22 | 22 | <td style="background-color: #dcdcdc; text-align: center;" align="center" bgcolor="#F0F0F0"> |
23 | - <span style="font-size: 12px; line-height: 16px; margin: 0px;"><?php echo get_bloginfo( 'name' ); ?></span> |
|
23 | + <span style="font-size: 12px; line-height: 16px; margin: 0px;"><?php echo get_bloginfo('name'); ?></span> |
|
24 | 24 | </tr> |
25 | 25 | </tbody> |
26 | 26 | </table> |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <div style="font: 11px/1.35em Arial, Helvetica, sans-serif; color: #000;"> |
4 | 6 | <table style="width: 100%;" border="0" cellspacing="0" cellpadding="0" bgcolor="#F0F0F0"> |
@@ -1,16 +1,16 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
2 | - if( $messages ) : ?> |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | + if ($messages) : ?> |
|
3 | 3 | <?php |
4 | 4 | $formated_message_tab = array(); |
5 | - foreach( $messages as $message_by_month) : |
|
6 | - if(!empty($message_by_month)): |
|
7 | - foreach( $message_by_month as $m ) : |
|
8 | - if( !empty($formated_message_tab[ $m['mess_user_id'] ]) ) : |
|
9 | - $formated_message_tab[ $m['mess_user_id'] ]['mess_dispatch_date'][] = $m['mess_dispatch_date'][0]; |
|
5 | + foreach ($messages as $message_by_month) : |
|
6 | + if (!empty($message_by_month)): |
|
7 | + foreach ($message_by_month as $m) : |
|
8 | + if (!empty($formated_message_tab[$m['mess_user_id']])) : |
|
9 | + $formated_message_tab[$m['mess_user_id']]['mess_dispatch_date'][] = $m['mess_dispatch_date'][0]; |
|
10 | 10 | else : |
11 | - $formated_message_tab[ $m['mess_user_id'] ] = array( 'mess_user_email' => $m['mess_user_email'], |
|
11 | + $formated_message_tab[$m['mess_user_id']] = array('mess_user_email' => $m['mess_user_email'], |
|
12 | 12 | 'mess_title' => $m['mess_title'], |
13 | - 'mess_dispatch_date' => array( $m['mess_dispatch_date'][0] ) |
|
13 | + 'mess_dispatch_date' => array($m['mess_dispatch_date'][0]) |
|
14 | 14 | ); |
15 | 15 | endif; |
16 | 16 | |
@@ -18,26 +18,26 @@ discard block |
||
18 | 18 | endif; |
19 | 19 | endforeach; |
20 | 20 | |
21 | - if( !empty($formated_message_tab) ) : |
|
21 | + if (!empty($formated_message_tab)) : |
|
22 | 22 | ?> |
23 | 23 | <div class="wps-table"> |
24 | 24 | <div class="wps-table-header wps-table-row"> |
25 | - <div class="wps-table-cell"><?php _e( 'User ID', 'wpshop'); ?></div> |
|
26 | - <div class="wps-table-cell"><?php _e( 'User e-mail', 'wpshop'); ?></div> |
|
27 | - <div class="wps-table-cell"><?php _e( 'Message title', 'wpshop'); ?></div> |
|
28 | - <div class="wps-table-cell"><?php _e( 'Dispatch dates', 'wpshop'); ?></div> |
|
25 | + <div class="wps-table-cell"><?php _e('User ID', 'wpshop'); ?></div> |
|
26 | + <div class="wps-table-cell"><?php _e('User e-mail', 'wpshop'); ?></div> |
|
27 | + <div class="wps-table-cell"><?php _e('Message title', 'wpshop'); ?></div> |
|
28 | + <div class="wps-table-cell"><?php _e('Dispatch dates', 'wpshop'); ?></div> |
|
29 | 29 | </div> |
30 | 30 | |
31 | 31 | <?php |
32 | - foreach( $formated_message_tab as $user_id => $formated_message ) : |
|
32 | + foreach ($formated_message_tab as $user_id => $formated_message) : |
|
33 | 33 | ?> |
34 | 34 | <div class="wps-table-content wps-table-row"> |
35 | - <div class="wps-table-cell"><?php echo '#'.$user_id; ?></div> |
|
35 | + <div class="wps-table-cell"><?php echo '#' . $user_id; ?></div> |
|
36 | 36 | <div class="wps-table-cell"><?php echo $formated_message['mess_user_email']; ?></div> |
37 | 37 | <div class="wps-table-cell"><?php echo $formated_message['mess_title']; ?></div> |
38 | 38 | <div class="wps-table-cell"><ul> |
39 | - <?php if( !empty($formated_message['mess_dispatch_date']) ) : |
|
40 | - foreach( $formated_message['mess_dispatch_date'] as $dispatch_date ) : |
|
39 | + <?php if (!empty($formated_message['mess_dispatch_date'])) : |
|
40 | + foreach ($formated_message['mess_dispatch_date'] as $dispatch_date) : |
|
41 | 41 | ?> |
42 | 42 | <li><?php echo mysql2date('d F Y H:i:s', $dispatch_date, true); ?></li> |
43 | 43 | <?php |
@@ -54,5 +54,5 @@ discard block |
||
54 | 54 | endif; |
55 | 55 | ?> |
56 | 56 | <?php else : ?> |
57 | -<div class="wps-alert-info"><?php _e( 'This message has never been send', 'wpshop' )?></div> |
|
57 | +<div class="wps-alert-info"><?php _e('This message has never been send', 'wpshop')?></div> |
|
58 | 58 | <?php endif; ?> |
59 | 59 | \ No newline at end of file |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | if( $messages ) : ?> |
3 | 5 | <?php |
4 | 6 | $formated_message_tab = array(); |
@@ -7,11 +9,13 @@ discard block |
||
7 | 9 | foreach( $message_by_month as $m ) : |
8 | 10 | if( !empty($formated_message_tab[ $m['mess_user_id'] ]) ) : |
9 | 11 | $formated_message_tab[ $m['mess_user_id'] ]['mess_dispatch_date'][] = $m['mess_dispatch_date'][0]; |
10 | - else : |
|
12 | + else { |
|
13 | + : |
|
11 | 14 | $formated_message_tab[ $m['mess_user_id'] ] = array( 'mess_user_email' => $m['mess_user_email'], |
12 | 15 | 'mess_title' => $m['mess_title'], |
13 | 16 | 'mess_dispatch_date' => array( $m['mess_dispatch_date'][0] ) |
14 | 17 | ); |
18 | + } |
|
15 | 19 | endif; |
16 | 20 | |
17 | 21 | endforeach; |
@@ -53,6 +57,9 @@ discard block |
||
53 | 57 | <?php |
54 | 58 | endif; |
55 | 59 | ?> |
56 | -<?php else : ?> |
|
60 | +<?php else { |
|
61 | + : ?> |
|
57 | 62 | <div class="wps-alert-info"><?php _e( 'This message has never been send', 'wpshop' )?></div> |
58 | -<?php endif; ?> |
|
59 | 63 | \ No newline at end of file |
64 | +<?php endif; |
|
65 | +} |
|
66 | +?> |
|
60 | 67 | \ No newline at end of file |
@@ -1,49 +1,49 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <table style="width:600px; border : 1px solid #A4A4A4; clear : both;"> |
4 | 4 | <tr> |
5 | 5 | <td width="600" valign="middle" align="left" bgcolor="#1D7DC1" height="40" style="color : #FFFFFF"> |
6 | - <?php _e( 'Customer personnal informations', 'wpshop'); ?> |
|
6 | + <?php _e('Customer personnal informations', 'wpshop'); ?> |
|
7 | 7 | </td> |
8 | 8 | </tr> |
9 | 9 | <tr> |
10 | 10 | <td width="600"> |
11 | 11 | <ul> |
12 | - <?php foreach( $attributes_sets as $attributes_set ) : |
|
13 | - $query = $wpdb->prepare( 'SELECT * FROM ' .WPSHOP_DBT_ATTRIBUTE_GROUP. ' WHERE attribute_set_id = %d AND status = %s', $attributes_set->id, 'valid'); |
|
14 | - $attributes_groups = $wpdb->get_results( $query ); |
|
15 | - if( !empty($attributes_groups) ) : |
|
16 | - foreach( $attributes_groups as $attribute_group ) : |
|
17 | - $query = $wpdb->prepare( 'SELECT * FROM '.WPSHOP_DBT_ATTRIBUTE_DETAILS. ' WHERE entity_type_id = %d AND attribute_set_id = %d AND attribute_group_id = %d AND status = %s ORDER BY position', $customer_entity, $attributes_set->id, $attribute_group->id, 'valid' ); |
|
18 | - $attribute_ids = $wpdb->get_results( $query ); |
|
19 | - if( !empty($attribute_ids) ) : |
|
20 | - foreach( $attribute_ids as $attribute_id ) : |
|
21 | - $query = $wpdb->prepare( 'SELECT * FROM '.WPSHOP_DBT_ATTRIBUTE. ' WHERE id = %d AND status = %s', $attribute_id->attribute_id, 'valid' ); |
|
22 | - $attribute_def = $wpdb->get_row( $query ); |
|
23 | - if( !empty($attribute_def) ) : |
|
12 | + <?php foreach ($attributes_sets as $attributes_set) : |
|
13 | + $query = $wpdb->prepare('SELECT * FROM ' . WPSHOP_DBT_ATTRIBUTE_GROUP . ' WHERE attribute_set_id = %d AND status = %s', $attributes_set->id, 'valid'); |
|
14 | + $attributes_groups = $wpdb->get_results($query); |
|
15 | + if (!empty($attributes_groups)) : |
|
16 | + foreach ($attributes_groups as $attribute_group) : |
|
17 | + $query = $wpdb->prepare('SELECT * FROM ' . WPSHOP_DBT_ATTRIBUTE_DETAILS . ' WHERE entity_type_id = %d AND attribute_set_id = %d AND attribute_group_id = %d AND status = %s ORDER BY position', $customer_entity, $attributes_set->id, $attribute_group->id, 'valid'); |
|
18 | + $attribute_ids = $wpdb->get_results($query); |
|
19 | + if (!empty($attribute_ids)) : |
|
20 | + foreach ($attribute_ids as $attribute_id) : |
|
21 | + $query = $wpdb->prepare('SELECT * FROM ' . WPSHOP_DBT_ATTRIBUTE . ' WHERE id = %d AND status = %s', $attribute_id->attribute_id, 'valid'); |
|
22 | + $attribute_def = $wpdb->get_row($query); |
|
23 | + if (!empty($attribute_def)) : |
|
24 | 24 | $user_data = get_userdata($user_id); |
25 | - $user_attribute_meta = get_user_meta( $user_id, $attribute_def->code, true ); |
|
25 | + $user_attribute_meta = get_user_meta($user_id, $attribute_def->code, true); |
|
26 | 26 | |
27 | - if( in_array( $attribute_def->frontend_input, array( 'checkbox', 'radio', 'select') ) ) : |
|
28 | - $query = $wpdb->prepare( 'SELECT label FROM '.WPSHOP_DBT_ATTRIBUTE_VALUES_OPTIONS. ' WHERE id = %d', $user_attribute_meta); |
|
29 | - $value = $wpdb->get_var( $query ); |
|
27 | + if (in_array($attribute_def->frontend_input, array('checkbox', 'radio', 'select'))) : |
|
28 | + $query = $wpdb->prepare('SELECT label FROM ' . WPSHOP_DBT_ATTRIBUTE_VALUES_OPTIONS . ' WHERE id = %d', $user_attribute_meta); |
|
29 | + $value = $wpdb->get_var($query); |
|
30 | 30 | else : |
31 | 31 | $value = $user_attribute_meta; |
32 | 32 | endif; |
33 | 33 | |
34 | 34 | /** Specific case for datetime*/ |
35 | - switch ( strtolower( $attribute_def->data_type ) ) : |
|
35 | + switch (strtolower($attribute_def->data_type)) : |
|
36 | 36 | case 'datetime': |
37 | - $value = mysql2date( ( 10 == strlen( $value ) || ( 10 < strlen( $value ) && "00:00:00" == substr( $value, -8 ) ) ? get_option( 'date_format' ) : get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) ), $value, true ); |
|
37 | + $value = mysql2date((10 == strlen($value) || (10 < strlen($value) && "00:00:00" == substr($value, -8)) ? get_option('date_format') : get_option('date_format') . ' ' . get_option('time_format')), $value, true); |
|
38 | 38 | break; |
39 | 39 | endswitch; |
40 | 40 | |
41 | 41 | /** Specific case for user email */ |
42 | - if ( 'user_email' == $attribute_def->code ) : |
|
42 | + if ('user_email' == $attribute_def->code) : |
|
43 | 43 | $value = $user_data->user_email; |
44 | 44 | endif; |
45 | 45 | |
46 | - if( $attribute_def->code != 'user_pass' ) : |
|
46 | + if ($attribute_def->code != 'user_pass') : |
|
47 | 47 | ?> |
48 | 48 | <li><strong><?php echo $attribute_def->frontend_label; ?> : </strong><?php echo $value; ?></li> |
49 | 49 | <?php |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <table style="width:600px; border : 1px solid #A4A4A4; clear : both;"> |
4 | 6 | <tr> |
@@ -27,8 +29,10 @@ discard block |
||
27 | 29 | if( in_array( $attribute_def->frontend_input, array( 'checkbox', 'radio', 'select') ) ) : |
28 | 30 | $query = $wpdb->prepare( 'SELECT label FROM '.WPSHOP_DBT_ATTRIBUTE_VALUES_OPTIONS. ' WHERE id = %d', $user_attribute_meta); |
29 | 31 | $value = $wpdb->get_var( $query ); |
30 | - else : |
|
32 | + else { |
|
33 | + : |
|
31 | 34 | $value = $user_attribute_meta; |
35 | + } |
|
32 | 36 | endif; |
33 | 37 | |
34 | 38 | /** Specific case for datetime*/ |
@@ -1,62 +1,62 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <table style="width:600px; border : 1px solid #000000; border-collapse : collapse; margin-top:20px; margin-bottom:20px;"> |
4 | 4 | <tr bgcolor="#1D7DC1" height="80" valign="middle" align="center" style="color : #FFFFFF;"> |
5 | - <td width="90"><?php _e('Reference', 'wpshop'); ?> / <?php _e( 'Barcode', 'wpshop' ); ?></td> |
|
5 | + <td width="90"><?php _e('Reference', 'wpshop'); ?> / <?php _e('Barcode', 'wpshop'); ?></td> |
|
6 | 6 | <td width="240"><?php _e('Products', 'wpshop'); ?></td> |
7 | 7 | <td width="90"><?php _e('Quantity', 'wpshop'); ?></td> |
8 | 8 | <td width="90"><?php _e('Unit price ET', 'wpshop'); ?></td> |
9 | 9 | <td width="90"><?php _e('Total HT', 'wpshop'); ?></td> |
10 | 10 | </tr> |
11 | 11 | <?php |
12 | - if ( !empty($orders_infos['order_items']) ) : |
|
13 | - foreach ( $orders_infos['order_items'] as $key=>$item) : |
|
12 | + if (!empty($orders_infos['order_items'])) : |
|
13 | + foreach ($orders_infos['order_items'] as $key=>$item) : |
|
14 | 14 | $item_ref = $item['item_ref']; |
15 | 15 | |
16 | 16 | $is_variation = false; |
17 | - if( get_post_type( $item['item_id'] ) == WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT_VARIATION ) { |
|
17 | + if (get_post_type($item['item_id']) == WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT_VARIATION) { |
|
18 | 18 | $is_variation = true; |
19 | - $parent_def = wpshop_products::get_parent_variation( $item['item_id'] ); |
|
20 | - if( !empty($parent_def) && !empty($parent_def['parent_post']) ) { |
|
19 | + $parent_def = wpshop_products::get_parent_variation($item['item_id']); |
|
20 | + if (!empty($parent_def) && !empty($parent_def['parent_post'])) { |
|
21 | 21 | $parent_post = $parent_def['parent_post']; |
22 | 22 | $item_parent_id = $parent_post->ID; |
23 | - $item_name = $parent_post->post_title; |
|
24 | - $item_barcode = get_post_meta( $item['item_id'], '_barcode', true ); |
|
23 | + $item_name = $parent_post->post_title; |
|
24 | + $item_barcode = get_post_meta($item['item_id'], '_barcode', true); |
|
25 | 25 | } |
26 | 26 | } else { |
27 | 27 | $item_name = $item['item_name']; |
28 | - $item_barcode = get_post_meta( $item['item_id'], '_barcode', true ); |
|
28 | + $item_barcode = get_post_meta($item['item_id'], '_barcode', true); |
|
29 | 29 | } |
30 | 30 | |
31 | - if ( !empty($item['item_id']) ) { |
|
32 | - $product_attribute_order_detail = wpshop_attributes_set::getAttributeSetDetails( get_post_meta($item['item_id'], WPSHOP_PRODUCT_ATTRIBUTE_SET_ID_META_KEY, true) ) ; |
|
31 | + if (!empty($item['item_id'])) { |
|
32 | + $product_attribute_order_detail = wpshop_attributes_set::getAttributeSetDetails(get_post_meta($item['item_id'], WPSHOP_PRODUCT_ATTRIBUTE_SET_ID_META_KEY, true)); |
|
33 | 33 | $output_order = array(); |
34 | - if ( count($product_attribute_order_detail) > 0 && is_array($product_attribute_order_detail) ) { |
|
35 | - foreach ( $product_attribute_order_detail as $product_attr_group_id => $product_attr_group_detail) { |
|
36 | - foreach ( $product_attr_group_detail['attribut'] as $position => $attribute_def) { |
|
37 | - if ( !empty($attribute_def->code) ) |
|
34 | + if (count($product_attribute_order_detail) > 0 && is_array($product_attribute_order_detail)) { |
|
35 | + foreach ($product_attribute_order_detail as $product_attr_group_id => $product_attr_group_detail) { |
|
36 | + foreach ($product_attr_group_detail['attribut'] as $position => $attribute_def) { |
|
37 | + if (!empty($attribute_def->code)) |
|
38 | 38 | $output_order[$attribute_def->code] = $position; |
39 | 39 | } |
40 | 40 | } |
41 | 41 | } |
42 | - $variation_attribute_ordered = wpshop_products::get_selected_variation_display( $item['item_meta'], $output_order, 'invoice_print', 'common'); |
|
42 | + $variation_attribute_ordered = wpshop_products::get_selected_variation_display($item['item_meta'], $output_order, 'invoice_print', 'common'); |
|
43 | 43 | ksort($variation_attribute_ordered['attribute_list']); |
44 | 44 | |
45 | 45 | $cart_more_infos = ''; |
46 | - if( !empty($variation_attribute_ordered['attribute_list']) ) { |
|
47 | - foreach ( $variation_attribute_ordered['attribute_list'] as $attribute_variation_to_output ) { |
|
48 | - $cart_more_infos .= '<li>'.$attribute_variation_to_output.'</li>'; |
|
46 | + if (!empty($variation_attribute_ordered['attribute_list'])) { |
|
47 | + foreach ($variation_attribute_ordered['attribute_list'] as $attribute_variation_to_output) { |
|
48 | + $cart_more_infos .= '<li>' . $attribute_variation_to_output . '</li>'; |
|
49 | 49 | } |
50 | 50 | } |
51 | - $item_name .= !empty($cart_more_infos) ? '<ul>' .$cart_more_infos. '</ul>' : ''; |
|
51 | + $item_name .= !empty($cart_more_infos) ? '<ul>' . $cart_more_infos . '</ul>' : ''; |
|
52 | 52 | } |
53 | 53 | ?> |
54 | 54 | <tr height="40" valign="middle" align="center"> |
55 | 55 | <td><b><?php echo $item_ref; ?></b><br><?php echo $item_barcode; ?></td> |
56 | 56 | <td align="center"><?php echo $item_name; ?></td> |
57 | 57 | <td align="center"><?php echo $item['item_qty']; ?></td> |
58 | - <td><?php echo number_format((float)$item['item_pu_ht'], 2, '.', ''). ' '.$currency_code ?></td> |
|
59 | - <td align="center"><?php echo number_format((float)$item['item_total_ht'], 2, '.', ''). ' '.$currency_code; ?></td> |
|
58 | + <td><?php echo number_format((float)$item['item_pu_ht'], 2, '.', '') . ' ' . $currency_code ?></td> |
|
59 | + <td align="center"><?php echo number_format((float)$item['item_total_ht'], 2, '.', '') . ' ' . $currency_code; ?></td> |
|
60 | 60 | </tr> |
61 | 61 | <?php |
62 | 62 | endforeach; |
@@ -71,21 +71,21 @@ discard block |
||
71 | 71 | <!-- Shippng cost --> |
72 | 72 | <tr height="40" valign="middle"> |
73 | 73 | <td colspan="4" align="right"><?php _e('Shipping cost', 'wpshop'); ?> </td> |
74 | - <td align="center"><?php echo number_format((float)$orders_infos['order_shipping_cost'], 2, '.', ''). ' '.$currency_code; ?></td> |
|
74 | + <td align="center"><?php echo number_format((float)$orders_infos['order_shipping_cost'], 2, '.', '') . ' ' . $currency_code; ?></td> |
|
75 | 75 | </tr> |
76 | 76 | |
77 | 77 | <!-- TVA --> |
78 | 78 | <tr height="40" valign="middle"> |
79 | 79 | <td colspan="4" align="right"><?php _e('Taxes', 'wpshop'); ?> </td> |
80 | - <td align="center"><?php echo number_format((float) ( $orders_infos['order_total_ttc'] - ( $orders_infos['order_total_ht'] + ( $orders_infos['order_shipping_cost'] / ( 1 + ( WPSHOP_VAT_ON_SHIPPING_COST / 100 ) ) ) ) ), 2, '.', ''). ' '.$currency_code ?></td> |
|
80 | + <td align="center"><?php echo number_format((float)($orders_infos['order_total_ttc'] - ($orders_infos['order_total_ht'] + ($orders_infos['order_shipping_cost'] / (1 + (WPSHOP_VAT_ON_SHIPPING_COST / 100))))), 2, '.', '') . ' ' . $currency_code ?></td> |
|
81 | 81 | </tr> |
82 | 82 | <?php |
83 | - if ( !empty($orders_infos['order_tva']) ) : |
|
84 | - foreach ( $orders_infos['order_tva'] as $rate => $montant ) : |
|
83 | + if (!empty($orders_infos['order_tva'])) : |
|
84 | + foreach ($orders_infos['order_tva'] as $rate => $montant) : |
|
85 | 85 | ?> |
86 | 86 | <tr height="40" valign="middle"> |
87 | - <td colspan="4" align="right"><?php _e('Taxes', 'wpshop'); ?> (<?php ( !empty($rate) && $rate == 'VAT_shipping_cost') ? __('on Shipping cost', 'wpshop').' '.WPSHOP_VAT_ON_SHIPPING_COST : $rate;?>%)</td> |
|
88 | - <td align="center"><?php echo number_format((float)$montant, 2, '.', ''). ' '.$currency_code ?></td> |
|
87 | + <td colspan="4" align="right"><?php _e('Taxes', 'wpshop'); ?> (<?php (!empty($rate) && $rate == 'VAT_shipping_cost') ? __('on Shipping cost', 'wpshop') . ' ' . WPSHOP_VAT_ON_SHIPPING_COST : $rate; ?>%)</td> |
|
88 | + <td align="center"><?php echo number_format((float)$montant, 2, '.', '') . ' ' . $currency_code ?></td> |
|
89 | 89 | </tr> |
90 | 90 | <?php |
91 | 91 | endforeach; |
@@ -94,6 +94,6 @@ discard block |
||
94 | 94 | <!-- Shippng cost --> |
95 | 95 | <tr height="40" valign="middle"> |
96 | 96 | <td colspan="4" align="right"><?php _e('Total ATI', 'wpshop'); ?> </td> |
97 | - <td align="center"><?php echo number_format((float)$orders_infos['order_grand_total'], 2, '.', ''). ' '.$currency_code; ?></td> |
|
97 | + <td align="center"><?php echo number_format((float)$orders_infos['order_grand_total'], 2, '.', '') . ' ' . $currency_code; ?></td> |
|
98 | 98 | </tr> |
99 | 99 | </table> |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <table style="width:600px; border : 1px solid #000000; border-collapse : collapse; margin-top:20px; margin-bottom:20px;"> |
4 | 6 | <tr bgcolor="#1D7DC1" height="80" valign="middle" align="center" style="color : #FFFFFF;"> |
@@ -34,8 +36,9 @@ discard block |
||
34 | 36 | if ( count($product_attribute_order_detail) > 0 && is_array($product_attribute_order_detail) ) { |
35 | 37 | foreach ( $product_attribute_order_detail as $product_attr_group_id => $product_attr_group_detail) { |
36 | 38 | foreach ( $product_attr_group_detail['attribut'] as $position => $attribute_def) { |
37 | - if ( !empty($attribute_def->code) ) |
|
38 | - $output_order[$attribute_def->code] = $position; |
|
39 | + if ( !empty($attribute_def->code) ) { |
|
40 | + $output_order[$attribute_def->code] = $position; |
|
41 | + } |
|
39 | 42 | } |
40 | 43 | } |
41 | 44 | } |
@@ -1,4 +1,4 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <table style="width:290px; border : 1px solid #A4A4A4; float : left; margin-right : 5px; margin-left : 5px; margin-bottom:20px;"> |
4 | 4 | <tr bgcolor="#1D7DC1" height="50" valign="middle" align="center" style="color : #FFFFFF"> |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <table style="width:290px; border : 1px solid #A4A4A4; float : left; margin-right : 5px; margin-left : 5px; margin-bottom:20px;"> |
4 | 6 | <tr bgcolor="#1D7DC1" height="50" valign="middle" align="center" style="color : #FFFFFF"> |
@@ -1,11 +1,11 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <table style="width:600px; border : 1px solid #A4A4A4; clear : both;"> |
4 | 4 | <tr> |
5 | 5 | <td width="600" valign="middle" align="center" bgcolor="#1D7DC1" height="40" style="color : #FFFFFF"><?php echo $comment_title; ?></td> |
6 | 6 | </tr> |
7 | 7 | <tr> |
8 | - <td width="600"><?php echo !empty( $comment ) ? $comment : __( 'No comment for this order', 'wpshop' ); ?></td> |
|
8 | + <td width="600"><?php echo !empty($comment) ? $comment : __('No comment for this order', 'wpshop'); ?></td> |
|
9 | 9 | </tr> |
10 | 10 | </table> |
11 | 11 | <div style="clear:both; width : 100%; height : 15px; display : block;"></div> |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <table style="width:600px; border : 1px solid #A4A4A4; clear : both;"> |
4 | 6 | <tr> |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | /** |
3 | 3 | * Main controller file for product administration module |
4 | 4 | * |
@@ -27,22 +27,22 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @return string |
29 | 29 | */ |
30 | - function generate_product_sheet_datas( $product_id ) { |
|
31 | - $product = get_post( $product_id ); |
|
32 | - $shop_type = get_option( 'wpshop_shop_type' ); |
|
33 | - $product_price_data = get_post_meta( $product_id, '_wps_price_infos', true ); |
|
30 | + function generate_product_sheet_datas($product_id) { |
|
31 | + $product = get_post($product_id); |
|
32 | + $shop_type = get_option('wpshop_shop_type'); |
|
33 | + $product_price_data = get_post_meta($product_id, '_wps_price_infos', true); |
|
34 | 34 | |
35 | 35 | // Attributes Def |
36 | - $product_atts_def = $this->get_product_atts_def( $product_id ); |
|
36 | + $product_atts_def = $this->get_product_atts_def($product_id); |
|
37 | 37 | |
38 | 38 | // Attach CSS datas |
39 | 39 | ob_start(); |
40 | - require( wpshop_tools::get_template_part( WPS_PRODUCT_DIR, WPS_PRODUCT_TEMPLATES_MAIN_DIR, "backend", "product_sheet_datas_style") ); |
|
40 | + require(wpshop_tools::get_template_part(WPS_PRODUCT_DIR, WPS_PRODUCT_TEMPLATES_MAIN_DIR, "backend", "product_sheet_datas_style")); |
|
41 | 41 | $output = ob_get_contents(); |
42 | 42 | ob_end_clean(); |
43 | 43 | |
44 | 44 | ob_start(); |
45 | - require( wpshop_tools::get_template_part( WPS_PRODUCT_DIR, WPS_PRODUCT_TEMPLATES_MAIN_DIR, "backend", "product_sheet") ); |
|
45 | + require(wpshop_tools::get_template_part(WPS_PRODUCT_DIR, WPS_PRODUCT_TEMPLATES_MAIN_DIR, "backend", "product_sheet")); |
|
46 | 46 | $output .= ob_get_contents(); |
47 | 47 | ob_end_clean(); |
48 | 48 |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Main controller file for product administration module |
4 | 6 | * |