@@ -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,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 | * Fichier de définition du modèle des taxinomies / File for term model definition |
4 | 6 | * |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | class wps_message_mdl { |
3 | 3 | function __construct() { |
4 | 4 | |
@@ -10,23 +10,23 @@ discard block |
||
10 | 10 | * @param integer $user_id |
11 | 11 | * @return array |
12 | 12 | */ |
13 | - function get_messages_histo( $message_id = '', $user_id = '' ) { |
|
13 | + function get_messages_histo($message_id = '', $user_id = '') { |
|
14 | 14 | global $wpdb; |
15 | 15 | $messages_data = array(); |
16 | - if( empty($user_id) ) { |
|
17 | - $query = $wpdb->prepare( 'SELECT meta_id, meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE %s', '_wpshop_messages_histo_' . $message_id . '%' ); |
|
16 | + if (empty($user_id)) { |
|
17 | + $query = $wpdb->prepare('SELECT meta_id, meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE %s', '_wpshop_messages_histo_' . $message_id . '%'); |
|
18 | 18 | } |
19 | 19 | else { |
20 | - $query = $wpdb->prepare( 'SELECT ID FROM ' . $wpdb->posts . ' WHERE post_author = %d AND post_type = %s', $user_id, WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS ); |
|
21 | - $user_id = $wpdb->get_var( $query ); |
|
22 | - $query = $wpdb->prepare( 'SELECT meta_id, meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE %s AND post_id = %d', '_wpshop_messages_histo_' . $message_id . '%', $user_id ); |
|
20 | + $query = $wpdb->prepare('SELECT ID FROM ' . $wpdb->posts . ' WHERE post_author = %d AND post_type = %s', $user_id, WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS); |
|
21 | + $user_id = $wpdb->get_var($query); |
|
22 | + $query = $wpdb->prepare('SELECT meta_id, meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE %s AND post_id = %d', '_wpshop_messages_histo_' . $message_id . '%', $user_id); |
|
23 | 23 | } |
24 | 24 | |
25 | - $messages = $wpdb->get_results( $query ); |
|
25 | + $messages = $wpdb->get_results($query); |
|
26 | 26 | |
27 | - if( !empty($messages) ) { |
|
28 | - foreach( $messages as $message ) { |
|
29 | - $messages_data[$message->meta_id] = maybe_unserialize( $message->meta_value ); |
|
27 | + if (!empty($messages)) { |
|
28 | + foreach ($messages as $message) { |
|
29 | + $messages_data[$message->meta_id] = maybe_unserialize($message->meta_value); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | return $messages_data; |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Fichier de gestion du modèle des taxinomies / File for term model management |
4 | 6 | * |
@@ -113,8 +115,7 @@ discard block |
||
113 | 115 | } |
114 | 116 | |
115 | 117 | return $object; |
116 | - } |
|
117 | - else { |
|
118 | + } else { |
|
118 | 119 | /** |
119 | 120 | * @todo return error when creation does not work |
120 | 121 | */ |
@@ -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 | * Fichier de définition du modèle des taxinomies / File for term model definition |
4 | 6 | * |
@@ -1,49 +1,49 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | global $wpdb; ?> |
3 | -<?php $opinion_option = get_option( 'wps_opinion' ); ?> |
|
4 | -<?php $opinion_state = !empty($opinion_option) && !empty($opinion_option['active']) ? true : false ; ?> |
|
3 | +<?php $opinion_option = get_option('wps_opinion'); ?> |
|
4 | +<?php $opinion_state = !empty($opinion_option) && !empty($opinion_option['active']) ? true : false; ?> |
|
5 | 5 | <?php |
6 | 6 | // Formate datas |
7 | 7 | $data = array(); |
8 | 8 | $global_display = false; |
9 | - foreach( $product_atts_def as $pad ) : |
|
10 | - foreach( $pad as $attributes_group_name => $attribute_group ) : |
|
11 | - if( $attribute_group['display_on_frontend'] == 'yes' ) : |
|
12 | - $data[ $attribute_group['code'] ]['title'] = __( $attributes_group_name, 'wpshop' ); |
|
9 | + foreach ($product_atts_def as $pad) : |
|
10 | + foreach ($pad as $attributes_group_name => $attribute_group) : |
|
11 | + if ($attribute_group['display_on_frontend'] == 'yes') : |
|
12 | + $data[$attribute_group['code']]['title'] = __($attributes_group_name, 'wpshop'); |
|
13 | 13 | $display = false; |
14 | - if( !empty($attribute_group['attributes']) ) : |
|
15 | - foreach( $attribute_group['attributes'] as $attribute_id => $attribute ) : |
|
16 | - if( $attribute['is_visible_in_front'] == 'yes' && !empty($attribute['value']) ) : |
|
14 | + if (!empty($attribute_group['attributes'])) : |
|
15 | + foreach ($attribute_group['attributes'] as $attribute_id => $attribute) : |
|
16 | + if ($attribute['is_visible_in_front'] == 'yes' && !empty($attribute['value'])) : |
|
17 | 17 | $display = true; |
18 | 18 | $attribute['id'] = $attribute_id; |
19 | - $data[ $attribute_group['code'] ]['attributes'][] = $attribute; |
|
20 | - if ( !$global_display ) { |
|
19 | + $data[$attribute_group['code']]['attributes'][] = $attribute; |
|
20 | + if (!$global_display) { |
|
21 | 21 | $global_display = true; |
22 | 22 | } |
23 | 23 | endif; |
24 | 24 | endforeach; |
25 | 25 | endif; |
26 | - $data[ $attribute_group['code'] ]['display'] = $display; |
|
26 | + $data[$attribute_group['code']]['display'] = $display; |
|
27 | 27 | endif; |
28 | 28 | endforeach; |
29 | 29 | endforeach; |
30 | 30 | ?> |
31 | 31 | |
32 | -<?php if ( $global_display && !empty( $data ) || $opinion_state ) : ?> |
|
32 | +<?php if ($global_display && !empty($data) || $opinion_state) : ?> |
|
33 | 33 | <div class="wps-ui-tab"> |
34 | 34 | <!-- Menu --> |
35 | 35 | <ul> |
36 | 36 | <?php |
37 | 37 | $i = 0; |
38 | - foreach( $data as $attribute_group_code => $attribute_group ) : ?> |
|
39 | - <?php if( $attribute_group['display'] ) : ?> |
|
40 | - <li class="<?php echo ( ($i == 0 ) ? 'wps-activ' : '' ) ;?>"><a data-toogle="wps-tab-<?php echo $attribute_group_code; ?>" href="#"><?php echo $attribute_group['title']; ?></a></li> |
|
38 | + foreach ($data as $attribute_group_code => $attribute_group) : ?> |
|
39 | + <?php if ($attribute_group['display']) : ?> |
|
40 | + <li class="<?php echo (($i == 0) ? 'wps-activ' : ''); ?>"><a data-toogle="wps-tab-<?php echo $attribute_group_code; ?>" href="#"><?php echo $attribute_group['title']; ?></a></li> |
|
41 | 41 | <?php $i++; ?> |
42 | 42 | <?php endif; ?> |
43 | 43 | <?php endforeach; ?> |
44 | - <?php if( $opinion_state ) : ?> |
|
45 | - <li class="<?php echo ( ($i == 0 ) ? 'wps-activ' : '' ) ;?>"><a data-toogle="wps-tab-opinions" href="#"><?php _e( 'Opinions', 'wpshop'); ?></a></li> |
|
46 | - <?php endif;?> |
|
44 | + <?php if ($opinion_state) : ?> |
|
45 | + <li class="<?php echo (($i == 0) ? 'wps-activ' : ''); ?>"><a data-toogle="wps-tab-opinions" href="#"><?php _e('Opinions', 'wpshop'); ?></a></li> |
|
46 | + <?php endif; ?> |
|
47 | 47 | </ul> |
48 | 48 | |
49 | 49 | |
@@ -51,17 +51,17 @@ discard block |
||
51 | 51 | <div> |
52 | 52 | <?php |
53 | 53 | $i = 0; |
54 | - foreach( $data as $attribute_group_code => $attribute_group ) : ?> |
|
55 | - <?php if( $attribute_group['display'] ) : ?> |
|
56 | - <div class="wps-tab-<?php echo $attribute_group_code; ?>" style="<?php echo ( ($i == 0 ) ? 'display : block;' : 'display : none;' ) ;?>" > |
|
54 | + foreach ($data as $attribute_group_code => $attribute_group) : ?> |
|
55 | + <?php if ($attribute_group['display']) : ?> |
|
56 | + <div class="wps-tab-<?php echo $attribute_group_code; ?>" style="<?php echo (($i == 0) ? 'display : block;' : 'display : none;'); ?>" > |
|
57 | 57 | <ul> |
58 | - <?php foreach( $attribute_group['attributes'] as $attribute ) : ?> |
|
59 | - <?php if( $attribute['is_visible_in_front'] == 'yes' ) : ?> |
|
58 | + <?php foreach ($attribute_group['attributes'] as $attribute) : ?> |
|
59 | + <?php if ($attribute['is_visible_in_front'] == 'yes') : ?> |
|
60 | 60 | |
61 | - <?php if( !empty($attribute['value']) ) : ?> |
|
61 | + <?php if (!empty($attribute['value'])) : ?> |
|
62 | 62 | <li> |
63 | - <?php _e( $attribute['frontend_label'], 'wpshop' ); ?> : |
|
64 | - <?php echo do_shortcode('[wpshop_att_val attid="'.$attribute["id"].'" pid="'.$args["pid"].'"]'); ?> |
|
63 | + <?php _e($attribute['frontend_label'], 'wpshop'); ?> : |
|
64 | + <?php echo do_shortcode('[wpshop_att_val attid="' . $attribute["id"] . '" pid="' . $args["pid"] . '"]'); ?> |
|
65 | 65 | <?php wpshop_attributes_unit::the_attribute_unit_by_code_for_product($args['pid'], $attribute['code']); ?> |
66 | 66 | </li> |
67 | 67 | <?php endif; ?> |
@@ -73,9 +73,9 @@ discard block |
||
73 | 73 | <?php $i++; ?> |
74 | 74 | <?php endif; ?> |
75 | 75 | <?php endforeach; ?> |
76 | - <?php if( $opinion_state ) : ?> |
|
77 | - <div class="wps-tab-opinions" style="<?php echo ( ($i == 0 ) ? 'display : block;' : 'display : none;' ) ;?>"> |
|
78 | - <?php echo do_shortcode( '[wps_opinion_product pid="' .$args['pid']. '"]' ); ?> |
|
76 | + <?php if ($opinion_state) : ?> |
|
77 | + <div class="wps-tab-opinions" style="<?php echo (($i == 0) ? 'display : block;' : 'display : none;'); ?>"> |
|
78 | + <?php echo do_shortcode('[wps_opinion_product pid="' . $args['pid'] . '"]'); ?> |
|
79 | 79 | </div> |
80 | 80 | <?php endif; ?> |
81 | 81 | </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,3 +1,3 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; ?> |
|
1 | +<?php if (!defined('ABSPATH')) exit; ?> |
|
2 | 2 | |
3 | 3 | <img style="float: left; width: <?php echo $size; ?>" src="<?php echo $url_thumbnail; ?>" /> |
4 | 4 | \ No newline at end of file |
@@ -1,2 +1,5 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; ?> |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
4 | +?> |
|
2 | 5 | <a href="<?php echo admin_url('admin-ajax.php?width=600&height=550&action=wps_free_product_form_page_tpl&oid='.$order_id); ?>" class="wps-bton-second-mini-rounded alignRight thickbox" title="<?php _e( 'Add free product', 'wpshop' ); ?>" id="add_free_product_bton"><?php _e( 'Add free product', 'wpshop' ); ?></a> |
3 | 6 | \ No newline at end of file |
@@ -1,6 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <div id="product_related"> |
4 | - <?php if ( empty( $atts ) || empty( $atts[ 'with_title' ] ) || ( 'yes' == $atts[ 'with_title' ] ) ) : ?><h3><?php _e( 'Related products', 'wpshop'); ?></h3><?php endif; ?> |
|
4 | + <?php if (empty($atts) || empty($atts['with_title']) || ('yes' == $atts['with_title'])) : ?><h3><?php _e('Related products', 'wpshop'); ?></h3><?php endif; ?> |
|
5 | 5 | <?php echo $related_product_output; ?> |
6 | 6 | </div> |
7 | 7 | \ 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 | /** |
3 | 5 | * Fichier de définition du modèle des taxinomies / File for term model definition |
4 | 6 | * |