@@ -1,16 +1,16 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | |
3 | -DEFINE( 'WPSCLTQUICK_VERSION', 1.0 ); |
|
4 | -DEFINE( 'WPSCLTQUICK_DIR', basename( dirname( __FILE__ ) ) ); |
|
5 | -DEFINE( 'WPSCLTQUICK_PATH', str_replace( "\\", "/", plugin_dir_path( __FILE__ ) ) ); |
|
6 | -DEFINE( 'WPSCLTQUICK_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', WPSCLTQUICK_PATH ) ); |
|
3 | +DEFINE('WPSCLTQUICK_VERSION', 1.0); |
|
4 | +DEFINE('WPSCLTQUICK_DIR', basename(dirname(__FILE__))); |
|
5 | +DEFINE('WPSCLTQUICK_PATH', str_replace("\\", "/", plugin_dir_path(__FILE__))); |
|
6 | +DEFINE('WPSCLTQUICK_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', WPSCLTQUICK_PATH)); |
|
7 | 7 | |
8 | 8 | /** Définition du chemin absolu vers les templates / Define the templates absolute directories */ |
9 | -DEFINE( 'WPSCLTQUICK_TEMPLATES_MAIN_DIR', WPSCLTQUICK_PATH . '/templates/'); |
|
9 | +DEFINE('WPSCLTQUICK_TEMPLATES_MAIN_DIR', WPSCLTQUICK_PATH . '/templates/'); |
|
10 | 10 | |
11 | 11 | |
12 | 12 | /** Inclusion des différents composants / Include plugin components */ |
13 | -require_once( WPSCLTQUICK_PATH . 'controller/wps_customer_quick_add.ctr.php' ); |
|
13 | +require_once(WPSCLTQUICK_PATH . 'controller/wps_customer_quick_add.ctr.php'); |
|
14 | 14 | /** Instanciation du controlleur principal / Main controller instanciation */ |
15 | 15 | $wps_customer_quick_add = new wps_customer_quick_add(); |
16 | 16 |
@@ -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 | * WpShop Cart bootstrap file |
4 | 4 | * @author Jimmy LATOUR- Eoxia dev team <[email protected]> |
@@ -9,24 +9,24 @@ discard block |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | |
12 | -if ( !defined( 'WPSHOP_VERSION' ) ) { |
|
13 | - die( __("You are not allowed to use this service.", 'wpshop') ); |
|
12 | +if (!defined('WPSHOP_VERSION')) { |
|
13 | + die(__("You are not allowed to use this service.", 'wpshop')); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | /** Template Global vars **/ |
17 | 17 | DEFINE('WPS_WISHLIST_DIR', basename(dirname(__FILE__))); |
18 | -DEFINE('WPS_WISHLIST_PATH', str_replace( "\\", "/", str_replace( WPS_WISHLIST_DIR, "", dirname( __FILE__ ) ) ) ); |
|
19 | -DEFINE('WPS_WISHLIST_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', WPS_WISHLIST_PATH ) ); |
|
20 | -DEFINE( 'WPS_WISHLIST_TEMPLATE_DIR', WPS_WISHLIST_PATH . WPS_WISHLIST_DIR . '/templates/'); |
|
21 | -load_plugin_textdomain( 'wps_wishlist_i18n', false, dirname(plugin_basename( __FILE__ )).'/languages/' ); |
|
18 | +DEFINE('WPS_WISHLIST_PATH', str_replace("\\", "/", str_replace(WPS_WISHLIST_DIR, "", dirname(__FILE__)))); |
|
19 | +DEFINE('WPS_WISHLIST_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', WPS_WISHLIST_PATH)); |
|
20 | +DEFINE('WPS_WISHLIST_TEMPLATE_DIR', WPS_WISHLIST_PATH . WPS_WISHLIST_DIR . '/templates/'); |
|
21 | +load_plugin_textdomain('wps_wishlist_i18n', false, dirname(plugin_basename(__FILE__)) . '/languages/'); |
|
22 | 22 | |
23 | 23 | // Include Controller |
24 | -include( plugin_dir_path( __FILE__ ).'controller/wps_wishlist_ctr.php' ); |
|
25 | -include( plugin_dir_path( __FILE__ ).'controller/wps_wishlist_settings_ctr.php' ); |
|
24 | +include(plugin_dir_path(__FILE__) . 'controller/wps_wishlist_ctr.php'); |
|
25 | +include(plugin_dir_path(__FILE__) . 'controller/wps_wishlist_settings_ctr.php'); |
|
26 | 26 | |
27 | 27 | // Init Controller |
28 | 28 | new wps_wishlist_settings(); |
29 | 29 | $wpshop_catalog_product_option = wps_wishlist_settings::get_option(); |
30 | -if( !empty($wpshop_catalog_product_option) ) { |
|
30 | +if (!empty($wpshop_catalog_product_option)) { |
|
31 | 31 | $wps_wishlist = new wps_wishlist(); |
32 | 32 | } |
@@ -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,9 +1,9 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | |
3 | 3 | class wps_wishlist_settings { |
4 | 4 | public static function get_option() { |
5 | 5 | $result = get_option('wpshop_catalog_product_option'); |
6 | - return ( !empty($result) && !empty($result['wps_wishlist_display']) ) ? $result['wps_wishlist_display'] : null; |
|
6 | + return (!empty($result) && !empty($result['wps_wishlist_display'])) ? $result['wps_wishlist_display'] : null; |
|
7 | 7 | } |
8 | 8 | public function __construct() { |
9 | 9 | add_action('wsphop_options', array($this, 'declare_options')); |
@@ -16,6 +16,6 @@ discard block |
||
16 | 16 | |
17 | 17 | function display_option() { |
18 | 18 | $wps_wishlist_display = self::get_option(); |
19 | - require_once( wpshop_tools::get_template_part( WPS_WISHLIST_DIR, WPS_WISHLIST_TEMPLATE_DIR, 'backend/settings', "wishlist_option" ) ); |
|
19 | + require_once(wpshop_tools::get_template_part(WPS_WISHLIST_DIR, WPS_WISHLIST_TEMPLATE_DIR, 'backend/settings', "wishlist_option")); |
|
20 | 20 | } |
21 | 21 | } |
22 | 22 | \ 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 | * |
@@ -1,4 +1,4 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | -<input type="checkbox" id="wpshop_catalog_product_option_wishlist" name="wpshop_catalog_product_option[wps_wishlist_display]" <?php echo ( !empty($wps_wishlist_display) ) ? 'checked="checked"' : ''; ?> /> |
|
3 | +<input type="checkbox" id="wpshop_catalog_product_option_wishlist" name="wpshop_catalog_product_option[wps_wishlist_display]" <?php echo (!empty($wps_wishlist_display)) ? 'checked="checked"' : ''; ?> /> |
|
4 | 4 | <a class="wpshop_infobulle_marker" title="<?php echo __('Activate the possibility to have a wishlist', 'wps_wishlist_i18n'); ?>" href="#">?</a> |
5 | 5 | \ No newline at end of file |
@@ -1,3 +1,5 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <p><?php echo $content; ?></p> |
4 | 6 | \ 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 | * Bootstrap file |
4 | 4 | * |
@@ -6,20 +6,20 @@ discard block |
||
6 | 6 | * @version 1.0 |
7 | 7 | */ |
8 | 8 | |
9 | -DEFINE( 'WPS_LOCALISATION_VERSION', '1.' ); |
|
10 | -DEFINE( 'WPS_LOCALISATION_DIR', basename(dirname(__FILE__))); |
|
11 | -DEFINE( 'WPS_ADDRESS_DIR', basename(dirname(__FILE__))); |
|
12 | -DEFINE( 'WPS_ADDRESS_PATH', dirname( __FILE__ ) ); |
|
13 | -DEFINE( 'WPS_ADDRESS_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', str_replace( "\\", "/", WPS_ADDRESS_PATH ) ) ); |
|
9 | +DEFINE('WPS_LOCALISATION_VERSION', '1.'); |
|
10 | +DEFINE('WPS_LOCALISATION_DIR', basename(dirname(__FILE__))); |
|
11 | +DEFINE('WPS_ADDRESS_DIR', basename(dirname(__FILE__))); |
|
12 | +DEFINE('WPS_ADDRESS_PATH', dirname(__FILE__)); |
|
13 | +DEFINE('WPS_ADDRESS_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', str_replace("\\", "/", WPS_ADDRESS_PATH))); |
|
14 | 14 | |
15 | -DEFINE( 'WPS_LOCALISATION_TEMPLATES_MAIN_DIR', WPS_ADDRESS_PATH . '/templates/' ); |
|
15 | +DEFINE('WPS_LOCALISATION_TEMPLATES_MAIN_DIR', WPS_ADDRESS_PATH . '/templates/'); |
|
16 | 16 | |
17 | 17 | /** Load plugin translation */ |
18 | -load_plugin_textdomain( 'wpeo_geoloc', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); |
|
18 | +load_plugin_textdomain('wpeo_geoloc', false, dirname(plugin_basename(__FILE__)) . '/languages/'); |
|
19 | 19 | |
20 | 20 | /** Load wps address controller */ |
21 | -require_once( WPS_ADDRESS_PATH . '/controller/wps_address_ctr.php' ); |
|
22 | -require_once( WPS_ADDRESS_PATH . '/controller/wps_address_admin_ctr.php' ); |
|
21 | +require_once(WPS_ADDRESS_PATH . '/controller/wps_address_ctr.php'); |
|
22 | +require_once(WPS_ADDRESS_PATH . '/controller/wps_address_admin_ctr.php'); |
|
23 | 23 | |
24 | 24 | // Models |
25 | 25 | //require_once( WPS_ADDRESS_PATH . '/controller/wps_address_ctr.01.php' ); |
@@ -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 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | class wps_address_admin { |
3 | 3 | function __construct() { |
4 | 4 | /** Include the different javascript */ |
5 | - add_action( 'admin_init', array(&$this, 'admin_js') ); |
|
5 | + add_action('admin_init', array(&$this, 'admin_js')); |
|
6 | 6 | |
7 | 7 | // Ajax Actions |
8 | - add_action( 'wp_ajax_wps_order_load_address_edit_form', array( $this, 'load_address_form_action') ); |
|
9 | - add_action( 'wp_ajax_reload_order_addresses_for_customer', array( $this, 'reload_addresses_for_customer') ); |
|
10 | - add_action( 'wp_ajax_delete_address_in_order_panel', array( $this, 'delete_address_in_order_panel') ); |
|
8 | + add_action('wp_ajax_wps_order_load_address_edit_form', array($this, 'load_address_form_action')); |
|
9 | + add_action('wp_ajax_reload_order_addresses_for_customer', array($this, 'reload_addresses_for_customer')); |
|
10 | + add_action('wp_ajax_delete_address_in_order_panel', array($this, 'delete_address_in_order_panel')); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | /** |
@@ -24,20 +24,20 @@ discard block |
||
24 | 24 | * @param integer $address_type |
25 | 25 | * @return string |
26 | 26 | */ |
27 | - function display_customer_address_in_order( $customer_id, $order_id, $address_type ) { |
|
27 | + function display_customer_address_in_order($customer_id, $order_id, $address_type) { |
|
28 | 28 | $output = ''; |
29 | - if( !empty($customer_id) && !empty($order_id) && !empty($address_type) ) { |
|
30 | - $order_infos = get_post_meta( $order_id, '_order_info', true ); |
|
31 | - $order_metadata = get_post_meta( $order_id, '_order_postmeta', true ); |
|
29 | + if (!empty($customer_id) && !empty($order_id) && !empty($address_type)) { |
|
30 | + $order_infos = get_post_meta($order_id, '_order_info', true); |
|
31 | + $order_metadata = get_post_meta($order_id, '_order_postmeta', true); |
|
32 | 32 | |
33 | - $billing_address_option = get_option( 'wpshop_billing_address' ); |
|
34 | - $address_type_indicator = ( !empty($billing_address_option) && !empty($billing_address_option['choice']) && $billing_address_option['choice'] == $address_type ) ? 'billing' : 'shipping'; |
|
33 | + $billing_address_option = get_option('wpshop_billing_address'); |
|
34 | + $address_type_indicator = (!empty($billing_address_option) && !empty($billing_address_option['choice']) && $billing_address_option['choice'] == $address_type) ? 'billing' : 'shipping'; |
|
35 | 35 | |
36 | 36 | // Freeze Address display |
37 | - $address_informations = ( !empty($order_infos) && is_array($order_infos) && !empty($order_infos[$address_type_indicator]) && !empty($order_infos[$address_type_indicator]['address']) ) ? $order_infos[$address_type_indicator]['address'] : ''; |
|
38 | - $address_content = ( !empty($address_informations) && !empty($order_infos[$address_type_indicator]['id']) ) ? wps_address::display_an_address( $address_informations, '', $order_infos[$address_type_indicator]['id'] ) : ''; |
|
37 | + $address_informations = (!empty($order_infos) && is_array($order_infos) && !empty($order_infos[$address_type_indicator]) && !empty($order_infos[$address_type_indicator]['address'])) ? $order_infos[$address_type_indicator]['address'] : ''; |
|
38 | + $address_content = (!empty($address_informations) && !empty($order_infos[$address_type_indicator]['id'])) ? wps_address::display_an_address($address_informations, '', $order_infos[$address_type_indicator]['id']) : ''; |
|
39 | 39 | ob_start(); |
40 | - require( wpshop_tools::get_template_part( WPS_ADDRESS_DIR, WPS_LOCALISATION_TEMPLATES_MAIN_DIR, "backend", "freeze-address-admin-display") ); |
|
40 | + require(wpshop_tools::get_template_part(WPS_ADDRESS_DIR, WPS_LOCALISATION_TEMPLATES_MAIN_DIR, "backend", "freeze-address-admin-display")); |
|
41 | 41 | $output = ob_get_contents(); |
42 | 42 | ob_end_clean(); |
43 | 43 | } |
@@ -49,18 +49,18 @@ discard block |
||
49 | 49 | * @TODO : NONCE |
50 | 50 | */ |
51 | 51 | function load_address_form_action() { |
52 | - $address_type_id = ( !empty($_GET['address_type']) ) ? intval( $_GET['address_type'] ) : null; |
|
53 | - $address_id = ( !empty($_GET['address_id']) ) ? intval( $_GET['address_id'] ) : null; |
|
54 | - $customer_id = ( !empty($_GET['customer_id']) ) ? intval( $_GET['customer_id'] ) : null; |
|
55 | - $_wpnonce = ( !empty( $_REQUEST['_wpnonce'] ) ) ? sanitize_text_field( $_REQUEST['_wpnonce'] ) : ''; |
|
52 | + $address_type_id = (!empty($_GET['address_type'])) ? intval($_GET['address_type']) : null; |
|
53 | + $address_id = (!empty($_GET['address_id'])) ? intval($_GET['address_id']) : null; |
|
54 | + $customer_id = (!empty($_GET['customer_id'])) ? intval($_GET['customer_id']) : null; |
|
55 | + $_wpnonce = (!empty($_REQUEST['_wpnonce'])) ? sanitize_text_field($_REQUEST['_wpnonce']) : ''; |
|
56 | 56 | |
57 | - if ( !wp_verify_nonce( $_wpnonce, 'load_adress_edit_form' ) ) |
|
57 | + if (!wp_verify_nonce($_wpnonce, 'load_adress_edit_form')) |
|
58 | 58 | wp_die(); |
59 | 59 | |
60 | 60 | $wps_address = new wps_address(); |
61 | - $form = $wps_address->loading_address_form( $address_type_id, $address_id, $customer_id ); |
|
61 | + $form = $wps_address->loading_address_form($address_type_id, $address_id, $customer_id); |
|
62 | 62 | |
63 | - wp_die( $form[0] ); |
|
63 | + wp_die($form[0]); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -68,21 +68,21 @@ discard block |
||
68 | 68 | * @TODO : NONCE |
69 | 69 | */ |
70 | 70 | function reload_addresses_for_customer() { |
71 | - $_wpnonce = ( !empty( $_REQUEST['_wpnonce'] ) ) ? sanitize_text_field( $_REQUEST['_wpnonce'] ) : ''; |
|
71 | + $_wpnonce = (!empty($_REQUEST['_wpnonce'])) ? sanitize_text_field($_REQUEST['_wpnonce']) : ''; |
|
72 | 72 | |
73 | - if ( !wp_verify_nonce( $_wpnonce, 'reload_addresses_for_customer' ) ) |
|
73 | + if (!wp_verify_nonce($_wpnonce, 'reload_addresses_for_customer')) |
|
74 | 74 | wp_die(); |
75 | 75 | |
76 | 76 | $status = false; $response = ''; |
77 | - $customer_id = ( !empty($_POST['customer_id']) ) ? intval($_POST['customer_id']) : ''; |
|
78 | - $order_id = ( !empty($_POST['order_id']) ) ? intval($_POST['order_id']) : ''; |
|
79 | - if( !empty($customer_id) ) { |
|
77 | + $customer_id = (!empty($_POST['customer_id'])) ? intval($_POST['customer_id']) : ''; |
|
78 | + $order_id = (!empty($_POST['order_id'])) ? intval($_POST['order_id']) : ''; |
|
79 | + if (!empty($customer_id)) { |
|
80 | 80 | $wps_address = new wps_address(); |
81 | - $response = $wps_address->display_addresses_interface( $customer_id, true, $order_id ); |
|
81 | + $response = $wps_address->display_addresses_interface($customer_id, true, $order_id); |
|
82 | 82 | $status = true; |
83 | 83 | } |
84 | 84 | |
85 | - wp_die( json_encode( array( 'status' => $status, 'response' => $response ) ) ); |
|
85 | + wp_die(json_encode(array('status' => $status, 'response' => $response))); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -91,24 +91,24 @@ discard block |
||
91 | 91 | */ |
92 | 92 | function delete_address_in_order_panel() { |
93 | 93 | $status = false; |
94 | - $address_datas = ( !empty($_POST['address_id']) ) ? wpshop_tools::varSanitizer($_POST['address_id']): null; |
|
95 | - $_wpnonce = ( !empty( $_REQUEST['_wpnonce'] ) ) ? sanitize_text_field( $_REQUEST['_wpnonce'] ) : ''; |
|
94 | + $address_datas = (!empty($_POST['address_id'])) ? wpshop_tools::varSanitizer($_POST['address_id']) : null; |
|
95 | + $_wpnonce = (!empty($_REQUEST['_wpnonce'])) ? sanitize_text_field($_REQUEST['_wpnonce']) : ''; |
|
96 | 96 | |
97 | - if ( !wp_verify_nonce( $_wpnonce, 'delete_address_in_order_panel_' . $address_datas ) ) |
|
97 | + if (!wp_verify_nonce($_wpnonce, 'delete_address_in_order_panel_' . $address_datas)) |
|
98 | 98 | wp_die(); |
99 | 99 | |
100 | 100 | |
101 | - if( !empty($address_datas) ) { |
|
102 | - $address_datas = explode( '-', $address_datas ); |
|
103 | - if( !empty($address_datas) && !empty($address_datas[0]) ) { |
|
104 | - wp_delete_post( $address_datas[0], true ); |
|
105 | - delete_post_meta( $address_datas[0], '_wpshop_address_attribute_set_id' ); |
|
106 | - delete_post_meta( $address_datas[0], '_wpshop_address_metadata' ); |
|
101 | + if (!empty($address_datas)) { |
|
102 | + $address_datas = explode('-', $address_datas); |
|
103 | + if (!empty($address_datas) && !empty($address_datas[0])) { |
|
104 | + wp_delete_post($address_datas[0], true); |
|
105 | + delete_post_meta($address_datas[0], '_wpshop_address_attribute_set_id'); |
|
106 | + delete_post_meta($address_datas[0], '_wpshop_address_metadata'); |
|
107 | 107 | $status = true; |
108 | 108 | } |
109 | 109 | } |
110 | 110 | |
111 | - wp_die( json_encode( array( 'status' => $status ) ) ); |
|
111 | + wp_die(json_encode(array('status' => $status))); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | } |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | class wps_address_admin { |
3 | 5 | function __construct() { |
4 | 6 | /** Include the different javascript */ |
@@ -54,8 +56,9 @@ discard block |
||
54 | 56 | $customer_id = ( !empty($_GET['customer_id']) ) ? intval( $_GET['customer_id'] ) : null; |
55 | 57 | $_wpnonce = ( !empty( $_REQUEST['_wpnonce'] ) ) ? sanitize_text_field( $_REQUEST['_wpnonce'] ) : ''; |
56 | 58 | |
57 | - if ( !wp_verify_nonce( $_wpnonce, 'load_adress_edit_form' ) ) |
|
58 | - wp_die(); |
|
59 | + if ( !wp_verify_nonce( $_wpnonce, 'load_adress_edit_form' ) ) { |
|
60 | + wp_die(); |
|
61 | + } |
|
59 | 62 | |
60 | 63 | $wps_address = new wps_address(); |
61 | 64 | $form = $wps_address->loading_address_form( $address_type_id, $address_id, $customer_id ); |
@@ -70,8 +73,9 @@ discard block |
||
70 | 73 | function reload_addresses_for_customer() { |
71 | 74 | $_wpnonce = ( !empty( $_REQUEST['_wpnonce'] ) ) ? sanitize_text_field( $_REQUEST['_wpnonce'] ) : ''; |
72 | 75 | |
73 | - if ( !wp_verify_nonce( $_wpnonce, 'reload_addresses_for_customer' ) ) |
|
74 | - wp_die(); |
|
76 | + if ( !wp_verify_nonce( $_wpnonce, 'reload_addresses_for_customer' ) ) { |
|
77 | + wp_die(); |
|
78 | + } |
|
75 | 79 | |
76 | 80 | $status = false; $response = ''; |
77 | 81 | $customer_id = ( !empty($_POST['customer_id']) ) ? intval($_POST['customer_id']) : ''; |
@@ -94,8 +98,9 @@ discard block |
||
94 | 98 | $address_datas = ( !empty($_POST['address_id']) ) ? wpshop_tools::varSanitizer($_POST['address_id']): null; |
95 | 99 | $_wpnonce = ( !empty( $_REQUEST['_wpnonce'] ) ) ? sanitize_text_field( $_REQUEST['_wpnonce'] ) : ''; |
96 | 100 | |
97 | - if ( !wp_verify_nonce( $_wpnonce, 'delete_address_in_order_panel_' . $address_datas ) ) |
|
98 | - wp_die(); |
|
101 | + if ( !wp_verify_nonce( $_wpnonce, 'delete_address_in_order_panel_' . $address_datas ) ) { |
|
102 | + wp_die(); |
|
103 | + } |
|
99 | 104 | |
100 | 105 | |
101 | 106 | if( !empty($address_datas) ) { |
@@ -1,24 +1,24 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | $i = 0; |
3 | -if ( !empty($list_addresses) ) : |
|
4 | - foreach( $list_addresses as $address_id => $address ) : |
|
3 | +if (!empty($list_addresses)) : |
|
4 | + foreach ($list_addresses as $address_id => $address) : |
|
5 | 5 | $name_to_display = ''; |
6 | - $name_to_display .= ( !empty($address['address_last_name']) ) ? $address['address_last_name'].' ': ''; |
|
7 | - $name_to_display .= ( !empty($address['address_first_name']) ) ? $address['address_first_name'].' - ': ''; |
|
8 | - $name_to_display .= ( !empty($address['address']) ) ? $address['address'].' ': ''; |
|
9 | - $name_to_display .= ( !empty($address['postcode']) ) ? $address['postcode'].' ': ''; |
|
10 | - $name_to_display .= ( !empty($address['city']) ) ? $address['city'].' ': ''; |
|
6 | + $name_to_display .= (!empty($address['address_last_name'])) ? $address['address_last_name'] . ' ' : ''; |
|
7 | + $name_to_display .= (!empty($address['address_first_name'])) ? $address['address_first_name'] . ' - ' : ''; |
|
8 | + $name_to_display .= (!empty($address['address'])) ? $address['address'] . ' ' : ''; |
|
9 | + $name_to_display .= (!empty($address['postcode'])) ? $address['postcode'] . ' ' : ''; |
|
10 | + $name_to_display .= (!empty($address['city'])) ? $address['city'] . ' ' : ''; |
|
11 | 11 | |
12 | 12 | $class = $checked = ''; |
13 | 13 | |
14 | - $selected_address = ( !empty($_SESSION[ $type.'_address' ] ) ) ? $_SESSION[ $type.'_address' ] : ''; |
|
14 | + $selected_address = (!empty($_SESSION[$type . '_address'])) ? $_SESSION[$type . '_address'] : ''; |
|
15 | 15 | |
16 | - if( !empty($selected_address) && $address_id == $selected_address ) { |
|
16 | + if (!empty($selected_address) && $address_id == $selected_address) { |
|
17 | 17 | $class = 'wps-activ'; |
18 | 18 | $checked = 'checked="checked"'; |
19 | 19 | } |
20 | 20 | else { |
21 | - if( $i == 0 && empty($selected_address) ) { |
|
21 | + if ($i == 0 && empty($selected_address)) { |
|
22 | 22 | $checked = 'checked="checked"'; |
23 | 23 | $class = 'wps-activ'; |
24 | 24 | } |
@@ -30,16 +30,16 @@ discard block |
||
30 | 30 | ?> |
31 | 31 | <li class="<?php echo $class; ?> wps-bloc-loader"> |
32 | 32 | <span><input type="radio" class="wps_select_address" value="<?php echo $address_id; ?>" name="<?php echo $type; ?>_address_id" id="wps_select_address_<?php echo $address_id; ?>" <?php echo $checked; ?> /></span> |
33 | - <span><strong><?php echo ( ( !empty($address['address_title']) ) ? $address['address_title'] : '' ); ?></strong></span> |
|
33 | + <span><strong><?php echo ((!empty($address['address_title'])) ? $address['address_title'] : ''); ?></strong></span> |
|
34 | 34 | <span><?php echo $name_to_display; ?></span> |
35 | 35 | <?php //if( !$is_from_admin ) : ?> |
36 | 36 | <span class="wps-itemList-tools"> |
37 | - <a href="" title="<?php _e( 'Edit this address', 'wpshop' ); ?>" class="wps-address-edit-address" id="wps-address-edit-address-<?php echo $address_id; ?>"><i class="wps-icon-pencil"></i></a> |
|
38 | - <a href="" title="<?php _e( 'Delete this address', 'wpshop' ); ?>" class="wps-address-delete-address" id="wps-address-delete-address-<?php echo $address_id; ?>-<?php echo $address_type_id; ?>"><i class="wps-icon-trash"></i></a> |
|
37 | + <a href="" title="<?php _e('Edit this address', 'wpshop'); ?>" class="wps-address-edit-address" id="wps-address-edit-address-<?php echo $address_id; ?>"><i class="wps-icon-pencil"></i></a> |
|
38 | + <a href="" title="<?php _e('Delete this address', 'wpshop'); ?>" class="wps-address-delete-address" id="wps-address-delete-address-<?php echo $address_id; ?>-<?php echo $address_type_id; ?>"><i class="wps-icon-trash"></i></a> |
|
39 | 39 | </span> |
40 | 40 | <?php //endif; ?> |
41 | 41 | <div class="wps-itemList-content"> |
42 | - <?php echo wps_address::display_an_address( $address, $address_id ); ?> |
|
42 | + <?php echo wps_address::display_an_address($address, $address_id); ?> |
|
43 | 43 | </div> |
44 | 44 | </li> |
45 | 45 | <?php |
@@ -16,13 +16,11 @@ |
||
16 | 16 | if( !empty($selected_address) && $address_id == $selected_address ) { |
17 | 17 | $class = 'wps-activ'; |
18 | 18 | $checked = 'checked="checked"'; |
19 | - } |
|
20 | - else { |
|
19 | + } else { |
|
21 | 20 | if( $i == 0 && empty($selected_address) ) { |
22 | 21 | $checked = 'checked="checked"'; |
23 | 22 | $class = 'wps-activ'; |
24 | - } |
|
25 | - else { |
|
23 | + } else { |
|
26 | 24 | $checked = $class = ''; |
27 | 25 | } |
28 | 26 | } |
@@ -1,11 +1,11 @@ discard block |
||
1 | -<?php if ( !empty($addresses) ) : ?> |
|
1 | +<?php if (!empty($addresses)) : ?> |
|
2 | 2 | <ul class="wps-addresses-list" > |
3 | 3 | <?php |
4 | - foreach ( $addresses as $address_type => $addresses_list_by_type ) : |
|
5 | - foreach ( $addresses_list_by_type as $address_id => $address ) : |
|
4 | + foreach ($addresses as $address_type => $addresses_list_by_type) : |
|
5 | + foreach ($addresses_list_by_type as $address_id => $address) : |
|
6 | 6 | ?> |
7 | - <li id="wps-address-item-<?php echo $address_id ; ?>" > |
|
8 | - <?php require( wpshop_tools::get_template_part( WPS_ADDRESS_DIR, WPS_LOCALISATION_TEMPLATES_MAIN_DIR, "backend", "address" ) ); ?> |
|
7 | + <li id="wps-address-item-<?php echo $address_id; ?>" > |
|
8 | + <?php require(wpshop_tools::get_template_part(WPS_ADDRESS_DIR, WPS_LOCALISATION_TEMPLATES_MAIN_DIR, "backend", "address")); ?> |
|
9 | 9 | </li> |
10 | 10 | <?php |
11 | 11 | endforeach; |
@@ -13,5 +13,5 @@ discard block |
||
13 | 13 | ?> |
14 | 14 | </ul> |
15 | 15 | <?php else: ?> |
16 | -<span class="wps-addresses-list wps-no-result" ><?php _e( 'No addresses founded', 'wpeo_geoloc' ); ?></span> |
|
16 | +<span class="wps-addresses-list wps-no-result" ><?php _e('No addresses founded', 'wpeo_geoloc'); ?></span> |
|
17 | 17 | <?php endif; ?> |
18 | 18 | \ No newline at end of file |
@@ -12,6 +12,9 @@ |
||
12 | 12 | endforeach; |
13 | 13 | ?> |
14 | 14 | </ul> |
15 | -<?php else: ?> |
|
16 | -<span class="wps-addresses-list wps-no-result" ><?php _e( 'No addresses founded', 'wpeo_geoloc' ); ?></span> |
|
15 | +<?php else { |
|
16 | + : ?> |
|
17 | +<span class="wps-addresses-list wps-no-result" ><?php _e( 'No addresses founded', 'wpeo_geoloc' ); |
|
18 | +} |
|
19 | +?></span> |
|
17 | 20 | <?php endif; ?> |
18 | 21 | \ No newline at end of file |
@@ -1,5 +1,5 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <script type="text/javascript" > |
4 | - var wps_address_loading_picture = "<img src='<?php echo admin_url( "images/loading.gif" ); ?>' />"; |
|
4 | + var wps_address_loading_picture = "<img src='<?php echo admin_url("images/loading.gif"); ?>' />"; |
|
5 | 5 | </script> |
6 | 6 | \ 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 | * |