@@ -1,8 +1,8 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | |
3 | 3 | /* Check if file is include. No direct access possible with file url */ |
4 | -if ( !defined( 'WPSHOP_VERSION' ) ) { |
|
5 | - die( __('Access is not allowed by this way', 'wpshop') ); |
|
4 | +if (!defined('WPSHOP_VERSION')) { |
|
5 | + die(__('Access is not allowed by this way', 'wpshop')); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | /** |
@@ -26,15 +26,15 @@ discard block |
||
26 | 26 | * Declare options |
27 | 27 | */ |
28 | 28 | public static function declare_options() { |
29 | - add_settings_section('wpshop_pages_option', '<span class="dashicons dashicons-welcome-write-blog"></span>'.__('WPShop pages configuration', 'wpshop'), array('wpshop_page_options', 'plugin_section_text'), 'wpshop_pages_option'); |
|
29 | + add_settings_section('wpshop_pages_option', '<span class="dashicons dashicons-welcome-write-blog"></span>' . __('WPShop pages configuration', 'wpshop'), array('wpshop_page_options', 'plugin_section_text'), 'wpshop_pages_option'); |
|
30 | 30 | |
31 | 31 | /** Get default messages defined into xml files */ |
32 | - $default_pages = new SimpleXMLElement( file_get_contents( WP_PLUGIN_DIR . '/' . WPSHOP_PLUGIN_DIR . '/assets/datas/default_pages.xml' ) ); |
|
32 | + $default_pages = new SimpleXMLElement(file_get_contents(WP_PLUGIN_DIR . '/' . WPSHOP_PLUGIN_DIR . '/assets/datas/default_pages.xml')); |
|
33 | 33 | /** Read default emails for options creation */ |
34 | - foreach ( $default_pages->xpath( '//pages/page' ) as $page ) { |
|
35 | - if ( ( WPSHOP_DEFINED_SHOP_TYPE == (string)$page->attributes()->shop_type ) || ( 'sale' == WPSHOP_DEFINED_SHOP_TYPE ) ) { |
|
36 | - register_setting( 'wpshop_options', (string)$page->attributes()->code, array( 'wpshop_page_options', 'wpshop_options_validate_wpshop_shop_pages' ) ); |
|
37 | - add_settings_field( (string)$page->attributes()->code, __( (string)$page->description, 'wpshop' ), array( 'wpshop_page_options', 'wps_pages_field' ), 'wpshop_pages_option', 'wpshop_pages_option', array( 'code' => (string)$page->attributes()->code, ) ); |
|
34 | + foreach ($default_pages->xpath('//pages/page') as $page) { |
|
35 | + if ((WPSHOP_DEFINED_SHOP_TYPE == (string)$page->attributes()->shop_type) || ('sale' == WPSHOP_DEFINED_SHOP_TYPE)) { |
|
36 | + register_setting('wpshop_options', (string)$page->attributes()->code, array('wpshop_page_options', 'wpshop_options_validate_wpshop_shop_pages')); |
|
37 | + add_settings_field((string)$page->attributes()->code, __((string)$page->description, 'wpshop'), array('wpshop_page_options', 'wps_pages_field'), 'wpshop_pages_option', 'wpshop_pages_option', array('code' => (string)$page->attributes()->code,)); |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | } |
@@ -43,26 +43,26 @@ discard block |
||
43 | 43 | * Common section description |
44 | 44 | */ |
45 | 45 | public static function plugin_section_text() { |
46 | - printf( __( 'We define default pages content and layout, however you have possibility to %sedit them%s', 'wpshop' ), '<a href="' . admin_url( 'edit.php?post_type=page' ) . '" target="_wps_content_customisation" >', '</a>'); |
|
46 | + printf(__('We define default pages content and layout, however you have possibility to %sedit them%s', 'wpshop'), '<a href="' . admin_url('edit.php?post_type=page') . '" target="_wps_content_customisation" >', '</a>'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Shop pages configurations |
51 | 51 | */ |
52 | - public static function wps_pages_field( $args ) { |
|
52 | + public static function wps_pages_field($args) { |
|
53 | 53 | $content = ''; |
54 | 54 | |
55 | - $current_page_id = get_option( $args['code'], '' ); |
|
55 | + $current_page_id = get_option($args['code'], ''); |
|
56 | 56 | $post_list = get_pages(); |
57 | 57 | if (!empty($post_list)) { |
58 | 58 | $content .= '<select name="' . $args['code'] . '" class="chosen_select shop-content-customisation" ><option value="" >' . __('Choose a page to associate', 'wpshop') . '</option>'; |
59 | - $p=1; |
|
59 | + $p = 1; |
|
60 | 60 | $error = false; |
61 | 61 | foreach ($post_list as $post) { |
62 | 62 | $selected = (!empty($current_page_id) && ($current_page_id == $post->ID)) ? ' selected="selected"' : ''; |
63 | - $content .= '<option'.$selected.' value="' . $post->ID . '" >' . $post->post_title . '</option>'; |
|
63 | + $content .= '<option' . $selected . ' value="' . $post->ID . '" >' . $post->post_title . '</option>'; |
|
64 | 64 | } |
65 | - $content .= '</select> <a id="wps-page-' . $current_page_id . '" title="' . __( 'Edit current selected page', 'wpshop' ) . '" href="' . admin_url( 'post.php?post=' . $current_page_id . '&action=edit' ) . '" target="_wps_content_customisation" class="shop-content-customisation shop-content-customisation-page dashicons dashicons-edit"></a>'; |
|
65 | + $content .= '</select> <a id="wps-page-' . $current_page_id . '" title="' . __('Edit current selected page', 'wpshop') . '" href="' . admin_url('post.php?post=' . $current_page_id . '&action=edit') . '" target="_wps_content_customisation" class="shop-content-customisation shop-content-customisation-page dashicons dashicons-edit"></a>'; |
|
66 | 66 | } |
67 | 67 | wp_reset_query(); |
68 | 68 |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | |
3 | 5 | /* Check if file is include. No direct access possible with file url */ |
4 | 6 | if ( !defined( 'WPSHOP_VERSION' ) ) { |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | /** |
3 | 3 | * WPShop Statistics bootstrap file |
4 | 4 | * @author Jérôme ALLEGRE - Eoxia dev team <[email protected]> |
@@ -7,20 +7,20 @@ discard block |
||
7 | 7 | * @subpackage modules |
8 | 8 | * |
9 | 9 | */ |
10 | -if ( !defined( 'WPSHOP_VERSION' ) ) { |
|
11 | - die( __("You are not allowed to use this service.", 'wpshop') ); |
|
10 | +if (!defined('WPSHOP_VERSION')) { |
|
11 | + die(__("You are not allowed to use this service.", 'wpshop')); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | /** */ |
15 | -DEFINE( 'WPS_STATISTICS_VERSION', '1.0.1' ); |
|
16 | -DEFINE( 'WPS_STATISTICS_DIR', basename(dirname(__FILE__))); |
|
17 | -DEFINE( 'WPS_STATISTICS_PATH', dirname( __FILE__ ) ); |
|
18 | -DEFINE( 'WPS_STATISTICS_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', str_replace( "\\", "/", WPS_STATISTICS_PATH ) ) ); |
|
15 | +DEFINE('WPS_STATISTICS_VERSION', '1.0.1'); |
|
16 | +DEFINE('WPS_STATISTICS_DIR', basename(dirname(__FILE__))); |
|
17 | +DEFINE('WPS_STATISTICS_PATH', dirname(__FILE__)); |
|
18 | +DEFINE('WPS_STATISTICS_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', str_replace("\\", "/", WPS_STATISTICS_PATH))); |
|
19 | 19 | |
20 | 20 | /** Define the templates directories */ |
21 | -DEFINE( 'WPS_STATISTICS_TEMPLATES_MAIN_DIR', WPS_STATISTICS_PATH . '/templates/'); |
|
21 | +DEFINE('WPS_STATISTICS_TEMPLATES_MAIN_DIR', WPS_STATISTICS_PATH . '/templates/'); |
|
22 | 22 | |
23 | -include( plugin_dir_path( __FILE__ ).'/controller/wps_statistics_ctr.php' ); |
|
24 | -include( plugin_dir_path( __FILE__ ).'/model/wps_statisticsmdl.php' ); |
|
23 | +include(plugin_dir_path(__FILE__) . '/controller/wps_statistics_ctr.php'); |
|
24 | +include(plugin_dir_path(__FILE__) . '/model/wps_statisticsmdl.php'); |
|
25 | 25 | |
26 | 26 | $wps_statistics_ctr = new wps_statistics_ctr(); |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * WPShop Statistics bootstrap file |
4 | 6 | * @author Jérôme ALLEGRE - Eoxia dev team <[email protected]> |
@@ -1,4 +1,4 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <div class="postbox"> |
4 | 4 | <h3 class="hndle"><span><?php echo $box_title; ?></span></h3> |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <div class="postbox"> |
4 | 6 | <h3 class="hndle"><span><?php echo $box_title; ?></span></h3> |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | class wps_pos_addon_bank_deposit_histo { |
3 | 5 | public $name_option = 'bank_deposit_historic'; |
4 | 6 | public function __construct() { |
@@ -1,47 +1,47 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | class wps_pos_addon_bank_deposit_histo { |
3 | 3 | public $name_option = 'bank_deposit_historic'; |
4 | 4 | public function __construct() { |
5 | 5 | /** Call metaboxes */ |
6 | - add_action( 'admin_init', array( $this, 'metaboxes' ) ); |
|
7 | - add_action( 'admin_enqueue_scripts', array( $this, 'vars_js' ), 11 ); |
|
8 | - add_option( $this->name_option, array(), '', 'yes' ); |
|
6 | + add_action('admin_init', array($this, 'metaboxes')); |
|
7 | + add_action('admin_enqueue_scripts', array($this, 'vars_js'), 11); |
|
8 | + add_option($this->name_option, array(), '', 'yes'); |
|
9 | 9 | } |
10 | 10 | public function metaboxes() { |
11 | - add_meta_box( 'wpspos-bank-deposit-histo-metabox', __( 'Historic bank deposit', 'wps-pos-i18n' ), array( $this, 'metabox' ), 'wpspos-bank-deposit', 'wpspos-bank-deposit-right' ); |
|
11 | + add_meta_box('wpspos-bank-deposit-histo-metabox', __('Historic bank deposit', 'wps-pos-i18n'), array($this, 'metabox'), 'wpspos-bank-deposit', 'wpspos-bank-deposit-right'); |
|
12 | 12 | } |
13 | 13 | public function metabox() { |
14 | - require( wpshop_tools::get_template_part( WPSPOS_DIR, WPSPOS_TEMPLATES_MAIN_DIR, 'backend/bank_deposit', 'metabox', 'bank_deposit_histo' ) ); |
|
14 | + require(wpshop_tools::get_template_part(WPSPOS_DIR, WPSPOS_TEMPLATES_MAIN_DIR, 'backend/bank_deposit', 'metabox', 'bank_deposit_histo')); |
|
15 | 15 | } |
16 | - public function add_historic( $new_value ) { |
|
17 | - $histo = get_option( $this->name_option ); |
|
16 | + public function add_historic($new_value) { |
|
17 | + $histo = get_option($this->name_option); |
|
18 | 18 | $histo[] = ''; |
19 | - end( $histo ); |
|
20 | - $id = key( $histo ); |
|
19 | + end($histo); |
|
20 | + $id = key($histo); |
|
21 | 21 | $new_value['id'] = $id; |
22 | 22 | $histo[$id] = $new_value; |
23 | - update_option( $this->name_option, $histo ); |
|
23 | + update_option($this->name_option, $histo); |
|
24 | 24 | } |
25 | 25 | public function get_historic() { |
26 | - return array_reverse( get_option( $this->name_option ) ); |
|
26 | + return array_reverse(get_option($this->name_option)); |
|
27 | 27 | } |
28 | - public function row_model( $id, $date, $amount, $payments ) { |
|
29 | - return array( 'id' => $id, 'date' => $date, 'amount' => $amount, 'payments' => $payments ); |
|
28 | + public function row_model($id, $date, $amount, $payments) { |
|
29 | + return array('id' => $id, 'date' => $date, 'amount' => $amount, 'payments' => $payments); |
|
30 | 30 | } |
31 | 31 | public function vars_js() { |
32 | - wp_localize_script( 'wpspos-backend-bank-deposit-js', 'historics', $this->get_historic() ); |
|
33 | - wp_localize_script( 'wpspos-backend-bank-deposit-js', 'templates_url', admin_url( 'admin-post.php' ) ); |
|
32 | + wp_localize_script('wpspos-backend-bank-deposit-js', 'historics', $this->get_historic()); |
|
33 | + wp_localize_script('wpspos-backend-bank-deposit-js', 'templates_url', admin_url('admin-post.php')); |
|
34 | 34 | } |
35 | 35 | public function save_historic_ajax() { |
36 | - $list_payments = !empty( $_POST['payments'] ) ? (array) $_POST['payments'] : array(); |
|
36 | + $list_payments = !empty($_POST['payments']) ? (array)$_POST['payments'] : array(); |
|
37 | 37 | $payments = array(); |
38 | - foreach( $list_payments as $payment ) { |
|
39 | - if( is_float( $payment ) ) { |
|
40 | - $payments[] = (float) $payment; |
|
38 | + foreach ($list_payments as $payment) { |
|
39 | + if (is_float($payment)) { |
|
40 | + $payments[] = (float)$payment; |
|
41 | 41 | } |
42 | 42 | } |
43 | - $this->add_historic( $this->row_model( 0, sanitize_text_field( $_POST['date'] ), sanitize_text_field( $_POST['amount'] ), $payments ) ); |
|
44 | - echo json_encode( $this->get_historic() ); |
|
43 | + $this->add_historic($this->row_model(0, sanitize_text_field($_POST['date']), sanitize_text_field($_POST['amount']), $payments)); |
|
44 | + echo json_encode($this->get_historic()); |
|
45 | 45 | wp_die(); |
46 | 46 | } |
47 | 47 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <table class="table table-striped wps-pos-element-table"> |
4 | 4 | <tr> |
@@ -6,9 +6,9 @@ discard block |
||
6 | 6 | <th><?php _e('Product price', 'wps-pos-i18n'); ?></th> |
7 | 7 | <th><?php _e('Action', 'wps-pos-i18n'); ?></th> |
8 | 8 | </tr> |
9 | - <?php foreach ( $product_list as $product ) : ?> |
|
10 | - <?php $product_data = wpshop_products::get_product_data( $product['ID'] ); ?> |
|
11 | - <?php $product_variation_definition = wpshop_products::get_variation( $product['ID'] );?> |
|
12 | - <?php require( wpshop_tools::get_template_part( WPSPOS_DIR, WPSPOS_TEMPLATES_MAIN_DIR, 'backend/products', 'product' ) ); ?> |
|
9 | + <?php foreach ($product_list as $product) : ?> |
|
10 | + <?php $product_data = wpshop_products::get_product_data($product['ID']); ?> |
|
11 | + <?php $product_variation_definition = wpshop_products::get_variation($product['ID']); ?> |
|
12 | + <?php require(wpshop_tools::get_template_part(WPSPOS_DIR, WPSPOS_TEMPLATES_MAIN_DIR, 'backend/products', 'product')); ?> |
|
13 | 13 | <?php endforeach; ?> |
14 | 14 | </table> |
15 | 15 | \ 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 | <table class="table table-striped wps-pos-element-table"> |
4 | 6 | <tr> |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <span class="dashicons dashicons-products"></span> |
4 | 6 | <?php _e( 'Product selection', 'wps-pos-i18n' ); ?> |
@@ -1,5 +1,5 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <span class="dashicons dashicons-products"></span> |
4 | -<?php _e( 'Product selection', 'wps-pos-i18n' ); ?> |
|
5 | -<a class="thickbox add-new-h2" title="<?php _e( 'New product creation', 'wps-pos-i18n' ); ?>" href="<?php echo admin_url( 'admin-ajax.php?action=wpspos-product-quick-creation&_wpnonce=' . wp_create_nonce( 'wps-product-quick-nonce' ) . '&width=550&height=600' ); ?>"><?php _e('Create a product', 'wps-pos-i18n'); ?></a> |
|
4 | +<?php _e('Product selection', 'wps-pos-i18n'); ?> |
|
5 | +<a class="thickbox add-new-h2" title="<?php _e('New product creation', 'wps-pos-i18n'); ?>" href="<?php echo admin_url('admin-ajax.php?action=wpspos-product-quick-creation&_wpnonce=' . wp_create_nonce('wps-product-quick-nonce') . '&width=550&height=600'); ?>"><?php _e('Create a product', 'wps-pos-i18n'); ?></a> |
@@ -1,9 +1,9 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
2 | - if ( !empty( $product_id ) ) : ?> |
|
3 | - <?php echo wpshop_products::wpshop_variation( $product_id ); ?> |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | + if (!empty($product_id)) : ?> |
|
3 | + <?php echo wpshop_products::wpshop_variation($product_id); ?> |
|
4 | 4 | <div class="wpspos-product-variation-selector" > |
5 | - <button class="wps-bton-first-mini-rounded alignRight" id="wpspos-product-with-variation-add-to-cart" ><?php _e( 'Add product', 'wpshop'); ?></button> |
|
5 | + <button class="wps-bton-first-mini-rounded alignRight" id="wpspos-product-with-variation-add-to-cart" ><?php _e('Add product', 'wpshop'); ?></button> |
|
6 | 6 | </div> |
7 | 7 | <?php else : ?> |
8 | - <?php _e( 'We are unable to detect the product you want to add to order', 'wps-pos-i18n' ); ?> |
|
8 | + <?php _e('We are unable to detect the product you want to add to order', 'wps-pos-i18n'); ?> |
|
9 | 9 | <?php endif; ?> |
10 | 10 | \ No newline at end of file |
@@ -1,9 +1,14 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | if ( !empty( $product_id ) ) : ?> |
3 | 5 | <?php echo wpshop_products::wpshop_variation( $product_id ); ?> |
4 | 6 | <div class="wpspos-product-variation-selector" > |
5 | 7 | <button class="wps-bton-first-mini-rounded alignRight" id="wpspos-product-with-variation-add-to-cart" ><?php _e( 'Add product', 'wpshop'); ?></button> |
6 | 8 | </div> |
7 | -<?php else : ?> |
|
8 | - <?php _e( 'We are unable to detect the product you want to add to order', 'wps-pos-i18n' ); ?> |
|
9 | +<?php else { |
|
10 | + : ?> |
|
11 | + <?php _e( 'We are unable to detect the product you want to add to order', 'wps-pos-i18n' ); |
|
12 | +} |
|
13 | +?> |
|
9 | 14 | <?php endif; ?> |
10 | 15 | \ 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 | $billing_option = get_option( 'wpshop_billing_address' ); |
3 | 5 | if( !empty( $billing_option ) && is_array( $billing_option ) ) { |
4 | 6 | $attribute_set_id = $billing_option['choice']; |
@@ -1,19 +1,19 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
2 | - $billing_option = get_option( 'wpshop_billing_address' ); |
|
3 | - if( !empty( $billing_option ) && is_array( $billing_option ) ) { |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | + $billing_option = get_option('wpshop_billing_address'); |
|
3 | + if (!empty($billing_option) && is_array($billing_option)) { |
|
4 | 4 | $attribute_set_id = $billing_option['choice']; |
5 | 5 | } else { |
6 | 6 | global $wpdb; |
7 | - $query = $wpdb->prepare( "SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", __( 'Billing address', 'wpshop' ) ); |
|
8 | - $attribute_set_id = $wpdb->get_var( $query ); |
|
9 | - if( empty( $attribute_set_id ) ) { |
|
7 | + $query = $wpdb->prepare("SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", __('Billing address', 'wpshop')); |
|
8 | + $attribute_set_id = $wpdb->get_var($query); |
|
9 | + if (empty($attribute_set_id)) { |
|
10 | 10 | global $wpdb; |
11 | - $query = $wpdb->prepare( "SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", 'Billing address' ); |
|
12 | - $attribute_set_id = $wpdb->get_var( $query ); |
|
11 | + $query = $wpdb->prepare("SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", 'Billing address'); |
|
12 | + $attribute_set_id = $wpdb->get_var($query); |
|
13 | 13 | } |
14 | 14 | } |
15 | 15 | ?> |
16 | 16 | <span class="dashicons dashicons-groups"></span> |
17 | -<?php _e( 'Customer selection', 'wps-pos-i18n' ); ?> |
|
18 | -<a class="thickbox add-new-h2" title="<?php _e( 'New customer creation', 'wps-pos-i18n' ); ?>" href="<?php echo admin_url( 'admin-ajax.php?action=wpspos-customer-quick-creation&_wpnonce=' . wp_create_nonce( 'wps-customer-quick-nonce' ) . '&width=550&height=600&customer_set_id=' . $attribute_set_id ); ?>"><?php _e('Create a customer', 'wps-pos-i18n'); ?></a> |
|
19 | -<button type="button" class="wps-bton-third-mini-rounded alignright" id="wps-pos-change-customer" ><?php _e( 'Change customer', 'wps-pos-i18n' ); ?></button> |
|
17 | +<?php _e('Customer selection', 'wps-pos-i18n'); ?> |
|
18 | +<a class="thickbox add-new-h2" title="<?php _e('New customer creation', 'wps-pos-i18n'); ?>" href="<?php echo admin_url('admin-ajax.php?action=wpspos-customer-quick-creation&_wpnonce=' . wp_create_nonce('wps-customer-quick-nonce') . '&width=550&height=600&customer_set_id=' . $attribute_set_id); ?>"><?php _e('Create a customer', 'wps-pos-i18n'); ?></a> |
|
19 | +<button type="button" class="wps-bton-third-mini-rounded alignright" id="wps-pos-change-customer" ><?php _e('Change customer', 'wps-pos-i18n'); ?></button> |
@@ -1,23 +1,23 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
2 | - $billing_option = get_option( 'wpshop_billing_address' ); |
|
3 | - if( !empty( $billing_option ) && is_array( $billing_option ) ) { |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | + $billing_option = get_option('wpshop_billing_address'); |
|
3 | + if (!empty($billing_option) && is_array($billing_option)) { |
|
4 | 4 | $attribute_set_id = $billing_option['choice']; |
5 | 5 | } else { |
6 | 6 | global $wpdb; |
7 | - $query = $wpdb->prepare( "SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", __( 'Billing address', 'wpshop' ) ); |
|
8 | - $attribute_set_id = $wpdb->get_var( $query ); |
|
9 | - if( empty( $attribute_set_id ) ) { |
|
7 | + $query = $wpdb->prepare("SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", __('Billing address', 'wpshop')); |
|
8 | + $attribute_set_id = $wpdb->get_var($query); |
|
9 | + if (empty($attribute_set_id)) { |
|
10 | 10 | global $wpdb; |
11 | - $query = $wpdb->prepare( "SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", 'Billing address' ); |
|
12 | - $attribute_set_id = $wpdb->get_var( $query ); |
|
11 | + $query = $wpdb->prepare("SELECT id FROM " . WPSHOP_DBT_ATTRIBUTE_SET . " WHERE name = %s", 'Billing address'); |
|
12 | + $attribute_set_id = $wpdb->get_var($query); |
|
13 | 13 | } |
14 | 14 | } |
15 | 15 | ?> |
16 | 16 | <tr> |
17 | 17 | <td> |
18 | - <?php _e( 'No user has been found for current search.', 'wps-pos-i18n' ); ?> |
|
18 | + <?php _e('No user has been found for current search.', 'wps-pos-i18n'); ?> |
|
19 | 19 | </td> |
20 | 20 | <td> |
21 | - <a class="thickbox wps-bton-third-rounded" title="<?php _e( 'New customer creation', 'wps-pos-i18n' ); ?>" href="<?php echo admin_url( 'admin-ajax.php?action=wps-customer-quick-creation&wps-nonce=' . wp_create_nonce( 'wps-customer-quick-nonce' ) . '&width=550&height=600&customer_set_id=' . $attribute_set_id ); ?>"><?php _e('Create a customer', 'wps-pos-i18n'); ?></a> |
|
21 | + <a class="thickbox wps-bton-third-rounded" title="<?php _e('New customer creation', 'wps-pos-i18n'); ?>" href="<?php echo admin_url('admin-ajax.php?action=wps-customer-quick-creation&wps-nonce=' . wp_create_nonce('wps-customer-quick-nonce') . '&width=550&height=600&customer_set_id=' . $attribute_set_id); ?>"><?php _e('Create a customer', 'wps-pos-i18n'); ?></a> |
|
22 | 22 | </td> |
23 | 23 | </tr> |
24 | 24 | \ 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 | $billing_option = get_option( 'wpshop_billing_address' ); |
3 | 5 | if( !empty( $billing_option ) && is_array( $billing_option ) ) { |
4 | 6 | $attribute_set_id = $billing_option['choice']; |