@@ -1,4 +1,4 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | /** |
| 3 | 3 | * Plugin database options |
| 4 | 4 | * |
@@ -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 @@ |
||
| 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,35 +1,35 @@ discard block |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | ?> |
| 3 | -<div class="wps-alert-info"><span class="dashicons dashicons-lightbulb"></span><?php printf( __( 'Need help to configure your shipping rules ? <a href="%s" target="_blank">Opt for assistance</a>', 'wpshop'), 'http://shop.eoxia.com/ecommerce/wpshop_product/assistance-wordpress/' ); ?></div> |
|
| 3 | +<div class="wps-alert-info"><span class="dashicons dashicons-lightbulb"></span><?php printf(__('Need help to configure your shipping rules ? <a href="%s" target="_blank">Opt for assistance</a>', 'wpshop'), 'http://shop.eoxia.com/ecommerce/wpshop_product/assistance-wordpress/'); ?></div> |
|
| 4 | 4 | |
| 5 | 5 | <div class="wps-boxed"> |
| 6 | 6 | <span class="wps-h2"><?php _e('General configurations', 'wpshop')?></span> |
| 7 | 7 | <div> |
| 8 | 8 | <?php |
| 9 | - $wps_shipping_mode_config_extra_params = apply_filters('wps_shipping_mode_config_extra_params_'.$k, $k ); |
|
| 9 | + $wps_shipping_mode_config_extra_params = apply_filters('wps_shipping_mode_config_extra_params_' . $k, $k); |
|
| 10 | 10 | echo ($wps_shipping_mode_config_extra_params != $k) ? $wps_shipping_mode_config_extra_params : ''; |
| 11 | 11 | ?> |
| 12 | 12 | </div> |
| 13 | 13 | <div class="wps-form-group"> |
| 14 | 14 | <label for="wps_shipping_mode_<?php echo $k; ?>_explanation"><?php _e('Explanation', 'wpshop'); ?> :</label> |
| 15 | - <div class="wps-form"><textarea id="wps_shipping_mode_<?php echo $k; ?>_explanation" name="wps_shipping_mode[modes][<?php echo $k; ?>][explanation]"><?php echo ( !empty($shipping_mode['explanation']) ) ? $shipping_mode['explanation'] : ''; ?></textarea></div> |
|
| 15 | + <div class="wps-form"><textarea id="wps_shipping_mode_<?php echo $k; ?>_explanation" name="wps_shipping_mode[modes][<?php echo $k; ?>][explanation]"><?php echo (!empty($shipping_mode['explanation'])) ? $shipping_mode['explanation'] : ''; ?></textarea></div> |
|
| 16 | 16 | </div> |
| 17 | 17 | |
| 18 | 18 | <span class="wps-h5"><?php _e('Free shipping cost configuration', 'wpshop')?></span> |
| 19 | 19 | <div class="wps-row wps-gridwrapper2-padded"> |
| 20 | 20 | <!-- Free shipping for all orders --> |
| 21 | 21 | <div class="wps-form-group"> |
| 22 | - <div class="wps-form"><input type="checkbox" name="wps_shipping_mode[modes][<?php echo $k; ?>][free_shipping]" id="<?php echo $k; ?>_free_shipping" <?php echo ( !empty($shipping_mode['free_shipping']) ) ? 'checked="checked"' : ''; ?> /> <label for="<?php echo $k; ?>_free_shipping"><?php _e('Activate free shipping for all orders', 'wpshop'); ?></label></div> |
|
| 22 | + <div class="wps-form"><input type="checkbox" name="wps_shipping_mode[modes][<?php echo $k; ?>][free_shipping]" id="<?php echo $k; ?>_free_shipping" <?php echo (!empty($shipping_mode['free_shipping'])) ? 'checked="checked"' : ''; ?> /> <label for="<?php echo $k; ?>_free_shipping"><?php _e('Activate free shipping for all orders', 'wpshop'); ?></label></div> |
|
| 23 | 23 | </div> |
| 24 | 24 | |
| 25 | 25 | <!-- Free shipping for orders which amount is over an amount --> |
| 26 | 26 | <div> |
| 27 | 27 | <div class="wps-form-group"> |
| 28 | - <div class="wps-form"><input type="checkbox" name="wps_shipping_mode[modes][<?php echo $k; ?>][activate_free_shipping_from]" id="<?php echo $k; ?>_free_shipping" class="activate_free_shipping_cost_from" <?php echo ( !empty($shipping_mode['activate_free_shipping_from']) ) ? 'checked="checked"' : ''; ?> /><label for="<?php echo $k; ?>_free_from"><?php _e('Activate free shipping for order over amount below', 'wpshop'); ?></label></div> |
|
| 28 | + <div class="wps-form"><input type="checkbox" name="wps_shipping_mode[modes][<?php echo $k; ?>][activate_free_shipping_from]" id="<?php echo $k; ?>_free_shipping" class="activate_free_shipping_cost_from" <?php echo (!empty($shipping_mode['activate_free_shipping_from'])) ? 'checked="checked"' : ''; ?> /><label for="<?php echo $k; ?>_free_from"><?php _e('Activate free shipping for order over amount below', 'wpshop'); ?></label></div> |
|
| 29 | 29 | </div> |
| 30 | 30 | <div class="wps-form-group" id="<?php echo $k; ?>_activate_free_shipping"> |
| 31 | 31 | <label><?php _e('Free shipping cost for order over amount below', 'wpshop'); ?> ( <?php echo wpshop_tools::wpshop_get_currency(); ?> ) :</label> |
| 32 | - <div class="wps-form"><input type="text" name="wps_shipping_mode[modes][<?php echo $k; ?>][free_from]" id="<?php echo $k; ?>_free_from" value="<?php echo ( !empty($shipping_mode['free_from']) ) ? $shipping_mode['free_from'] : ''; ?>" class="wps_little_input" /></div> |
|
| 32 | + <div class="wps-form"><input type="text" name="wps_shipping_mode[modes][<?php echo $k; ?>][free_from]" id="<?php echo $k; ?>_free_from" value="<?php echo (!empty($shipping_mode['free_from'])) ? $shipping_mode['free_from'] : ''; ?>" class="wps_little_input" /></div> |
|
| 33 | 33 | </div> |
| 34 | 34 | </div> |
| 35 | 35 | </div> |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | <span class="wps-h5"><?php _e('Minimum and maximum limit shipping cost configuration', 'wpshop')?></span> |
| 39 | 39 | <div class="wps-row"> |
| 40 | 40 | <div class="wps-form-group"> |
| 41 | - <div class="wps-form"><input type="checkbox" class="wps_shipping_mode_configuation_min_max" name="wps_shipping_mode[modes][<?php echo $k; ?>][min_max][activate]" id="<?php echo $k; ?>_min_max_activate" <?php echo (!empty($shipping_mode['min_max']) && !empty($shipping_mode['min_max']['activate']) ) ? 'checked="checked"' : ''; ?> /> <label for="<?php echo $k; ?>_min_max_activate"><?php _e('Activate the min. and max. shipping cost', 'wpshop'); ?></label></div> |
|
| 41 | + <div class="wps-form"><input type="checkbox" class="wps_shipping_mode_configuation_min_max" name="wps_shipping_mode[modes][<?php echo $k; ?>][min_max][activate]" id="<?php echo $k; ?>_min_max_activate" <?php echo (!empty($shipping_mode['min_max']) && !empty($shipping_mode['min_max']['activate'])) ? 'checked="checked"' : ''; ?> /> <label for="<?php echo $k; ?>_min_max_activate"><?php _e('Activate the min. and max. shipping cost', 'wpshop'); ?></label></div> |
|
| 42 | 42 | </div> |
| 43 | 43 | </div> |
| 44 | 44 | |
@@ -46,12 +46,12 @@ discard block |
||
| 46 | 46 | <div class="wps-row wps-gridwrapper2-padded" id="<?php echo $k; ?>_min_max_shipping_rules_configuration"> |
| 47 | 47 | <div class="wps-form-group"> |
| 48 | 48 | <label><?php _e('Minimum', 'wpshop'); ?> ( <?php echo wpshop_tools::wpshop_get_currency(); ?> ) :</label> |
| 49 | - <div class="wps-form"><input type="text" name="wps_shipping_mode[modes][<?php echo $k; ?>][min_max][min]" value="<?php echo (!empty($shipping_mode['min_max']) && !empty($shipping_mode['min_max']['min']) ) ? $shipping_mode['min_max']['min'] : ''; ?>" /></div> |
|
| 49 | + <div class="wps-form"><input type="text" name="wps_shipping_mode[modes][<?php echo $k; ?>][min_max][min]" value="<?php echo (!empty($shipping_mode['min_max']) && !empty($shipping_mode['min_max']['min'])) ? $shipping_mode['min_max']['min'] : ''; ?>" /></div> |
|
| 50 | 50 | </div> |
| 51 | 51 | |
| 52 | 52 | <div class="wps-form-group"> |
| 53 | 53 | <label><?php _e('Maximum', 'wpshop'); ?> ( <?php echo wpshop_tools::wpshop_get_currency(); ?> ) :</label> |
| 54 | - <div class="wps-form"><input type="text" name="wps_shipping_mode[modes][<?php echo $k; ?>][min_max][max]" value="<?php echo (!empty($shipping_mode['min_max']) && !empty($shipping_mode['min_max']['max']) ) ? $shipping_mode['min_max']['max'] : ''; ?>" /></div> |
|
| 54 | + <div class="wps-form"><input type="text" name="wps_shipping_mode[modes][<?php echo $k; ?>][min_max][max]" value="<?php echo (!empty($shipping_mode['min_max']) && !empty($shipping_mode['min_max']['max'])) ? $shipping_mode['min_max']['max'] : ''; ?>" /></div> |
|
| 55 | 55 | </div> |
| 56 | 56 | </div> |
| 57 | 57 | </div> |
@@ -66,10 +66,10 @@ discard block |
||
| 66 | 66 | <div class="wps-row"> |
| 67 | 67 | <label><?php _e('Choose all countries where you want to ship orders. Let empty you don\'t want limitations', 'wpshop'); ?></label> |
| 68 | 68 | <div class="wps-form"> |
| 69 | - <select name="wps_shipping_mode[modes][<?php echo $k; ?>][limit_destination][country][]" class="chosen_select" multiple data-placeholder="<?php __('Choose a Country', 'wpshop' ); ?>" style="width : 100%"> |
|
| 70 | - <?php if( !empty($countries) ) : |
|
| 71 | - foreach( $countries as $key => $country) : ?> |
|
| 72 | - <option value="<?php echo $key; ?>"<?php echo ( (!empty($shipping_mode['limit_destination']) && !empty($shipping_mode['limit_destination']['country']) && in_array($key, $shipping_mode['limit_destination']['country']) ) ? 'selected="selected"' : '' ); ?>><?php echo $country; ?></option> |
|
| 69 | + <select name="wps_shipping_mode[modes][<?php echo $k; ?>][limit_destination][country][]" class="chosen_select" multiple data-placeholder="<?php __('Choose a Country', 'wpshop'); ?>" style="width : 100%"> |
|
| 70 | + <?php if (!empty($countries)) : |
|
| 71 | + foreach ($countries as $key => $country) : ?> |
|
| 72 | + <option value="<?php echo $key; ?>"<?php echo ((!empty($shipping_mode['limit_destination']) && !empty($shipping_mode['limit_destination']['country']) && in_array($key, $shipping_mode['limit_destination']['country'])) ? 'selected="selected"' : ''); ?>><?php echo $country; ?></option> |
|
| 73 | 73 | <?php endforeach; endif; ?> |
| 74 | 74 | </select> |
| 75 | 75 | </div> |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | <div class="wps-row"> |
| 80 | 80 | <label><?php _e('Write all allowed postcode, separate it by a comma. Let empty if you don\'t want limitations.', 'wpshop'); ?></label> |
| 81 | 81 | <div class="wps-form"> |
| 82 | - <textarea name="wps_shipping_mode[modes][<?php echo $k; ?>][limit_destination][postcode]"><?php echo ( !empty($shipping_mode['limit_destination']) && !empty($shipping_mode['limit_destination']['postcode']) ) ? $shipping_mode['limit_destination']['postcode'] : ''; ?></textarea> |
|
| 82 | + <textarea name="wps_shipping_mode[modes][<?php echo $k; ?>][limit_destination][postcode]"><?php echo (!empty($shipping_mode['limit_destination']) && !empty($shipping_mode['limit_destination']['postcode'])) ? $shipping_mode['limit_destination']['postcode'] : ''; ?></textarea> |
|
| 83 | 83 | </div> |
| 84 | 84 | </div> |
| 85 | 85 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | <div class="wps-row"> |
| 88 | 88 | <label><?php _e('Write all allowed department, separate it by a comma. Let empty if you don\'t want limitations.', 'wpshop'); ?></label> |
| 89 | 89 | <div class="wps-form"> |
| 90 | - <textarea name="wps_shipping_mode[modes][<?php echo $k; ?>][limit_destination][department]"><?php echo ( !empty($shipping_mode['limit_destination']) && !empty($shipping_mode['limit_destination']['department']) ) ? $shipping_mode['limit_destination']['department'] : ''; ?></textarea> |
|
| 90 | + <textarea name="wps_shipping_mode[modes][<?php echo $k; ?>][limit_destination][department]"><?php echo (!empty($shipping_mode['limit_destination']) && !empty($shipping_mode['limit_destination']['department'])) ? $shipping_mode['limit_destination']['department'] : ''; ?></textarea> |
|
| 91 | 91 | </div> |
| 92 | 92 | </div> |
| 93 | 93 | |
@@ -99,15 +99,15 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | <div class="wps-row wps-gridwrapper3-padded"> |
| 101 | 101 | <div class="wps-form-group"> |
| 102 | - <div class="wps-form"><input type="checkbox" name="wps_shipping_mode[modes][<?php echo $k; ?>][custom_shipping_rules][active]" id="<?php echo $k; ?>_custom_shipping_active" <?php echo ( !empty($shipping_mode['custom_shipping_rules']) && !empty($shipping_mode['custom_shipping_rules']['active']) ) ? 'checked="checked"' : ''; ?> /> <label for="<?php echo $k; ?>_custom_shipping_active"><?php _e('Activate custom shipping fees','wpshop'); ?></label></div> |
|
| 102 | + <div class="wps-form"><input type="checkbox" name="wps_shipping_mode[modes][<?php echo $k; ?>][custom_shipping_rules][active]" id="<?php echo $k; ?>_custom_shipping_active" <?php echo (!empty($shipping_mode['custom_shipping_rules']) && !empty($shipping_mode['custom_shipping_rules']['active'])) ? 'checked="checked"' : ''; ?> /> <label for="<?php echo $k; ?>_custom_shipping_active"><?php _e('Activate custom shipping fees', 'wpshop'); ?></label></div> |
|
| 103 | 103 | </div> |
| 104 | 104 | |
| 105 | 105 | <div class="wps-form-group"> |
| 106 | - <div class="wps-form"><input type="checkbox" class="active_postcode_custom_shipping" id="<?php echo $k; ?>_custom_shipping_active_cp" name="wps_shipping_mode[modes][<?php echo $k; ?>][custom_shipping_rules][active_cp]" <?php echo ( !empty($shipping_mode['custom_shipping_rules']) && !empty($shipping_mode['custom_shipping_rules']['active_cp']) ) ? 'checked="checked"' : ''; ?> /> <label for="<?php echo $k; ?>_custom_shipping_active_cp"> <?php _e('Activate custom shipping fees by postcode', 'wpshop'); ?></label></div> |
|
| 106 | + <div class="wps-form"><input type="checkbox" class="active_postcode_custom_shipping" id="<?php echo $k; ?>_custom_shipping_active_cp" name="wps_shipping_mode[modes][<?php echo $k; ?>][custom_shipping_rules][active_cp]" <?php echo (!empty($shipping_mode['custom_shipping_rules']) && !empty($shipping_mode['custom_shipping_rules']['active_cp'])) ? 'checked="checked"' : ''; ?> /> <label for="<?php echo $k; ?>_custom_shipping_active_cp"> <?php _e('Activate custom shipping fees by postcode', 'wpshop'); ?></label></div> |
|
| 107 | 107 | </div> |
| 108 | 108 | |
| 109 | 109 | <div class="wps-form-group"> |
| 110 | - <div class="wps-form"><input type="checkbox" class="active_department_custom_shipping" id="<?php echo $k; ?>_custom_shipping_active_department" name="wps_shipping_mode[modes][<?php echo $k; ?>][custom_shipping_rules][active_department]" <?php echo ( !empty($shipping_mode['custom_shipping_rules']) && !empty($shipping_mode['custom_shipping_rules']['active_department']) ) ? 'checked="checked"' : ''; ?> /> <label for="<?php echo $k; ?>_custom_shipping_active_department"> <?php _e('Activate custom shipping fees by department', 'wpshop'); ?></label></div> |
|
| 110 | + <div class="wps-form"><input type="checkbox" class="active_department_custom_shipping" id="<?php echo $k; ?>_custom_shipping_active_department" name="wps_shipping_mode[modes][<?php echo $k; ?>][custom_shipping_rules][active_department]" <?php echo (!empty($shipping_mode['custom_shipping_rules']) && !empty($shipping_mode['custom_shipping_rules']['active_department'])) ? 'checked="checked"' : ''; ?> /> <label for="<?php echo $k; ?>_custom_shipping_active_department"> <?php _e('Activate custom shipping fees by department', 'wpshop'); ?></label></div> |
|
| 111 | 111 | </div> |
| 112 | 112 | </div> |
| 113 | 113 | |
@@ -118,8 +118,8 @@ discard block |
||
| 118 | 118 | <label for="<?php echo $k; ?>_country_list"><?php _e('Choose a country', 'wpshop'); ?> : </label> |
| 119 | 119 | <div class="wps-form"> |
| 120 | 120 | <select id="<?php echo $k; ?>_country_list" name="country_list" class="shipping_mode_config_input"> |
| 121 | - <?php if( !empty($countries) ) : |
|
| 122 | - foreach( $countries as $key => $country) : ?> |
|
| 121 | + <?php if (!empty($countries)) : |
|
| 122 | + foreach ($countries as $key => $country) : ?> |
|
| 123 | 123 | <option value="<?php echo $key; ?>"><?php echo $country; ?></option> |
| 124 | 124 | <?php endforeach; endif; ?> |
| 125 | 125 | </select> |
@@ -155,17 +155,17 @@ discard block |
||
| 155 | 155 | </div> |
| 156 | 156 | |
| 157 | 157 | <div class="wps-row"> |
| 158 | - <input type="checkbox" id="<?php echo $k; ?>_main_rule" name="main_rule" value="OTHERS"/> <label for="<?php echo $k; ?>_main_rule" class="global_rule_checkbox_indic"><?php _e('Apply a common rule to all others countries','wpshop'); ?></label> |
|
| 158 | + <input type="checkbox" id="<?php echo $k; ?>_main_rule" name="main_rule" value="OTHERS"/> <label for="<?php echo $k; ?>_main_rule" class="global_rule_checkbox_indic"><?php _e('Apply a common rule to all others countries', 'wpshop'); ?></label> |
|
| 159 | 159 | </div> |
| 160 | 160 | |
| 161 | 161 | <div class="wps-form-group"> |
| 162 | 162 | <br/> |
| 163 | - <center><a id="<?php echo $k; ?>_save_rule" role="button" data-nonce="<?php echo wp_create_nonce( 'wpshop_ajax_save_shipping_rule' ); ?>" class="save_rules_button wps-bton-third-mini-rounded"><?php _e('Add the rule', 'wpshop'); ?></a></center> |
|
| 163 | + <center><a id="<?php echo $k; ?>_save_rule" role="button" data-nonce="<?php echo wp_create_nonce('wpshop_ajax_save_shipping_rule'); ?>" class="save_rules_button wps-bton-third-mini-rounded"><?php _e('Add the rule', 'wpshop'); ?></a></center> |
|
| 164 | 164 | <br/> |
| 165 | 165 | </div> |
| 166 | 166 | |
| 167 | - <div class="wps-row wps-table wps-bloc-loader" id="<?php echo $k; ?>_shipping_rules_container" data-nonce="<?php echo wp_create_nonce( 'wpshop_ajax_display_shipping_rules' ); ?>"> |
|
| 168 | - <?php echo $this->generate_shipping_rules_table( $fees_data, $k ); ?> |
|
| 167 | + <div class="wps-row wps-table wps-bloc-loader" id="<?php echo $k; ?>_shipping_rules_container" data-nonce="<?php echo wp_create_nonce('wpshop_ajax_display_shipping_rules'); ?>"> |
|
| 168 | + <?php echo $this->generate_shipping_rules_table($fees_data, $k); ?> |
|
| 169 | 169 | </div> |
| 170 | 170 | </div> |
| 171 | 171 | <center><a role="button" class="wps-bton-first-rounded wps_save_payment_mode_configuration"><?php _e('Save', 'wpshop'); ?></a><br/><br/><br/></center> |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | /** |
| 3 | 3 | * Plugin database options |
| 4 | 4 | * |
@@ -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 @@ |
||
| 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,38 +1,38 @@ discard block |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | class wps_account_dashboard_ctr { |
| 3 | 3 | function __construct() { |
| 4 | - add_shortcode( 'wps_account_dashboard', array( $this, 'display_account_dashboard') ); |
|
| 4 | + add_shortcode('wps_account_dashboard', array($this, 'display_account_dashboard')); |
|
| 5 | 5 | // add_shortcode( 'wps_messages', array( 'wpshop_messages', 'get_histo_messages_per_customer' ) ); |
| 6 | - add_shortcode( 'wps_account_last_actions_resume', array($this, 'display_account_last_actions' ) ); |
|
| 6 | + add_shortcode('wps_account_last_actions_resume', array($this, 'display_account_last_actions')); |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | - function import_data( $part ) { |
|
| 9 | + function import_data($part) { |
|
| 10 | 10 | $output = ''; |
| 11 | 11 | |
| 12 | - switch( $part ) { |
|
| 12 | + switch ($part) { |
|
| 13 | 13 | case 'account' : |
| 14 | - $output = '<div id="wps_account_informations_container" data-nonce="' . wp_create_nonce( 'wps_account_reload_informations' ) . '">'; |
|
| 14 | + $output = '<div id="wps_account_informations_container" data-nonce="' . wp_create_nonce('wps_account_reload_informations') . '">'; |
|
| 15 | 15 | $output .= do_shortcode('[wps_account_informations]'); |
| 16 | 16 | $output .= '</div>'; |
| 17 | - $output .= do_shortcode( '[wps_orders_in_customer_account]'); |
|
| 17 | + $output .= do_shortcode('[wps_orders_in_customer_account]'); |
|
| 18 | 18 | break; |
| 19 | 19 | case 'address' : |
| 20 | - $output .= do_shortcode( '[wps_addresses]' ); |
|
| 20 | + $output .= do_shortcode('[wps_addresses]'); |
|
| 21 | 21 | break; |
| 22 | 22 | case 'order' : |
| 23 | - $output = do_shortcode( '[wps_orders_in_customer_account]' ); |
|
| 23 | + $output = do_shortcode('[wps_orders_in_customer_account]'); |
|
| 24 | 24 | break; |
| 25 | 25 | case 'opinion' : |
| 26 | - $output = do_shortcode( '[wps_opinion]' ); |
|
| 26 | + $output = do_shortcode('[wps_opinion]'); |
|
| 27 | 27 | break; |
| 28 | 28 | case 'wishlist' : |
| 29 | - $output = '<div class="wps-alert-info">' .__( 'This functionnality will be available soon', 'wpshop'). '</div>'; |
|
| 29 | + $output = '<div class="wps-alert-info">' . __('This functionnality will be available soon', 'wpshop') . '</div>'; |
|
| 30 | 30 | break; |
| 31 | 31 | case 'coupon' : |
| 32 | - $output = do_shortcode( '[wps_coupon]' ); |
|
| 32 | + $output = do_shortcode('[wps_coupon]'); |
|
| 33 | 33 | break; |
| 34 | 34 | case 'messages' : |
| 35 | - $output = do_shortcode( '[wps_message_histo]' ); |
|
| 35 | + $output = do_shortcode('[wps_message_histo]'); |
|
| 36 | 36 | break; |
| 37 | 37 | default : |
| 38 | 38 | $output = do_shortcode('[wps_account_informations]'); |
@@ -40,10 +40,10 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - $output = apply_filters( 'wps_my_account_extra_panel_content', $output, $part ); |
|
| 43 | + $output = apply_filters('wps_my_account_extra_panel_content', $output, $part); |
|
| 44 | 44 | |
| 45 | - if( get_current_user_id() == 0 ) { |
|
| 46 | - $output = do_shortcode( '[wpshop_login]' ); |
|
| 45 | + if (get_current_user_id() == 0) { |
|
| 46 | + $output = do_shortcode('[wpshop_login]'); |
|
| 47 | 47 | } |
| 48 | 48 | return $output; |
| 49 | 49 | } |
@@ -52,10 +52,10 @@ discard block |
||
| 52 | 52 | * Display Account Dashboard |
| 53 | 53 | */ |
| 54 | 54 | function display_account_dashboard() { |
| 55 | - $part = ( !empty($_GET['account_dashboard_part']) ) ? sanitize_title( $_GET['account_dashboard_part'] ) : 'account'; |
|
| 56 | - $content = $this->import_data( $part ); |
|
| 55 | + $part = (!empty($_GET['account_dashboard_part'])) ? sanitize_title($_GET['account_dashboard_part']) : 'account'; |
|
| 56 | + $content = $this->import_data($part); |
|
| 57 | 57 | ob_start(); |
| 58 | - require_once( wpshop_tools::get_template_part( WPS_ACCOUNT_DIR, WPS_ACCOUNT_PATH . WPS_ACCOUNT_DIR . "/templates/", "frontend", "account/account-dashboard") ); |
|
| 58 | + require_once(wpshop_tools::get_template_part(WPS_ACCOUNT_DIR, WPS_ACCOUNT_PATH . WPS_ACCOUNT_DIR . "/templates/", "frontend", "account/account-dashboard")); |
|
| 59 | 59 | $output = ob_get_contents(); |
| 60 | 60 | ob_end_clean(); |
| 61 | 61 | echo $output; |
@@ -66,26 +66,26 @@ discard block |
||
| 66 | 66 | global $wpdb; |
| 67 | 67 | $output = ''; |
| 68 | 68 | $user_id = get_current_user_id(); |
| 69 | - if( !empty($user_id) ) { |
|
| 70 | - $query = $wpdb->prepare( 'SELECT * FROM ' .$wpdb->posts. ' WHERE post_type = %s AND post_author = %d', WPSHOP_NEWTYPE_IDENTIFIER_ORDER, $user_id ); |
|
| 71 | - $orders = $wpdb->get_results( $query ); |
|
| 72 | - if( !empty($orders) ) { |
|
| 69 | + if (!empty($user_id)) { |
|
| 70 | + $query = $wpdb->prepare('SELECT * FROM ' . $wpdb->posts . ' WHERE post_type = %s AND post_author = %d', WPSHOP_NEWTYPE_IDENTIFIER_ORDER, $user_id); |
|
| 71 | + $orders = $wpdb->get_results($query); |
|
| 72 | + if (!empty($orders)) { |
|
| 73 | 73 | $orders_list = ''; |
| 74 | - foreach( $orders as $order ) { |
|
| 75 | - $order_meta = get_post_meta( $order->ID, '_order_postmeta', true ); |
|
| 76 | - $order_number = ( !empty($order_meta) && !empty($order_meta['order_key']) ) ? $order_meta['order_key'] : ''; |
|
| 77 | - $order_date = ( !empty($order_meta) && !empty($order_meta['order_date']) ) ? mysql2date( get_option('date_format'), $order_meta['order_date'], true ) : ''; |
|
| 78 | - $order_amount = ( !empty($order_meta) && !empty($order_meta['order_key']) ) ? wpshop_tools::formate_number( $order_meta['order_grand_total'] ).' '.wpshop_tools::wpshop_get_currency( false ) : ''; |
|
| 79 | - $order_available_status = unserialize( WPSHOP_ORDER_STATUS ); |
|
| 80 | - $order_status = ( !empty($order_meta) && !empty($order_meta['order_status']) ) ? __( $order_available_status[ $order_meta['order_status'] ], 'wpshop' ) : ''; |
|
| 74 | + foreach ($orders as $order) { |
|
| 75 | + $order_meta = get_post_meta($order->ID, '_order_postmeta', true); |
|
| 76 | + $order_number = (!empty($order_meta) && !empty($order_meta['order_key'])) ? $order_meta['order_key'] : ''; |
|
| 77 | + $order_date = (!empty($order_meta) && !empty($order_meta['order_date'])) ? mysql2date(get_option('date_format'), $order_meta['order_date'], true) : ''; |
|
| 78 | + $order_amount = (!empty($order_meta) && !empty($order_meta['order_key'])) ? wpshop_tools::formate_number($order_meta['order_grand_total']) . ' ' . wpshop_tools::wpshop_get_currency(false) : ''; |
|
| 79 | + $order_available_status = unserialize(WPSHOP_ORDER_STATUS); |
|
| 80 | + $order_status = (!empty($order_meta) && !empty($order_meta['order_status'])) ? __($order_available_status[$order_meta['order_status']], 'wpshop') : ''; |
|
| 81 | 81 | ob_start(); |
| 82 | - require( wpshop_tools::get_template_part( WPS_ACCOUNT_DIR, WPS_ACCOUNT_PATH . WPS_ACCOUNT_DIR . "/templates/", "frontend", "account/account-dashboard-resume-element") ); |
|
| 82 | + require(wpshop_tools::get_template_part(WPS_ACCOUNT_DIR, WPS_ACCOUNT_PATH . WPS_ACCOUNT_DIR . "/templates/", "frontend", "account/account-dashboard-resume-element")); |
|
| 83 | 83 | $orders_list .= ob_get_contents(); |
| 84 | 84 | ob_end_clean(); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | ob_start(); |
| 88 | - require_once( wpshop_tools::get_template_part( WPS_ACCOUNT_DIR, WPS_ACCOUNT_PATH . WPS_ACCOUNT_DIR . "/templates/","frontend", "account/account-dashboard-resume") ); |
|
| 88 | + require_once(wpshop_tools::get_template_part(WPS_ACCOUNT_DIR, WPS_ACCOUNT_PATH . WPS_ACCOUNT_DIR . "/templates/", "frontend", "account/account-dashboard-resume")); |
|
| 89 | 89 | $output = ob_get_contents(); |
| 90 | 90 | ob_end_clean(); |
| 91 | 91 | } |
@@ -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,13 +1,13 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | ?> |
| 3 | 3 | <div class="wps-boxed"> |
| 4 | 4 | <div id="wps_renew_password_error_container"></div> |
| 5 | 5 | <form action="<?php echo admin_url('admin-ajax.php'); ?>" method="post" id="wps_forgot_password_form" > |
| 6 | 6 | <input type="hidden" name="action" value="wps_forgot_password_request" /> |
| 7 | - <?php wp_nonce_field( 'wps_forgot_password_request' ); ?> |
|
| 7 | + <?php wp_nonce_field('wps_forgot_password_request'); ?> |
|
| 8 | 8 | <div class="wps-form-group"> |
| 9 | - <label for="wps_login_email_address"><?php _e('Email address', 'wpshop');?></label> |
|
| 10 | - <div id="wps_login_email_address" class="wps-form"><input type="text" name="wps_user_login" id="wps_new_password_request" placeholder="<?php _e('Your email address', 'wpshop');?>" /></div> |
|
| 9 | + <label for="wps_login_email_address"><?php _e('Email address', 'wpshop'); ?></label> |
|
| 10 | + <div id="wps_login_email_address" class="wps-form"><input type="text" name="wps_user_login" id="wps_new_password_request" placeholder="<?php _e('Your email address', 'wpshop'); ?>" /></div> |
|
| 11 | 11 | </div> |
| 12 | 12 | <div class="wps-form-group"> |
| 13 | 13 | <?php do_action('lostpassword_form'); ?> |
@@ -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 | ?> |
| 3 | 3 | <div id="wps_renew_password_error_container_true"></div> |
| 4 | 4 | <div class="wps-boxed" id="wps_password_renew"> |
@@ -8,15 +8,15 @@ discard block |
||
| 8 | 8 | <input type="hidden" name="activation_key" value="<?php echo sanitize_text_field($_GET['key']); ?>" /> |
| 9 | 9 | <input type="hidden" name="user_login" value="<?php echo sanitize_text_field($_GET['login']); ?>" /> |
| 10 | 10 | <input type="hidden" name="action" value="wps_forgot_password_renew" /> |
| 11 | - <?php echo wp_nonce_field( 'wps_forgot_password_renew' ); ?> |
|
| 11 | + <?php echo wp_nonce_field('wps_forgot_password_renew'); ?> |
|
| 12 | 12 | |
| 13 | 13 | <div class="wps-form-group"> |
| 14 | - <label for="wps_login_email_address"><?php _e('New password', 'wpshop');?></label> |
|
| 15 | - <div id="wps_login_email_address" class="wps-form"><input type="password" name="pass1" id="wps_new_password_request" placeholder="<?php _e('New password', 'wpshop');?>" /></div> |
|
| 14 | + <label for="wps_login_email_address"><?php _e('New password', 'wpshop'); ?></label> |
|
| 15 | + <div id="wps_login_email_address" class="wps-form"><input type="password" name="pass1" id="wps_new_password_request" placeholder="<?php _e('New password', 'wpshop'); ?>" /></div> |
|
| 16 | 16 | </div> |
| 17 | 17 | <div class="wps-form-group"> |
| 18 | - <label for="wps_login_email_address"><?php _e('Confirm new password', 'wpshop');?></label> |
|
| 19 | - <div id="wps_login_email_address" class="wps-form"><input type="password" name="pass2" id="wps_new_password_request" placeholder="<?php _e('Confirm new password', 'wpshop');?>" /></div> |
|
| 18 | + <label for="wps_login_email_address"><?php _e('Confirm new password', 'wpshop'); ?></label> |
|
| 19 | + <div id="wps_login_email_address" class="wps-form"><input type="password" name="pass2" id="wps_new_password_request" placeholder="<?php _e('Confirm new password', 'wpshop'); ?>" /></div> |
|
| 20 | 20 | </div> |
| 21 | 21 | <div class="wps-form-group"> |
| 22 | 22 | |
@@ -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,41 +1,41 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 2 | - if ( !$force_login ) : ?> |
|
| 3 | -<?php echo do_shortcode( '[wps_first_login]' ); ?> |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | + if (!$force_login) : ?> |
|
| 3 | +<?php echo do_shortcode('[wps_first_login]'); ?> |
|
| 4 | 4 | |
| 5 | 5 | <?php endif; ?> |
| 6 | 6 | <?php global $post; ?> |
| 7 | 7 | <div class="wps-boxed" id="wps_login_form_container"> |
| 8 | - <span class="wps-h5"><?php _e ('Log in', 'wpshop'); ?></span> |
|
| 8 | + <span class="wps-h5"><?php _e('Log in', 'wpshop'); ?></span> |
|
| 9 | 9 | <div class="wp-form-group wps-welcome_back_message" id="welcome_back_message"> |
| 10 | 10 | <span class="welcome_back_message_hello_message"> |
| 11 | - <?php _e( 'Howdy', 'wpshop')?> |
|
| 12 | - </span> <strong id="user_firstname"></strong>, <br/><?php _e( 'we are happy to see you again', 'wpshop'); ?> !</div> |
|
| 11 | + <?php _e('Howdy', 'wpshop')?> |
|
| 12 | + </span> <strong id="user_firstname"></strong>, <br/><?php _e('we are happy to see you again', 'wpshop'); ?> !</div> |
|
| 13 | 13 | <div id="wps_login_error_container"></div> |
| 14 | 14 | <form action="<?php echo admin_url('admin-ajax.php'); ?>" method="post" id="wps_login_form"> |
| 15 | - <?php echo apply_filters( 'login_form_top', '', $args ); ?> |
|
| 15 | + <?php echo apply_filters('login_form_top', '', $args); ?> |
|
| 16 | 16 | <input type="hidden" name="action" value="wps_login_request" /> |
| 17 | - <?php wp_nonce_field( 'control_login_form_request' ); ?> |
|
| 17 | + <?php wp_nonce_field('control_login_form_request'); ?> |
|
| 18 | 18 | <input type="hidden" name="wps-checking-origin" value="<?php echo $post->ID; ?>" /> |
| 19 | 19 | <div class="wps-form-group"> |
| 20 | - <label for="wps_login_email_address"><?php _e('Email address', 'wpshop');?></label> |
|
| 20 | + <label for="wps_login_email_address"><?php _e('Email address', 'wpshop'); ?></label> |
|
| 21 | 21 | <span class="wps-help-inline wps-help-inline-title"></span> |
| 22 | - <div id="wps_login_email_address" class="wps-form"><input type="text" name="wps_login_user_login" id="wps_login_email" placeholder="<?php _e('Your email address', 'wpshop');?>" /></div> |
|
| 22 | + <div id="wps_login_email_address" class="wps-form"><input type="text" name="wps_login_user_login" id="wps_login_email" placeholder="<?php _e('Your email address', 'wpshop'); ?>" /></div> |
|
| 23 | 23 | </div> |
| 24 | 24 | |
| 25 | 25 | <div class="wps-form-group"> |
| 26 | - <label for="wps_login_password"><?php _e('Password', 'wpshop');?></label> |
|
| 27 | - <div id="wps_login_password" class="wps-form"><input type="password" name="wps_login_password" id="wps_login_password" placeholder="<?php _e('Your password', 'wpshop');?>" /></div> |
|
| 26 | + <label for="wps_login_password"><?php _e('Password', 'wpshop'); ?></label> |
|
| 27 | + <div id="wps_login_password" class="wps-form"><input type="password" name="wps_login_password" id="wps_login_password" placeholder="<?php _e('Your password', 'wpshop'); ?>" /></div> |
|
| 28 | 28 | </div> |
| 29 | 29 | <div class="wps-form-group"> |
| 30 | - <?php echo apply_filters( 'login_form_middle', '', $args ); ?> |
|
| 31 | - <?php do_action( 'login_form' ); ?> |
|
| 30 | + <?php echo apply_filters('login_form_middle', '', $args); ?> |
|
| 31 | + <?php do_action('login_form'); ?> |
|
| 32 | 32 | </div> |
| 33 | 33 | <div class="wps-form-group wps-password-reminder"> |
| 34 | - <a href="#" data-nonce="<?php echo wp_create_nonce( 'wps_fill_forgot_password_modal' ); ?>" class="wps-modal-forgot-password-opener wps-password-reminder-link"><?php _e( 'Forgotten password', 'wpshop'); ?> ?</a> <button class="wps-bton-first-alignRight-rounded" id="wps_login_button"><?php _e('Connexion', 'wpshop'); ?></button> |
|
| 34 | + <a href="#" data-nonce="<?php echo wp_create_nonce('wps_fill_forgot_password_modal'); ?>" class="wps-modal-forgot-password-opener wps-password-reminder-link"><?php _e('Forgotten password', 'wpshop'); ?> ?</a> <button class="wps-bton-first-alignRight-rounded" id="wps_login_button"><?php _e('Connexion', 'wpshop'); ?></button> |
|
| 35 | 35 | <div class="wps-password-reminder-content"> |
| 36 | 36 | |
| 37 | 37 | </div> |
| 38 | 38 | </div> |
| 39 | - <?php echo apply_filters( 'login_form_bottom', '', $args ); ?> |
|
| 39 | + <?php echo apply_filters('login_form_bottom', '', $args); ?> |
|
| 40 | 40 | </form> |
| 41 | 41 | </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,19 +1,19 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | ?> |
| 3 | 3 | <div class="wps-boxed" id="wps_login_form_first_step"> |
| 4 | - <span class="wps-h5"><?php _e ('Log in', 'wpshop'); ?> / <?php _e( 'Sign up', 'wpshop'); ?></span> |
|
| 4 | + <span class="wps-h5"><?php _e('Log in', 'wpshop'); ?> / <?php _e('Sign up', 'wpshop'); ?></span> |
|
| 5 | 5 | <div id="wps_login_first_error_container" class="wps-login-first-error"></div> |
| 6 | 6 | <div class="wps-form-group"> |
| 7 | 7 | <label for="wps_login_first_email_address"> |
| 8 | - <?php _e('Email address', 'wpshop');?> |
|
| 8 | + <?php _e('Email address', 'wpshop'); ?> |
|
| 9 | 9 | </label> |
| 10 | 10 | <span class="wps-help-inline"></span> |
| 11 | 11 | <div class="wps-form"> |
| 12 | - <input type="text" name="wps_login_user_login" id="wps_login_first_email_address" placeholder="<?php _e('Your email address', 'wpshop');?>" /> |
|
| 12 | + <input type="text" name="wps_login_user_login" id="wps_login_first_email_address" placeholder="<?php _e('Your email address', 'wpshop'); ?>" /> |
|
| 13 | 13 | </div> |
| 14 | 14 | </div> |
| 15 | 15 | <div class="wps-form-group"> |
| 16 | - <button class="wps-bton-first-alignRight-rounded" data-nonce="<?php echo wp_create_nonce( 'wps_login_first_request' ); ?>" id="wps_first_login_button"> |
|
| 16 | + <button class="wps-bton-first-alignRight-rounded" data-nonce="<?php echo wp_create_nonce('wps_login_first_request'); ?>" id="wps_first_login_button"> |
|
| 17 | 17 | <?php _e('Continue', 'wpshop'); ?> |
| 18 | 18 | </button> |
| 19 | 19 | </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,59 +1,59 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | ?> |
| 3 | 3 | <div class="wps-boxed" id="wps_signup_form_container"> |
| 4 | -<span class="wps-h5"><?php _e ('Sign up', 'wpshop'); ?></span> |
|
| 4 | +<span class="wps-h5"><?php _e('Sign up', 'wpshop'); ?></span> |
|
| 5 | 5 | <div id="wps_signup_error_container"></div> |
| 6 | 6 | <form action="<?php echo admin_url('admin-ajax.php'); ?>" method="post" id="wps_signup_form"> |
| 7 | - <?php if( !empty($args) ) : ?> |
|
| 7 | + <?php if (!empty($args)) : ?> |
|
| 8 | 8 | <input type="hidden" name="wps_sign_up_request_from_admin" value="admin" /> |
| 9 | 9 | <?php endif; ?> |
| 10 | 10 | |
| 11 | 11 | <input type="hidden" name="action" value="wps_signup_request" /> |
| 12 | - <?php wp_nonce_field( 'wps_save_signup_form' ); ?> |
|
| 12 | + <?php wp_nonce_field('wps_save_signup_form'); ?> |
|
| 13 | 13 | |
| 14 | 14 | <?php |
| 15 | - if( !empty($signup_fields) ) : |
|
| 15 | + if (!empty($signup_fields)) : |
|
| 16 | 16 | |
| 17 | 17 | $wpshop_billing_address = get_option('wpshop_billing_address'); |
| 18 | 18 | |
| 19 | - foreach( $signup_fields as $signup_field ) : |
|
| 20 | - if( isset( $signup_field->code ) && $signup_field->code == 'is_provider' ) { |
|
| 19 | + foreach ($signup_fields as $signup_field) : |
|
| 20 | + if (isset($signup_field->code) && $signup_field->code == 'is_provider') { |
|
| 21 | 21 | continue; |
| 22 | 22 | } |
| 23 | - $value = ( !empty($signup_field->frontend_input) && $signup_field->frontend_input != 'password' && !empty($_POST) && !empty($_POST['attribute']) && !empty($_POST['attribute'][$signup_field->data_type]) && !empty( $_POST['attribute'][$signup_field->data_type][$signup_field->code]) ) ? sanitize_text_field( $_POST['attribute'][$signup_field->data_type][$signup_field->code] ) : ''; |
|
| 24 | - $attribute_output_def = wpshop_attributes::get_attribute_field_definition( $signup_field, $value, array( 'from' => 'frontend', ) ); |
|
| 23 | + $value = (!empty($signup_field->frontend_input) && $signup_field->frontend_input != 'password' && !empty($_POST) && !empty($_POST['attribute']) && !empty($_POST['attribute'][$signup_field->data_type]) && !empty($_POST['attribute'][$signup_field->data_type][$signup_field->code])) ? sanitize_text_field($_POST['attribute'][$signup_field->data_type][$signup_field->code]) : ''; |
|
| 24 | + $attribute_output_def = wpshop_attributes::get_attribute_field_definition($signup_field, $value, array('from' => 'frontend',)); |
|
| 25 | 25 | ?> |
| 26 | 26 | <div class="wps-form-group"> |
| 27 | - <label for="<?php echo $signup_field->code; ?>"><?php _e( stripslashes($signup_field->frontend_label), 'wpshop'); ?> <?php echo ( ( !empty($attribute_output_def['required']) && $attribute_output_def['required'] == 'yes' ) ? '<em>*</em>' : '' ); ?></label> |
|
| 27 | + <label for="<?php echo $signup_field->code; ?>"><?php _e(stripslashes($signup_field->frontend_label), 'wpshop'); ?> <?php echo ((!empty($attribute_output_def['required']) && $attribute_output_def['required'] == 'yes') ? '<em>*</em>' : ''); ?></label> |
|
| 28 | 28 | <div id="<?php echo $signup_field->code; ?>" class="wps-form"><?php echo $attribute_output_def['output']; echo $attribute_output_def['options']; ?></div> |
| 29 | 29 | </div> |
| 30 | 30 | <?php |
| 31 | 31 | /** Check confirmation field **/ |
| 32 | 32 | $current_field_key = $signup_field->code; |
| 33 | - if ( $signup_field->_need_verification == 'yes' ) { |
|
| 34 | - $signup_field->code = $signup_field->code.'2'; |
|
| 35 | - $attribute_output_def = wpshop_attributes::get_attribute_field_definition( $signup_field, '', array() ); |
|
| 33 | + if ($signup_field->_need_verification == 'yes') { |
|
| 34 | + $signup_field->code = $signup_field->code . '2'; |
|
| 35 | + $attribute_output_def = wpshop_attributes::get_attribute_field_definition($signup_field, '', array()); |
|
| 36 | 36 | ?> |
| 37 | 37 | <div class="wps-form-group"> |
| 38 | - <label for="<?php echo $signup_field->code; ?>"><?php printf( __('Confirm %s', 'wpshop'), stripslashes( strtolower(__( $signup_field->frontend_label, 'wpshop')) ) ); ?> <?php echo ( ( !empty($attribute_output_def['required']) && $attribute_output_def['required'] == 'yes' ) ? '<em>*</em>' : '' ); ?></label> |
|
| 38 | + <label for="<?php echo $signup_field->code; ?>"><?php printf(__('Confirm %s', 'wpshop'), stripslashes(strtolower(__($signup_field->frontend_label, 'wpshop')))); ?> <?php echo ((!empty($attribute_output_def['required']) && $attribute_output_def['required'] == 'yes') ? '<em>*</em>' : ''); ?></label> |
|
| 39 | 39 | <div id="<?php echo $signup_field->code; ?>" class="wps-form"><?php echo $attribute_output_def['output']; echo $attribute_output_def['options']; ?></div> |
| 40 | 40 | </div> |
| 41 | 41 | <?php |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - if ( !empty($wpshop_billing_address['integrate_into_register_form']) && ($wpshop_billing_address['integrate_into_register_form'] == 'yes') && !empty($wpshop_billing_address['integrate_into_register_form_after_field']) && ($wpshop_billing_address['integrate_into_register_form_after_field'] == $current_field_key ) ) { |
|
| 44 | + if (!empty($wpshop_billing_address['integrate_into_register_form']) && ($wpshop_billing_address['integrate_into_register_form'] == 'yes') && !empty($wpshop_billing_address['integrate_into_register_form_after_field']) && ($wpshop_billing_address['integrate_into_register_form_after_field'] == $current_field_key)) { |
|
| 45 | 45 | $current_connected_user = null; |
| 46 | - if ( get_current_user_id() > 0 ) { |
|
| 47 | - $query = $wpdb->prepare ("SELECT * |
|
| 46 | + if (get_current_user_id() > 0) { |
|
| 47 | + $query = $wpdb->prepare("SELECT * |
|
| 48 | 48 | FROM " . $wpdb->posts . " |
| 49 | - WHERE post_type = '" .WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS. "' |
|
| 49 | + WHERE post_type = '" .WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS . "' |
|
| 50 | 50 | AND post_parent = %d |
| 51 | 51 | ORDER BY ID |
| 52 | - LIMIT 1", get_current_user_id() ); |
|
| 52 | + LIMIT 1", get_current_user_id()); |
|
| 53 | 53 | $current_connected_user = $wpdb->get_var($query); |
| 54 | 54 | } |
| 55 | 55 | $wps_address = new wps_address(); |
| 56 | - echo $wps_address->display_form_fields($wpshop_billing_address['choice'], '', 'true', '', array(), array( 'title' => false, 'address_title' => false, 'field_to_hide' => $wpshop_billing_address[ 'integrate_into_register_form_matching_field' ] ), array(), $current_connected_user); |
|
| 56 | + echo $wps_address->display_form_fields($wpshop_billing_address['choice'], '', 'true', '', array(), array('title' => false, 'address_title' => false, 'field_to_hide' => $wpshop_billing_address['integrate_into_register_form_matching_field']), array(), $current_connected_user); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | endforeach; |