WooCommerce Checkout Manager - Version 5.5.8

Version Description

  • Fix: Escaping output functions
  • Fix: Input number min and max
Download this release

Release Info

Developer quadlayers
Plugin Icon 128x128 WooCommerce Checkout Manager
Version 5.5.8
Comparing to
See all releases

Code changes from version 5.5.7 to 5.5.8

Files changed (55) hide show
  1. assets/backend/js/admin-field.asset.php +5 -1
  2. assets/backend/js/admin.asset.php +5 -1
  3. assets/frontend/js/checkout.asset.php +5 -1
  4. assets/frontend/js/order-upload.asset.php +5 -1
  5. includes/class-wooccm-backend.php +1 -1
  6. includes/class-wooccm-install.php +8 -5
  7. includes/class-wooccm-notices.php +10 -10
  8. includes/class-wooccm-suggestions-list-table.php +30 -19
  9. includes/class-wooccm-upload.php +62 -55
  10. includes/class-wooccm.php +1 -1
  11. includes/controller/class-wooccm-advanced.php +119 -133
  12. includes/controller/class-wooccm-checkout.php +1 -1
  13. includes/controller/class-wooccm-controller.php +14 -18
  14. includes/controller/class-wooccm-email.php +107 -114
  15. includes/controller/class-wooccm-field-additional.php +3 -3
  16. includes/controller/class-wooccm-field-billing.php +1 -1
  17. includes/controller/class-wooccm-field-shipping.php +1 -3
  18. includes/controller/class-wooccm-order.php +3 -3
  19. includes/controller/class-wooccm-premium.php +44 -51
  20. includes/controller/class-wooccm-suggestions.php +56 -66
  21. includes/model/class-wooccm-field-additional.php +5 -5
  22. includes/model/class-wooccm-field-billing.php +16 -16
  23. includes/model/class-wooccm-field-shipping.php +14 -14
  24. includes/quadlayers/widget.php +6 -6
  25. includes/view/backend/meta-boxes/html-order-uploads.php +4 -4
  26. includes/view/backend/pages/additional.php +8 -8
  27. includes/view/backend/pages/billing.php +8 -8
  28. includes/view/backend/pages/checkout.php +6 -6
  29. includes/view/backend/pages/email.php +6 -6
  30. includes/view/backend/pages/modals/field.php +13 -13
  31. includes/view/backend/pages/modals/parts/info.php +60 -60
  32. includes/view/backend/pages/modals/parts/main.php +52 -50
  33. includes/view/backend/pages/modals/parts/panel-admin.php +23 -23
  34. includes/view/backend/pages/modals/parts/panel-datepicker.php +62 -62
  35. includes/view/backend/pages/modals/parts/panel-display.php +31 -31
  36. includes/view/backend/pages/modals/parts/panel-filter.php +66 -66
  37. includes/view/backend/pages/modals/parts/panel-general.php +180 -175
  38. includes/view/backend/pages/modals/parts/panel-options.php +73 -73
  39. includes/view/backend/pages/modals/parts/panel-price.php +31 -31
  40. includes/view/backend/pages/modals/parts/panel-select2.php +39 -39
  41. includes/view/backend/pages/modals/parts/panel-timepicker.php +36 -36
  42. includes/view/backend/pages/modals/parts/tabs.php +39 -39
  43. includes/view/backend/pages/order.php +6 -6
  44. includes/view/backend/pages/parts/actions.php +9 -9
  45. includes/view/backend/pages/parts/header.php +32 -24
  46. includes/view/backend/pages/parts/loop.php +131 -131
  47. includes/view/backend/pages/parts/tabs.php +3 -3
  48. includes/view/backend/pages/premium.php +59 -59
  49. includes/view/backend/pages/shipping.php +8 -8
  50. includes/view/backend/pages/suggestions.php +19 -18
  51. includes/view/frontend/class-wooccm-fields-handler.php +4 -4
  52. includes/view/frontend/class-wooccm-fields-register.php +1 -1
  53. readme.txt +5 -1
  54. templates/order/order-upload-files.php +59 -59
  55. woocommerce-checkout-manager.php +34 -33
assets/backend/js/admin-field.asset.php CHANGED
@@ -1 +1,5 @@
1
- <?php return array('dependencies' => array('backbone', 'jquery', 'jquery-ui-datepicker', 'wp-util'), 'version' => '3b35ab2a74c16fe901f6d1895971b4b0');
 
 
 
 
1
+ <?php return array(
2
+ 'dependencies' => array( 'backbone', 'jquery', 'jquery-ui-datepicker', 'wp-util' ),
3
+ 'version' => '3b35ab2a74c16fe901f6d1895971b4b0',
4
+ );
5
+
assets/backend/js/admin.asset.php CHANGED
@@ -1 +1,5 @@
1
- <?php return array('dependencies' => array('jquery', 'jquery-serializejson'), 'version' => 'f389cc2bea7176abd765911bfcb7c116');
 
 
 
 
1
+ <?php return array(
2
+ 'dependencies' => array( 'jquery', 'jquery-serializejson' ),
3
+ 'version' => 'f389cc2bea7176abd765911bfcb7c116',
4
+ );
5
+
assets/frontend/js/checkout.asset.php CHANGED
@@ -1 +1,5 @@
1
- <?php return array('dependencies' => array('jquery', 'selectWoo'), 'version' => 'acb3437adce2bd11ff9c4881456b2708');
 
 
 
 
1
+ <?php return array(
2
+ 'dependencies' => array( 'jquery', 'selectWoo' ),
3
+ 'version' => 'acb3437adce2bd11ff9c4881456b2708',
4
+ );
5
+
assets/frontend/js/order-upload.asset.php CHANGED
@@ -1 +1,5 @@
1
- <?php return array('dependencies' => array('jquery'), 'version' => '21579d17fba223671216029a4af5bd89');
 
 
 
 
1
+ <?php return array(
2
+ 'dependencies' => array( 'jquery' ),
3
+ 'version' => '21579d17fba223671216029a4af5bd89',
4
+ );
5
+
includes/class-wooccm-backend.php CHANGED
@@ -82,7 +82,7 @@ class WOOCCM_Field_Admin
82
  wp_register_script('jquery-serializejson', plugins_url('/assets/backend/jquery-serializejson/jquery-serializejson' . WOOCCM::is_min() . '.js', WOOCCM_PLUGIN_FILE), array('jquery'), WOOCCM_PLUGIN_VERSION, true);
83
 
84
  wp_register_script('wooccm-admin', plugins_url('/assets/backend/js/admin.js', WOOCCM_PLUGIN_FILE), $admin['dependencies'], $admin['version'], true);
85
-
86
  if ((isset($_GET['tab']) && $_GET['tab'] === WOOCCM_PREFIX) || in_array($screen->id, array(/* 'product', 'edit-product', */'shop_order', 'edit-shop_order'))) {
87
  wp_enqueue_style('wooccm-admin');
88
  wp_enqueue_script('wooccm-admin');
82
  wp_register_script('jquery-serializejson', plugins_url('/assets/backend/jquery-serializejson/jquery-serializejson' . WOOCCM::is_min() . '.js', WOOCCM_PLUGIN_FILE), array('jquery'), WOOCCM_PLUGIN_VERSION, true);
83
 
84
  wp_register_script('wooccm-admin', plugins_url('/assets/backend/js/admin.js', WOOCCM_PLUGIN_FILE), $admin['dependencies'], $admin['version'], true);
85
+
86
  if ((isset($_GET['tab']) && $_GET['tab'] === WOOCCM_PREFIX) || in_array($screen->id, array(/* 'product', 'edit-product', */'shop_order', 'edit-shop_order'))) {
87
  wp_enqueue_style('wooccm-admin');
88
  wp_enqueue_script('wooccm-admin');
includes/class-wooccm-install.php CHANGED
@@ -1,8 +1,10 @@
1
  <?php
2
 
3
- class WOOCCM_Install {
 
4
 
5
- public static function install() {
 
6
 
7
  // Check if we are not already running this routine.
8
  if ('yes' === get_transient('wooccm_installing')) {
@@ -16,7 +18,8 @@ class WOOCCM_Install {
16
  //wooccm_install();
17
  }
18
 
19
- public static function update() {
 
20
 
21
  if (!get_option('wooccm_billing', false)) {
22
  update_option(WOOCCM()->billing->get_fields());
@@ -31,7 +34,8 @@ class WOOCCM_Install {
31
  }
32
  }
33
 
34
- public static function old_panel_compatibility($field_id, $field = array()) {
 
35
 
36
  $field = $this->get_old_args($field);
37
 
@@ -88,5 +92,4 @@ class WOOCCM_Install {
88
 
89
  return array_intersect_key($field, array_flip($this->old_args));
90
  }
91
-
92
  }
1
  <?php
2
 
3
+ class WOOCCM_Install
4
+ {
5
 
6
+ public static function install()
7
+ {
8
 
9
  // Check if we are not already running this routine.
10
  if ('yes' === get_transient('wooccm_installing')) {
18
  //wooccm_install();
19
  }
20
 
21
+ public static function update()
22
+ {
23
 
24
  if (!get_option('wooccm_billing', false)) {
25
  update_option(WOOCCM()->billing->get_fields());
34
  }
35
  }
36
 
37
+ public static function old_panel_compatibility($field_id, $field = array())
38
+ {
39
 
40
  $field = $this->get_old_args($field);
41
 
92
 
93
  return array_intersect_key($field, array_flip($this->old_args));
94
  }
 
95
  }
includes/class-wooccm-notices.php CHANGED
@@ -43,11 +43,11 @@ class WOOCCM_Notices
43
  <div class="wooccm-notice notice is-dismissible" data-notice_id="wooccm-beta-notice">
44
  <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
45
  <div class="notice-image">
46
- <img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/backend/img/logo.jpg', WOOCCM_PLUGIN_FILE); ?>" alt="<?php echo esc_html(WOOCCM_PLUGIN_NAME); ?>>">
47
  </div>
48
  <div class="notice-content" style="margin-left: 15px;">
49
  <p>
50
- <h3>Hello! the new admin panel is here!</h3>
51
  </p>
52
  <p>
53
  As you know, we've recently acquired this plugin and we've been working very hard to bring you a quality product.
@@ -87,11 +87,11 @@ class WOOCCM_Notices
87
  <div class="wooccm-notice notice is-dismissible" data-notice_id="wooccm-user-rating">
88
  <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
89
  <div class="notice-image">
90
- <img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/backend/img/logo.jpg', WOOCCM_PLUGIN_FILE); ?>" alt="<?php echo esc_html(WOOCCM_PLUGIN_NAME); ?>>">
91
  </div>
92
  <div class="notice-content" style="margin-left: 15px;">
93
  <p>
94
- <?php printf(esc_html__('Hello! We\'ve recently acquired this plugin!', 'woocommerce-checkout-manager'), WOOCCM_PLUGIN_NAME); ?>
95
  <br />
96
  <?php esc_html_e('We will do our best to improve it and include new features gradually. Please be patient and let us know about the issues and improvements that you want to see in this plugin.', 'woocommerce-checkout-manager'); ?>
97
  </p>
@@ -111,18 +111,18 @@ class WOOCCM_Notices
111
  <div id="wooccm-update-5" class="wooccm-notice notice is-dismissible" data-notice_id="wooccm-update-5">
112
  <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
113
  <div class="notice-image">
114
- <img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/backend/img/logo.jpg', WOOCCM_PLUGIN_FILE); ?>" alt="<?php echo esc_html(WOOCCM_PLUGIN_NAME); ?>>">
115
  </div>
116
  <div class="notice-content" style="margin-left: 15px;">
117
  <p>
118
- <b><?php printf(esc_html__('Important! Manual update is required.', 'woocommerce-checkout-manager'), WOOCCM_PLUGIN_NAME); ?></b>
119
  <br />
120
  <?php esc_html_e('Due to the recent WooCommerce 4.0 changes it is necessary to reconfigure conditional fields. If you have conditional fields, please go to the billing, shipping and advanced sections and set conditionals relationships again.', 'woocommerce-checkout-manager'); ?>
121
  </p>
122
- <a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm'); ?>" class="button-primary" target="_blank">
123
  <?php esc_html_e('Settings', 'woocommerce-checkout-manager'); ?>
124
  </a>
125
- <a href="<?php echo str_replace('/?utm_source=wooccm_admin', '/conditional/?utm_source=wooccm_admin', WOOCCM_DOCUMENTATION_URL); ?>" class="button-secondary" target="_blank">
126
  <?php esc_html_e('Documentation', 'woocommerce-checkout-manager'); ?>
127
  </a>
128
  </div>
@@ -142,9 +142,9 @@ class WOOCCM_Notices
142
  data: {
143
  notice_id: notice_id,
144
  action: 'wooccm_dismiss_notice',
145
- nonce: '<?php echo wp_create_nonce('wooccm_dismiss_notice'); ?>'
146
  },
147
- success: function(response) {
148
  console.log(response);
149
  },
150
  });
43
  <div class="wooccm-notice notice is-dismissible" data-notice_id="wooccm-beta-notice">
44
  <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
45
  <div class="notice-image">
46
+ <img style="border-radius:50%;max-width: 90px;" src="<?php echo esc_url( plugins_url( '/assets/backend/img/logo.jpg', WOOCCM_PLUGIN_FILE ) ); ?>" alt="<?php echo esc_html( WOOCCM_PLUGIN_NAME ); ?>>">
47
  </div>
48
  <div class="notice-content" style="margin-left: 15px;">
49
  <p>
50
+ <h3>Hello! the new admin panel is here!</h3>
51
  </p>
52
  <p>
53
  As you know, we've recently acquired this plugin and we've been working very hard to bring you a quality product.
87
  <div class="wooccm-notice notice is-dismissible" data-notice_id="wooccm-user-rating">
88
  <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
89
  <div class="notice-image">
90
+ <img style="border-radius:50%;max-width: 90px;" src="<?php echo esc_url( plugins_url( '/assets/backend/img/logo.jpg', WOOCCM_PLUGIN_FILE ) ); ?>" alt="<?php echo esc_html(WOOCCM_PLUGIN_NAME); ?>>">
91
  </div>
92
  <div class="notice-content" style="margin-left: 15px;">
93
  <p>
94
+ <?php printf(esc_html__('Hello! We\'ve recently acquired this plugin!', 'woocommerce-checkout-manager'), esc_html( WOOCCM_PLUGIN_NAME ) ); ?>
95
  <br />
96
  <?php esc_html_e('We will do our best to improve it and include new features gradually. Please be patient and let us know about the issues and improvements that you want to see in this plugin.', 'woocommerce-checkout-manager'); ?>
97
  </p>
111
  <div id="wooccm-update-5" class="wooccm-notice notice is-dismissible" data-notice_id="wooccm-update-5">
112
  <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
113
  <div class="notice-image">
114
+ <img style="border-radius:50%;max-width: 90px;" src="<?php echo esc_url( plugins_url( '/assets/backend/img/logo.jpg', WOOCCM_PLUGIN_FILE ) ); ?>" alt="<?php echo esc_html(WOOCCM_PLUGIN_NAME); ?>>">
115
  </div>
116
  <div class="notice-content" style="margin-left: 15px;">
117
  <p>
118
+ <b><?php printf(esc_html__('Important! Manual update is required.', 'woocommerce-checkout-manager'), esc_html( WOOCCM_PLUGIN_NAME ) ); ?></b>
119
  <br />
120
  <?php esc_html_e('Due to the recent WooCommerce 4.0 changes it is necessary to reconfigure conditional fields. If you have conditional fields, please go to the billing, shipping and advanced sections and set conditionals relationships again.', 'woocommerce-checkout-manager'); ?>
121
  </p>
122
+ <a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=wooccm' ) ); ?>" class="button-primary" target="_blank">
123
  <?php esc_html_e('Settings', 'woocommerce-checkout-manager'); ?>
124
  </a>
125
+ <a href="<?php echo esc_url( str_replace( '/?utm_source=wooccm_admin', '/conditional/?utm_source=wooccm_admin', WOOCCM_DOCUMENTATION_URL ) ); ?>" class="button-secondary" target="_blank">
126
  <?php esc_html_e('Documentation', 'woocommerce-checkout-manager'); ?>
127
  </a>
128
  </div>
142
  data: {
143
  notice_id: notice_id,
144
  action: 'wooccm_dismiss_notice',
145
+ nonce: '<?php echo esc_attr( wp_create_nonce( 'wooccm_dismiss_notice' ) ); ?>'
146
  },
147
+ success: function(response) {
148
  console.log(response);
149
  },
150
  });
includes/class-wooccm-suggestions-list-table.php CHANGED
@@ -1,8 +1,9 @@
1
  <?php
2
 
3
- require_once( ABSPATH . 'wp-admin/includes/class-wp-plugin-install-list-table.php' );
4
 
5
- class WOOCCM_Suggestions_List_Table extends WP_Plugin_Install_List_Table {
 
6
 
7
  public $promote = array(
8
  'woocommerce-direct-checkout',
@@ -16,7 +17,8 @@ class WOOCCM_Suggestions_List_Table extends WP_Plugin_Install_List_Table {
16
  'wp-tiktok-feed',
17
  );
18
 
19
- private function remove_plugins($plugins) {
 
20
 
21
  $promote = array();
22
 
@@ -31,7 +33,8 @@ class WOOCCM_Suggestions_List_Table extends WP_Plugin_Install_List_Table {
31
  return $promote;
32
  }
33
 
34
- public function self_admin_url($url, $path) {
 
35
 
36
  if (strpos($url, 'tab=plugin-information') !== false) {
37
  $url = network_admin_url($path);
@@ -40,7 +43,8 @@ class WOOCCM_Suggestions_List_Table extends WP_Plugin_Install_List_Table {
40
  return $url;
41
  }
42
 
43
- public function network_admin_url($url, $path) {
 
44
 
45
  if (strpos($url, 'plugins.php') !== false) {
46
  $url = self_admin_url($path);
@@ -49,25 +53,28 @@ class WOOCCM_Suggestions_List_Table extends WP_Plugin_Install_List_Table {
49
  return $url;
50
  }
51
 
52
- public function display_rows() {
 
53
  add_filter('self_admin_url', array($this, 'self_admin_url'), 10, 2);
54
  add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
55
  parent::display_rows();
56
  }
57
 
58
- public function is_connected() {
 
59
 
60
  global $wp_version;
61
 
62
  $http_args = array(
63
- 'timeout' => 15,
64
- 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url('/'),
65
  );
66
 
67
  return is_wp_error(wp_remote_get('http://api.wordpress.org/plugins/info/1.2/', $http_args));
68
  }
69
 
70
- public function get_plugins() {
 
71
 
72
  $tk = WOOCCM_PREFIX . '_suggestions_plugins';
73
 
@@ -76,9 +83,9 @@ class WOOCCM_Suggestions_List_Table extends WP_Plugin_Install_List_Table {
76
  if ($plugins === false) {
77
 
78
  $args = array(
79
- 'per_page' => 36,
80
- 'author' => 'quadlayers',
81
- 'locale' => get_user_locale(),
82
  );
83
 
84
  $api = plugins_api('query_plugins', $args);
@@ -94,9 +101,10 @@ class WOOCCM_Suggestions_List_Table extends WP_Plugin_Install_List_Table {
94
  return $plugins;
95
  }
96
 
97
- public function prepare_items() {
 
98
 
99
- include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
100
 
101
  global $tabs, $tab;
102
 
@@ -128,16 +136,19 @@ class WOOCCM_Suggestions_List_Table extends WP_Plugin_Install_List_Table {
128
  $nonmenu_tabs = apply_filters('install_plugins_nonmenu_tabs', $nonmenu_tabs);
129
 
130
  // If a non-valid menu tab has been selected, And it's not a non-menu action.
131
- if (empty($tab) || (!isset($tabs[$tab]) && !in_array($tab, (array) $nonmenu_tabs) )) {
132
  $tab = key($tabs);
133
  }
134
 
135
  $this->items = $this->get_plugins();
136
 
137
 
138
- wp_localize_script('updates', '_wpUpdatesItemCounts', array(
139
- 'totals' => wp_get_update_data())
 
 
 
 
140
  );
141
  }
142
-
143
  }
1
  <?php
2
 
3
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-plugin-install-list-table.php');
4
 
5
+ class WOOCCM_Suggestions_List_Table extends WP_Plugin_Install_List_Table
6
+ {
7
 
8
  public $promote = array(
9
  'woocommerce-direct-checkout',
17
  'wp-tiktok-feed',
18
  );
19
 
20
+ private function remove_plugins($plugins)
21
+ {
22
 
23
  $promote = array();
24
 
33
  return $promote;
34
  }
35
 
36
+ public function self_admin_url($url, $path)
37
+ {
38
 
39
  if (strpos($url, 'tab=plugin-information') !== false) {
40
  $url = network_admin_url($path);
43
  return $url;
44
  }
45
 
46
+ public function network_admin_url($url, $path)
47
+ {
48
 
49
  if (strpos($url, 'plugins.php') !== false) {
50
  $url = self_admin_url($path);
53
  return $url;
54
  }
55
 
56
+ public function display_rows()
57
+ {
58
  add_filter('self_admin_url', array($this, 'self_admin_url'), 10, 2);
59
  add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
60
  parent::display_rows();
61
  }
62
 
63
+ public function is_connected()
64
+ {
65
 
66
  global $wp_version;
67
 
68
  $http_args = array(
69
+ 'timeout' => 15,
70
+ 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url('/'),
71
  );
72
 
73
  return is_wp_error(wp_remote_get('http://api.wordpress.org/plugins/info/1.2/', $http_args));
74
  }
75
 
76
+ public function get_plugins()
77
+ {
78
 
79
  $tk = WOOCCM_PREFIX . '_suggestions_plugins';
80
 
83
  if ($plugins === false) {
84
 
85
  $args = array(
86
+ 'per_page' => 36,
87
+ 'author' => 'quadlayers',
88
+ 'locale' => get_user_locale(),
89
  );
90
 
91
  $api = plugins_api('query_plugins', $args);
101
  return $plugins;
102
  }
103
 
104
+ public function prepare_items()
105
+ {
106
 
107
+ include_once(ABSPATH . 'wp-admin/includes/plugin-install.php');
108
 
109
  global $tabs, $tab;
110
 
136
  $nonmenu_tabs = apply_filters('install_plugins_nonmenu_tabs', $nonmenu_tabs);
137
 
138
  // If a non-valid menu tab has been selected, And it's not a non-menu action.
139
+ if (empty($tab) || (!isset($tabs[$tab]) && !in_array($tab, (array) $nonmenu_tabs))) {
140
  $tab = key($tabs);
141
  }
142
 
143
  $this->items = $this->get_plugins();
144
 
145
 
146
+ wp_localize_script(
147
+ 'updates',
148
+ '_wpUpdatesItemCounts',
149
+ array(
150
+ 'totals' => wp_get_update_data()
151
+ )
152
  );
153
  }
 
154
  }
includes/class-wooccm-upload.php CHANGED
@@ -1,31 +1,35 @@
1
  <?php
2
 
3
- class WOOCCM_Upload {
 
4
 
5
 
6
  protected static $_instance;
7
 
8
- public function __construct() {
9
- add_action( 'wp_ajax_wooccm_order_attachment_update', array( $this, 'ajax_delete_attachment' ) );
10
- add_action( 'wp_ajax_nopriv_wooccm_order_attachment_update', array( $this, 'ajax_delete_attachment' ) );
 
11
 
12
  // Checkout
13
  // -----------------------------------------------------------------------
14
- add_action( 'wp_ajax_wooccm_checkout_attachment_upload', array( $this, 'ajax_checkout_attachment_upload' ) );
15
- add_action( 'wp_ajax_nopriv_wooccm_checkout_attachment_upload', array( $this, 'ajax_checkout_attachment_upload' ) );
16
- add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'update_attachment_ids' ), 99 );
17
  // }
18
  }
19
 
20
- public static function instance() {
21
- if ( is_null( self::$_instance ) ) {
 
22
  self::$_instance = new self();
23
  }
24
  return self::$_instance;
25
  }
26
 
27
- protected function process_uploads( $files, $key, $post_id = 0 ) {
28
- if ( ! function_exists( 'media_handle_upload' ) ) {
 
29
  require_once ABSPATH . 'wp-admin/includes/file.php';
30
  require_once ABSPATH . 'wp-admin/includes/media.php';
31
  require_once ABSPATH . 'wp-admin/includes/image.php';
@@ -35,30 +39,30 @@ class WOOCCM_Upload {
35
 
36
  add_filter(
37
  'upload_dir',
38
- function ( $param ) {
39
- $param['path'] = sprintf( '%s/wooccm_uploads', $param['basedir'] );
40
- $param['url'] = sprintf( '%s/wooccm_uploads', $param['baseurl'] );
41
  return $param;
42
  },
43
  10
44
  );
45
 
46
- foreach ( $files['name'] as $id => $value ) {
47
 
48
- if ( $files['name'][ $id ] ) {
49
 
50
- $_FILES[ $key ] = array(
51
- 'name' => $files['name'][ $id ],
52
- 'type' => $files['type'][ $id ],
53
- 'tmp_name' => $files['tmp_name'][ $id ],
54
- 'error' => $files['error'][ $id ],
55
- 'size' => $files['size'][ $id ],
56
  );
57
 
58
- if ( ! is_wp_error( $attachment_id = media_handle_upload( $key, $post_id ) ) ) {
59
  $attachment_ids[] = $attachment_id;
60
  } else {
61
- wc_add_notice( $attachment_id->get_error_message(), 'error' );
62
  // wp_send_json_error( $attachment_id->get_error_message() );
63
  }
64
  }
@@ -67,79 +71,82 @@ class WOOCCM_Upload {
67
  return $attachment_ids;
68
  }
69
 
70
- public function ajax_delete_attachment() {
71
- if ( ! empty( $_REQUEST ) && check_admin_referer( 'wooccm_upload', 'nonce' ) ) {
 
72
 
73
- $array1 = explode( ',', sanitize_text_field( isset( $_REQUEST['all_attachments_ids'] ) ? $_REQUEST['all_attachments_ids'] : '' ) );
74
- $array2 = explode( ',', sanitize_text_field( isset( $_REQUEST['delete_attachments_ids'] ) ? $_REQUEST['delete_attachments_ids'] : '' ) );
75
 
76
- if ( empty( $array1 ) || empty( $array2 ) ) {
77
- wp_send_json_error( esc_html__( 'No attachment selected.', 'woocommerce-checkout-manager' ) );
78
  }
79
 
80
- $attachment_ids = array_diff( $array1, $array2 );
81
 
82
- if ( ! empty( $attachment_ids ) ) {
83
 
84
- foreach ( $attachment_ids as $key => $attachtoremove ) {
85
 
86
  // Check the Attachment exists...
87
- if ( get_post_status( $attachtoremove ) == false ) {
88
  continue;
89
  }
90
 
91
  // Check the Attachment is associated with an Order
92
- $post_parent = get_post_field( 'post_parent', $attachtoremove );
93
 
94
- if ( empty( $post_parent ) ) {
95
  continue;
96
  } else {
97
- if ( get_post_type( $post_parent ) <> 'shop_order' ) {
98
  continue;
99
  }
100
  }
101
- wp_delete_attachment( $attachtoremove );
102
  }
103
  }
104
 
105
- wp_send_json_success( 'Deleted successfully.', 'woocommerce-checkout-manager' );
106
  }
107
  }
108
 
109
- public function ajax_checkout_attachment_upload() {
110
- if ( check_admin_referer( 'wooccm_upload', 'nonce' ) && isset( $_FILES['wooccm_checkout_attachment_upload'] ) ) {
 
111
 
112
  $files = $_FILES['wooccm_checkout_attachment_upload'];
113
 
114
- if ( empty( $files ) ) {
115
- wc_add_notice( esc_html__( 'No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager' ), 'error' );
116
  wp_send_json_error();
117
  }
118
 
119
- if ( count( $attachment_ids = $this->process_uploads( $files, 'wooccm_checkout_attachment_upload' ) ) ) {
120
- wp_send_json_success( $attachment_ids );
121
  }
122
- wc_add_notice( esc_html__( 'Unknow error.', 'woocommerce-checkout-manager' ), 'error' );
123
  wp_send_json_error();
124
  }
125
  }
126
 
127
- public function update_attachment_ids( $order_id = 0 ) {
 
128
  require_once ABSPATH . 'wp-admin/includes/image.php';
129
 
130
- if ( count( $checkout = WC()->checkout->get_checkout_fields() ) ) {
131
 
132
- foreach ( $checkout as $field_type => $fields ) {
133
 
134
- foreach ( $fields as $key => $field ) {
135
 
136
- if ( isset( $field['type'] ) && $field['type'] == 'file' ) {
137
 
138
- if ( $attachments = get_post_meta( $order_id, sprintf( '_%s', $key ), true ) ) {
139
 
140
- if ( $attachments = (array) explode( ',', $attachments ) ) {
141
 
142
- foreach ( $attachments as $image_id ) {
143
 
144
  wp_update_post(
145
  array(
@@ -148,7 +155,7 @@ class WOOCCM_Upload {
148
  )
149
  );
150
 
151
- wp_update_attachment_metadata( $image_id, wp_generate_attachment_metadata( $image_id, get_attached_file( $image_id ) ) );
152
  }
153
  }
154
  }
1
  <?php
2
 
3
+ class WOOCCM_Upload
4
+ {
5
 
6
 
7
  protected static $_instance;
8
 
9
+ public function __construct()
10
+ {
11
+ add_action('wp_ajax_wooccm_order_attachment_update', array($this, 'ajax_delete_attachment'));
12
+ add_action('wp_ajax_nopriv_wooccm_order_attachment_update', array($this, 'ajax_delete_attachment'));
13
 
14
  // Checkout
15
  // -----------------------------------------------------------------------
16
+ add_action('wp_ajax_wooccm_checkout_attachment_upload', array($this, 'ajax_checkout_attachment_upload'));
17
+ add_action('wp_ajax_nopriv_wooccm_checkout_attachment_upload', array($this, 'ajax_checkout_attachment_upload'));
18
+ add_action('woocommerce_checkout_update_order_meta', array($this, 'update_attachment_ids'), 99);
19
  // }
20
  }
21
 
22
+ public static function instance()
23
+ {
24
+ if (is_null(self::$_instance)) {
25
  self::$_instance = new self();
26
  }
27
  return self::$_instance;
28
  }
29
 
30
+ protected function process_uploads($files, $key, $post_id = 0)
31
+ {
32
+ if (!function_exists('media_handle_upload')) {
33
  require_once ABSPATH . 'wp-admin/includes/file.php';
34
  require_once ABSPATH . 'wp-admin/includes/media.php';
35
  require_once ABSPATH . 'wp-admin/includes/image.php';
39
 
40
  add_filter(
41
  'upload_dir',
42
+ function ($param) {
43
+ $param['path'] = sprintf('%s/wooccm_uploads', $param['basedir']);
44
+ $param['url'] = sprintf('%s/wooccm_uploads', $param['baseurl']);
45
  return $param;
46
  },
47
  10
48
  );
49
 
50
+ foreach ($files['name'] as $id => $value) {
51
 
52
+ if ($files['name'][$id]) {
53
 
54
+ $_FILES[$key] = array(
55
+ 'name' => $files['name'][$id],
56
+ 'type' => $files['type'][$id],
57
+ 'tmp_name' => $files['tmp_name'][$id],
58
+ 'error' => $files['error'][$id],
59
+ 'size' => $files['size'][$id],
60
  );
61
 
62
+ if (!is_wp_error($attachment_id = media_handle_upload($key, $post_id))) {
63
  $attachment_ids[] = $attachment_id;
64
  } else {
65
+ wc_add_notice($attachment_id->get_error_message(), 'error');
66
  // wp_send_json_error( $attachment_id->get_error_message() );
67
  }
68
  }
71
  return $attachment_ids;
72
  }
73
 
74
+ public function ajax_delete_attachment()
75
+ {
76
+ if (!empty($_REQUEST) && check_admin_referer('wooccm_upload', 'nonce')) {
77
 
78
+ $array1 = explode(',', sanitize_text_field(isset($_REQUEST['all_attachments_ids']) ? $_REQUEST['all_attachments_ids'] : ''));
79
+ $array2 = explode(',', sanitize_text_field(isset($_REQUEST['delete_attachments_ids']) ? $_REQUEST['delete_attachments_ids'] : ''));
80
 
81
+ if (empty($array1) || empty($array2)) {
82
+ wp_send_json_error(esc_html__('No attachment selected.', 'woocommerce-checkout-manager'));
83
  }
84
 
85
+ $attachment_ids = array_diff($array1, $array2);
86
 
87
+ if (!empty($attachment_ids)) {
88
 
89
+ foreach ($attachment_ids as $key => $attachtoremove) {
90
 
91
  // Check the Attachment exists...
92
+ if (get_post_status($attachtoremove) == false) {
93
  continue;
94
  }
95
 
96
  // Check the Attachment is associated with an Order
97
+ $post_parent = get_post_field('post_parent', $attachtoremove);
98
 
99
+ if (empty($post_parent)) {
100
  continue;
101
  } else {
102
+ if (get_post_type($post_parent) <> 'shop_order') {
103
  continue;
104
  }
105
  }
106
+ wp_delete_attachment($attachtoremove);
107
  }
108
  }
109
 
110
+ wp_send_json_success('Deleted successfully.', 'woocommerce-checkout-manager');
111
  }
112
  }
113
 
114
+ public function ajax_checkout_attachment_upload()
115
+ {
116
+ if (check_admin_referer('wooccm_upload', 'nonce') && isset($_FILES['wooccm_checkout_attachment_upload'])) {
117
 
118
  $files = $_FILES['wooccm_checkout_attachment_upload'];
119
 
120
+ if (empty($files)) {
121
+ wc_add_notice(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
122
  wp_send_json_error();
123
  }
124
 
125
+ if (count($attachment_ids = $this->process_uploads($files, 'wooccm_checkout_attachment_upload'))) {
126
+ wp_send_json_success($attachment_ids);
127
  }
128
+ wc_add_notice(esc_html__('Unknow error.', 'woocommerce-checkout-manager'), 'error');
129
  wp_send_json_error();
130
  }
131
  }
132
 
133
+ public function update_attachment_ids($order_id = 0)
134
+ {
135
  require_once ABSPATH . 'wp-admin/includes/image.php';
136
 
137
+ if (count($checkout = WC()->checkout->get_checkout_fields())) {
138
 
139
+ foreach ($checkout as $field_type => $fields) {
140
 
141
+ foreach ($fields as $key => $field) {
142
 
143
+ if (isset($field['type']) && $field['type'] == 'file') {
144
 
145
+ if ($attachments = get_post_meta($order_id, sprintf('_%s', $key), true)) {
146
 
147
+ if ($attachments = (array) explode(',', $attachments)) {
148
 
149
+ foreach ($attachments as $image_id) {
150
 
151
  wp_update_post(
152
  array(
155
  )
156
  );
157
 
158
+ wp_update_attachment_metadata($image_id, wp_generate_attachment_metadata($image_id, get_attached_file($image_id)));
159
  }
160
  }
161
  }
includes/class-wooccm.php CHANGED
@@ -107,7 +107,7 @@ final class WOOCCM
107
 
108
  // Admin
109
  // -------------------------------------------------------------------------
110
-
111
  $upload = include(WOOCCM_PLUGIN_DIR . 'assets/frontend/js/order-upload.asset.php');
112
 
113
  wp_register_script('wooccm-order-upload', plugins_url('assets/frontend/js/order-upload.js', WOOCCM_PLUGIN_FILE), $upload['dependencies'], $upload['version'], true);
107
 
108
  // Admin
109
  // -------------------------------------------------------------------------
110
+
111
  $upload = include(WOOCCM_PLUGIN_DIR . 'assets/frontend/js/order-upload.asset.php');
112
 
113
  wp_register_script('wooccm-order-upload', plugins_url('assets/frontend/js/order-upload.js', WOOCCM_PLUGIN_FILE), $upload['dependencies'], $upload['version'], true);
includes/controller/class-wooccm-advanced.php CHANGED
@@ -1,138 +1,124 @@
1
  <?php
2
 
3
- class WOOCCM_Checkout_Advanced_Controller
4
- {
5
-
6
- protected static $_instance;
7
-
8
- public function __construct()
9
- {
10
-
11
- add_action('wooccm_sections_header', array($this, 'add_header'));
12
- add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'));
13
- add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_settings'));
14
-
15
- // Frontend
16
- // -------------------------------------------------------------------------
17
- add_action('woocommerce_before_checkout_form', array($this, 'add_inline_scripts'));
18
-
19
- // Compatibility
20
- // -------------------------------------------------------------------------
21
- add_filter('default_option_wooccm_advanced_custom_css', array($this, 'custom_css_w'));
22
- }
23
-
24
- public static function instance()
25
- {
26
- if (is_null(self::$_instance)) {
27
- self::$_instance = new self();
28
- }
29
- return self::$_instance;
30
- }
31
-
32
- public function add_inline_scripts()
33
- {
34
-
35
- if ($css = get_option('wooccm_advanced_custom_css', false)) {
36
- ?>
37
- <style>
38
- <?php echo $css; ?>
39
- </style>
40
- <?php
41
- }
42
- }
43
-
44
- public function get_settings()
45
- {
46
-
47
- return array(
48
- array(
49
- 'type' => 'title',
50
- 'id' => 'section_title'
51
- ),
52
- //array(
53
- // 'name' => esc_html__('Allow custom field names', 'woocommerce-checkout-manager'),
54
- // 'desc_tip' => esc_html__('Show the selected fields in the thankyou page.', 'woocommerce-checkout-manager'),
55
- // 'id' => 'wooccm_allow_custom_field_names',
56
- // 'type' => 'select',
57
- // 'class' => 'chosen_select',
58
- // 'options' => array(
59
- // 'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
60
- // 'no' => esc_html__('No', 'woocommerce-checkout-manager'),
61
- // ),
62
- // 'default' => 'no',
63
- // ),
64
- array(
65
- 'name' => esc_html__('Export custom fields', 'woocommerce-checkout-manager'),
66
- 'desc_tip' => esc_html__('Include custom fields in CSV export files generated by WooCommerce Customer / Order / Coupon Export.', 'woocommerce-checkout-manager'),
67
- 'id' => 'wooccm_export_custom_fields',
68
- 'type' => 'select',
69
- 'class' => 'chosen_select wooccm-premium-field',
70
- 'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
71
- 'options' => array(
72
- 'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
73
- 'no' => esc_html__('No', 'woocommerce-checkout-manager'),
74
- ),
75
- 'default' => 'yes',
76
- ),
77
- array(
78
- 'name' => esc_html__('Custom CSS', 'woocommerce-checkout-manager'),
79
- 'desc_tip' => esc_html__('Add custom stylesheets to the checkout page.', 'woocommerce-checkout-manager'),
80
- 'id' => 'wooccm_advanced_custom_css',
81
- 'type' => 'textarea',
82
- 'placeholder' => ''
83
- ),
84
- array(
85
- 'type' => 'sectionend',
86
- 'id' => 'section_end'
87
- )
88
- );
89
- }
90
-
91
- // Admin
92
- // -------------------------------------------------------------------------
93
-
94
- public function add_header()
95
- {
96
- global $current_section;
97
- ?>
98
- <li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm&section=advanced'); ?>" class="<?php echo ($current_section == 'advanced' ? 'current' : ''); ?>"><?php esc_html_e('Advanced', 'woocommerce-checkout-manager'); ?></a> | </li>
99
- <?php
100
- }
101
-
102
- public function add_section()
103
- {
104
-
105
- global $current_section;
106
-
107
- if ('advanced' == $current_section) {
108
-
109
- $settings = $this->get_settings();
110
-
111
- include_once(WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/advanced.php');
112
- }
113
- }
114
-
115
- public function save_settings()
116
- {
117
-
118
- global $current_section;
119
-
120
- if ('advanced' == $current_section) {
121
- woocommerce_update_options($this->get_settings());
122
- }
123
- }
124
-
125
- public function custom_css_w($value)
126
- {
127
-
128
- $options = get_option('wccs_settings');
129
-
130
- if ($css = @$options['checkness']['custom_css_w']) {
131
- return $css;
132
- }
133
-
134
- return $value;
135
- }
136
  }
137
 
138
  WOOCCM_Checkout_Advanced_Controller::instance();
1
  <?php
2
 
3
+ class WOOCCM_Checkout_Advanced_Controller {
4
+
5
+
6
+ protected static $_instance;
7
+
8
+ public function __construct() {
9
+ add_action( 'wooccm_sections_header', array( $this, 'add_header' ) );
10
+ add_action( 'woocommerce_sections_' . WOOCCM_PREFIX, array( $this, 'add_section' ) );
11
+ add_action( 'woocommerce_settings_save_' . WOOCCM_PREFIX, array( $this, 'save_settings' ) );
12
+
13
+ // Frontend
14
+ // -------------------------------------------------------------------------
15
+ add_action( 'woocommerce_before_checkout_form', array( $this, 'add_inline_scripts' ) );
16
+
17
+ // Compatibility
18
+ // -------------------------------------------------------------------------
19
+ add_filter( 'default_option_wooccm_advanced_custom_css', array( $this, 'custom_css_w' ) );
20
+ }
21
+
22
+ public static function instance() {
23
+ if ( is_null( self::$_instance ) ) {
24
+ self::$_instance = new self();
25
+ }
26
+ return self::$_instance;
27
+ }
28
+
29
+ public function add_inline_scripts() {
30
+ if ( $css = get_option( 'wooccm_advanced_custom_css', false ) ) {
31
+ ?>
32
+ <style>
33
+ <?php echo $css; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
34
+ </style>
35
+ <?php
36
+ }
37
+ }
38
+
39
+ public function get_settings() {
40
+ return array(
41
+ array(
42
+ 'type' => 'title',
43
+ 'id' => 'section_title',
44
+ ),
45
+ // array(
46
+ // 'name' => esc_html__('Allow custom field names', 'woocommerce-checkout-manager'),
47
+ // 'desc_tip' => esc_html__('Show the selected fields in the thankyou page.', 'woocommerce-checkout-manager'),
48
+ // 'id' => 'wooccm_allow_custom_field_names',
49
+ // 'type' => 'select',
50
+ // 'class' => 'chosen_select',
51
+ // 'options' => array(
52
+ // 'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
53
+ // 'no' => esc_html__('No', 'woocommerce-checkout-manager'),
54
+ // ),
55
+ // 'default' => 'no',
56
+ // ),
57
+ array(
58
+ 'name' => esc_html__( 'Export custom fields', 'woocommerce-checkout-manager' ),
59
+ 'desc_tip' => esc_html__( 'Include custom fields in CSV export files generated by WooCommerce Customer / Order / Coupon Export.', 'woocommerce-checkout-manager' ),
60
+ 'id' => 'wooccm_export_custom_fields',
61
+ 'type' => 'select',
62
+ 'class' => 'chosen_select wooccm-premium-field',
63
+ 'desc' => esc_html__( 'This is a premium feature.', 'woocommerce-checkout-manager' ),
64
+ 'options' => array(
65
+ 'yes' => esc_html__( 'Yes', 'woocommerce-checkout-manager' ),
66
+ 'no' => esc_html__( 'No', 'woocommerce-checkout-manager' ),
67
+ ),
68
+ 'default' => 'yes',
69
+ ),
70
+ array(
71
+ 'name' => esc_html__( 'Custom CSS', 'woocommerce-checkout-manager' ),
72
+ 'desc_tip' => esc_html__( 'Add custom stylesheets to the checkout page.', 'woocommerce-checkout-manager' ),
73
+ 'id' => 'wooccm_advanced_custom_css',
74
+ 'type' => 'textarea',
75
+ 'placeholder' => '',
76
+ ),
77
+ array(
78
+ 'type' => 'sectionend',
79
+ 'id' => 'section_end',
80
+ ),
81
+ );
82
+ }
83
+
84
+ // Admin
85
+ // -------------------------------------------------------------------------
86
+
87
+ public function add_header() {
88
+ global $current_section;
89
+ ?>
90
+ <li><a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=wooccm&section=advanced' ) ); ?>" class="<?php echo ( $current_section == 'advanced' ? 'current' : '' ); ?>"><?php esc_html_e( 'Advanced', 'woocommerce-checkout-manager' ); ?></a> | </li>
91
+ <?php
92
+ }
93
+
94
+ public function add_section() {
95
+ global $current_section;
96
+
97
+ if ( 'advanced' == $current_section ) {
98
+
99
+ $settings = $this->get_settings();
100
+
101
+ include_once WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/advanced.php';
102
+ }
103
+ }
104
+
105
+ public function save_settings() {
106
+ global $current_section;
107
+
108
+ if ( 'advanced' == $current_section ) {
109
+ woocommerce_update_options( $this->get_settings() );
110
+ }
111
+ }
112
+
113
+ public function custom_css_w( $value ) {
114
+ $options = get_option( 'wccs_settings' );
115
+
116
+ if ( $css = @$options['checkness']['custom_css_w'] ) {
117
+ return $css;
118
+ }
119
+
120
+ return $value;
121
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  }
123
 
124
  WOOCCM_Checkout_Advanced_Controller::instance();
includes/controller/class-wooccm-checkout.php CHANGED
@@ -296,7 +296,7 @@ class WOOCCM_Checkout_Controller
296
  {
297
  global $current_section;
298
  ?>
299
- <li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm&section'); ?>" class="<?php echo ($current_section == '' ? 'current' : ''); ?>"><?php esc_html_e('Checkout', 'woocommerce-checkout-manager'); ?></a> | </li>
300
  <?php
301
  }
302
 
296
  {
297
  global $current_section;
298
  ?>
299
+ <li><a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=wooccm&section' ) ); ?>" class="<?php echo ($current_section == '' ? 'current' : ''); ?>"><?php esc_html_e('Checkout', 'woocommerce-checkout-manager'); ?></a> | </li>
300
  <?php
301
  }
302
 
includes/controller/class-wooccm-controller.php CHANGED
@@ -1,25 +1,21 @@
1
  <?php
2
 
3
- class WOOCCM_Controller
4
- {
5
 
6
- function error_ajax($data = null)
7
- {
8
- return wp_send_json_error($data);
9
- }
10
 
11
- function success_ajax($data = null)
12
- {
13
- return wp_send_json_success($data);
14
- }
15
 
16
- function error_reload_page()
17
- {
18
- return wp_send_json_error(esc_html__('Please, reload page', 'woocommerce-checkout-manager'));
19
- }
20
 
21
- function error_access_denied()
22
- {
23
- return wp_send_json_error(esc_html__('Access denied', 'woocommerce-checkout-manager'));
24
- }
 
 
 
25
  }
1
  <?php
2
 
3
+ class WOOCCM_Controller {
 
4
 
 
 
 
 
5
 
6
+ function error_ajax( $data = null ) {
7
+ return wp_send_json_error( $data );
8
+ }
 
9
 
10
+ function success_ajax( $data = null ) {
11
+ return wp_send_json_success( $data );
12
+ }
 
13
 
14
+ function error_reload_page() {
15
+ return wp_send_json_error( esc_html__( 'Please, reload page', 'woocommerce-checkout-manager' ) );
16
+ }
17
+
18
+ function error_access_denied() {
19
+ return wp_send_json_error( esc_html__( 'Access denied', 'woocommerce-checkout-manager' ) );
20
+ }
21
  }
includes/controller/class-wooccm-email.php CHANGED
@@ -1,131 +1,124 @@
1
  <?php
2
 
3
- class WOOCCM_Order_Email_Controller
4
- {
5
 
6
- protected static $_instance;
7
 
8
- public function __construct() {
9
 
10
- add_action('wooccm_sections_header', array($this, 'add_header'));
11
- add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'));
12
- add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_settings'));
13
- }
 
14
 
15
- public static function instance()
16
- {
17
- if (is_null(self::$_instance)) {
18
- self::$_instance = new self();
19
- }
20
- return self::$_instance;
21
- }
22
 
23
- // Admin
24
- // -------------------------------------------------------------------------
25
 
26
- public function get_settings()
27
- {
28
- return array(
29
- array(
30
- 'type' => 'title',
31
- 'id' => 'section_title'
32
- ),
33
- array(
34
- 'name' => esc_html__('Add upload files', 'woocommerce-checkout-manager'),
35
- 'desc_tip' => esc_html__('Allow customers to upload files in the email.', 'woocommerce-checkout-manager'),
36
- 'id' => 'wooccm_email_upload_files',
37
- 'type' => 'select',
38
- 'class' => 'chosen_select wooccm-premium-field',
39
- 'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
40
- 'options' => array(
41
- 'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
42
- 'no' => esc_html__('No', 'woocommerce-checkout-manager'),
43
- ),
44
- 'default' => 'no',
45
- ),
46
- array(
47
- 'name' => esc_html__('Add for this order status', 'woocommerce-checkout-manager'),
48
- 'desc_tip' => esc_html__('Allow customers to upload files in the email.', 'woocommerce-checkout-manager'),
49
- 'id' => 'wooccm_email_upload_files_order_status',
50
- 'type' => 'multiselect',
51
- 'class' => 'chosen_select wooccm-premium-field',
52
- 'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
53
- 'options' => wc_get_order_statuses(),
54
- 'default' => array_keys(wc_get_order_statuses()),
55
- ),
56
- array(
57
- 'name' => esc_html__('Add upload files title', 'woocommerce-checkout-manager'),
58
- 'desc_tip' => esc_html__('Add custom title for the uploads files table.', 'woocommerce-checkout-manager'),
59
- 'id' => 'wooccm_email_upload_files_title',
60
- 'class' => 'wooccm-premium-field',
61
- 'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
62
- 'type' => 'text',
63
- 'placeholder' => esc_html__('Uploaded files', 'woocommerce-checkout-manager')
64
- ),
65
- array(
66
- 'name' => esc_html__('Add custom fields', 'woocommerce-checkout-manager-pro'),
67
- 'desc_tip' => esc_html__('Show the selected fields in the email.', 'woocommerce-checkout-manager-pro'),
68
- 'id' => 'wooccm_email_custom_fields',
69
- 'type' => 'select',
70
- 'class' => 'chosen_select wooccm-premium-field',
71
- 'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
72
- 'options' => array(
73
- 'yes' => esc_html__('Yes', 'woocommerce-checkout-manager-pro'),
74
- 'no' => esc_html__('No', 'woocommerce-checkout-manager-pro'),
75
- ),
76
- 'default' => 'yes',
77
- ),
78
- array(
79
- 'name' => esc_html__('Add for this order status', 'woocommerce-checkout-manager-pro'),
80
- 'desc_tip' => esc_html__('Allow customers to upload files in the email.', 'woocommerce-checkout-manager-pro'),
81
- 'id' => 'wooccm_email_custom_fields_status',
82
- 'type' => 'multiselect',
83
- 'class' => 'chosen_select wooccm-premium-field',
84
- 'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
85
- 'options' => wc_get_order_statuses(),
86
- 'default' => array_keys(wc_get_order_statuses()),
87
- ),
88
- array(
89
- 'name' => esc_html__('Add custom fields title', 'woocommerce-checkout-manager-pro'),
90
- 'desc_tip' => esc_html__('Add custom title for the uploads files table.', 'woocommerce-checkout-manager-pro'),
91
- 'id' => 'wooccm_email_custom_fields_title',
92
- 'type' => 'text',
93
- 'class' => 'wooccm-premium-field',
94
- 'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
95
- 'placeholder' => esc_html__('Order extra', 'woocommerce-checkout-manager-pro')
96
- ),
97
- array(
98
- 'type' => 'sectionend',
99
- 'id' => 'section_end'
100
- )
101
- );
102
- }
103
 
104
- public function add_header()
105
- {
106
- global $current_section;
107
- ?>
108
- <li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm&section=email'); ?>" class="<?php echo ($current_section == 'email' ? 'current' : ''); ?>"><?php esc_html_e('Email', 'woocommerce-checkout-manager'); ?></a> | </li>
109
- <?php
110
- }
111
-
112
- public function add_section()
113
- {
114
 
115
- global $current_section;
 
116
 
117
- if ('email' == $current_section) {
118
 
119
- $settings = $this->get_settings();
120
 
121
- include_once(WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/email.php');
122
- }
123
- }
124
 
125
- public function save_settings()
126
- {
127
- woocommerce_update_options($this->get_settings());
128
- }
129
  }
130
 
131
  WOOCCM_Order_Email_Controller::instance();
1
  <?php
2
 
3
+ class WOOCCM_Order_Email_Controller {
 
4
 
 
5
 
6
+ protected static $_instance;
7
 
8
+ public function __construct() {
9
+ add_action( 'wooccm_sections_header', array( $this, 'add_header' ) );
10
+ add_action( 'woocommerce_sections_' . WOOCCM_PREFIX, array( $this, 'add_section' ) );
11
+ add_action( 'woocommerce_settings_save_' . WOOCCM_PREFIX, array( $this, 'save_settings' ) );
12
+ }
13
 
14
+ public static function instance() {
15
+ if ( is_null( self::$_instance ) ) {
16
+ self::$_instance = new self();
17
+ }
18
+ return self::$_instance;
19
+ }
 
20
 
21
+ // Admin
22
+ // -------------------------------------------------------------------------
23
 
24
+ public function get_settings() {
25
+ return array(
26
+ array(
27
+ 'type' => 'title',
28
+ 'id' => 'section_title',
29
+ ),
30
+ array(
31
+ 'name' => esc_html__( 'Add upload files', 'woocommerce-checkout-manager' ),
32
+ 'desc_tip' => esc_html__( 'Allow customers to upload files in the email.', 'woocommerce-checkout-manager' ),
33
+ 'id' => 'wooccm_email_upload_files',
34
+ 'type' => 'select',
35
+ 'class' => 'chosen_select wooccm-premium-field',
36
+ 'desc' => esc_html__( 'This is a premium feature.', 'woocommerce-checkout-manager' ),
37
+ 'options' => array(
38
+ 'yes' => esc_html__( 'Yes', 'woocommerce-checkout-manager' ),
39
+ 'no' => esc_html__( 'No', 'woocommerce-checkout-manager' ),
40
+ ),
41
+ 'default' => 'no',
42
+ ),
43
+ array(
44
+ 'name' => esc_html__( 'Add for this order status', 'woocommerce-checkout-manager' ),
45
+ 'desc_tip' => esc_html__( 'Allow customers to upload files in the email.', 'woocommerce-checkout-manager' ),
46
+ 'id' => 'wooccm_email_upload_files_order_status',
47
+ 'type' => 'multiselect',
48
+ 'class' => 'chosen_select wooccm-premium-field',
49
+ 'desc' => esc_html__( 'This is a premium feature.', 'woocommerce-checkout-manager' ),
50
+ 'options' => wc_get_order_statuses(),
51
+ 'default' => array_keys( wc_get_order_statuses() ),
52
+ ),
53
+ array(
54
+ 'name' => esc_html__( 'Add upload files title', 'woocommerce-checkout-manager' ),
55
+ 'desc_tip' => esc_html__( 'Add custom title for the uploads files table.', 'woocommerce-checkout-manager' ),
56
+ 'id' => 'wooccm_email_upload_files_title',
57
+ 'class' => 'wooccm-premium-field',
58
+ 'desc' => esc_html__( 'This is a premium feature.', 'woocommerce-checkout-manager' ),
59
+ 'type' => 'text',
60
+ 'placeholder' => esc_html__( 'Uploaded files', 'woocommerce-checkout-manager' ),
61
+ ),
62
+ array(
63
+ 'name' => esc_html__( 'Add custom fields', 'woocommerce-checkout-manager-pro' ),
64
+ 'desc_tip' => esc_html__( 'Show the selected fields in the email.', 'woocommerce-checkout-manager-pro' ),
65
+ 'id' => 'wooccm_email_custom_fields',
66
+ 'type' => 'select',
67
+ 'class' => 'chosen_select wooccm-premium-field',
68
+ 'desc' => esc_html__( 'This is a premium feature.', 'woocommerce-checkout-manager' ),
69
+ 'options' => array(
70
+ 'yes' => esc_html__( 'Yes', 'woocommerce-checkout-manager-pro' ),
71
+ 'no' => esc_html__( 'No', 'woocommerce-checkout-manager-pro' ),
72
+ ),
73
+ 'default' => 'yes',
74
+ ),
75
+ array(
76
+ 'name' => esc_html__( 'Add for this order status', 'woocommerce-checkout-manager-pro' ),
77
+ 'desc_tip' => esc_html__( 'Allow customers to upload files in the email.', 'woocommerce-checkout-manager-pro' ),
78
+ 'id' => 'wooccm_email_custom_fields_status',
79
+ 'type' => 'multiselect',
80
+ 'class' => 'chosen_select wooccm-premium-field',
81
+ 'desc' => esc_html__( 'This is a premium feature.', 'woocommerce-checkout-manager' ),
82
+ 'options' => wc_get_order_statuses(),
83
+ 'default' => array_keys( wc_get_order_statuses() ),
84
+ ),
85
+ array(
86
+ 'name' => esc_html__( 'Add custom fields title', 'woocommerce-checkout-manager-pro' ),
87
+ 'desc_tip' => esc_html__( 'Add custom title for the uploads files table.', 'woocommerce-checkout-manager-pro' ),
88
+ 'id' => 'wooccm_email_custom_fields_title',
89
+ 'type' => 'text',
90
+ 'class' => 'wooccm-premium-field',
91
+ 'desc' => esc_html__( 'This is a premium feature.', 'woocommerce-checkout-manager' ),
92
+ 'placeholder' => esc_html__( 'Order extra', 'woocommerce-checkout-manager-pro' ),
93
+ ),
94
+ array(
95
+ 'type' => 'sectionend',
96
+ 'id' => 'section_end',
97
+ ),
98
+ );
99
+ }
 
100
 
101
+ public function add_header() {
102
+ global $current_section;
103
+ ?>
104
+ <li><a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=wooccm&section=email' ) ); ?>" class="<?php echo ( $current_section == 'email' ? 'current' : '' ); ?>"><?php esc_html_e( 'Email', 'woocommerce-checkout-manager' ); ?></a> | </li>
105
+ <?php
106
+ }
 
 
 
 
107
 
108
+ public function add_section() {
109
+ global $current_section;
110
 
111
+ if ( 'email' == $current_section ) {
112
 
113
+ $settings = $this->get_settings();
114
 
115
+ include_once WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/email.php';
116
+ }
117
+ }
118
 
119
+ public function save_settings() {
120
+ woocommerce_update_options( $this->get_settings() );
121
+ }
 
122
  }
123
 
124
  WOOCCM_Order_Email_Controller::instance();
includes/controller/class-wooccm-field-additional.php CHANGED
@@ -9,7 +9,7 @@ class WOOCCM_Field_Controller_Additional extends WOOCCM_Field_Controller
9
  public function __construct()
10
  {
11
 
12
- include_once(WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field-additional.php');
13
 
14
  add_action('woocommerce_admin_order_data_after_shipping_address', array($this, 'add_order_data'));
15
  add_action('woocommerce_checkout_update_order_meta', array($this, 'save_order_data'), 10, 2);
@@ -150,7 +150,7 @@ class WOOCCM_Field_Controller_Additional extends WOOCCM_Field_Controller
150
  ?>
151
  <p id="<?php echo esc_attr($field['key']); ?>" class="form-field form-field-wide form-field-type-<?php echo esc_attr($field['type']); ?>">
152
  <strong title="<?php echo esc_attr(sprintf(esc_html__('ID: %s | Field Type: %s', 'woocommerce-checkout-manager'), $key, esc_html__('Generic', 'woocommerce-checkout-manager'))); ?>">
153
- <?php printf('%s', $field['label'] ? esc_html($field['label']) : sprintf(esc_html__('Field %s', 'woocommerce-checkout-manager'), $field_id)); ?>
154
  </strong>
155
  <?php echo esc_html($value); ?>
156
  </p>
@@ -207,7 +207,7 @@ class WOOCCM_Field_Controller_Additional extends WOOCCM_Field_Controller
207
  {
208
  global $current_section;
209
  ?>
210
- <li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm&section=additional'); ?>" class="<?php echo ($current_section == 'additional' ? 'current' : ''); ?>"><?php esc_html_e('Additional', 'woocommerce-checkout-manager'); ?></a> | </li>
211
  <?php
212
  }
213
 
9
  public function __construct()
10
  {
11
 
12
+ include_once( WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field-additional.php' );
13
 
14
  add_action('woocommerce_admin_order_data_after_shipping_address', array($this, 'add_order_data'));
15
  add_action('woocommerce_checkout_update_order_meta', array($this, 'save_order_data'), 10, 2);
150
  ?>
151
  <p id="<?php echo esc_attr($field['key']); ?>" class="form-field form-field-wide form-field-type-<?php echo esc_attr($field['type']); ?>">
152
  <strong title="<?php echo esc_attr(sprintf(esc_html__('ID: %s | Field Type: %s', 'woocommerce-checkout-manager'), $key, esc_html__('Generic', 'woocommerce-checkout-manager'))); ?>">
153
+ <?php printf('%s', esc_html( $field['label'] ) ? esc_html( $field['label'] ) : sprintf(esc_html__('Field %s', 'woocommerce-checkout-manager'), esc_html( $field_id ) ) ); ?>
154
  </strong>
155
  <?php echo esc_html($value); ?>
156
  </p>
207
  {
208
  global $current_section;
209
  ?>
210
+ <li><a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=wooccm&section=additional' ) ); ?>" class="<?php echo ($current_section == 'additional' ? 'current' : ''); ?>"><?php esc_html_e('Additional', 'woocommerce-checkout-manager'); ?></a> | </li>
211
  <?php
212
  }
213
 
includes/controller/class-wooccm-field-billing.php CHANGED
@@ -54,7 +54,7 @@ class WOOCCM_Field_Controller_Billing extends WOOCCM_Field_Controller
54
  {
55
  global $current_section;
56
  ?>
57
- <li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm&section=billing'); ?>" class="<?php echo ($current_section == 'billing' ? 'current' : ''); ?>"><?php esc_html_e('Billing', 'woocommerce-checkout-manager'); ?></a> | </li>
58
  <?php
59
  }
60
 
54
  {
55
  global $current_section;
56
  ?>
57
+ <li><a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=wooccm&section=billing' ) ); ?>" class="<?php echo ($current_section == 'billing' ? 'current' : ''); ?>"><?php esc_html_e('Billing', 'woocommerce-checkout-manager'); ?></a> | </li>
58
  <?php
59
  }
60
 
includes/controller/class-wooccm-field-shipping.php CHANGED
@@ -13,7 +13,6 @@ class WOOCCM_Field_Controller_Shipping extends WOOCCM_Field_Controller
13
  add_action('wooccm_sections_header', array($this, 'add_header'));
14
  add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'), 99);
15
  add_filter('woocommerce_admin_shipping_fields', array($this, 'add_admin_shipping_fields'), 999);
16
-
17
  }
18
 
19
  public static function instance()
@@ -31,7 +30,7 @@ class WOOCCM_Field_Controller_Shipping extends WOOCCM_Field_Controller
31
  {
32
  global $current_section;
33
  ?>
34
- <li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm&section=shipping'); ?>" class="<?php echo ($current_section == 'shipping' ? 'current' : ''); ?>"><?php esc_html_e('Shipping', 'woocommerce-checkout-manager'); ?></a> | </li>
35
  <?php
36
  }
37
 
@@ -95,7 +94,6 @@ class WOOCCM_Field_Controller_Shipping extends WOOCCM_Field_Controller
95
 
96
  return $shipping_fields;
97
  }
98
-
99
  }
100
 
101
  WOOCCM_Field_Controller_Shipping::instance();
13
  add_action('wooccm_sections_header', array($this, 'add_header'));
14
  add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'), 99);
15
  add_filter('woocommerce_admin_shipping_fields', array($this, 'add_admin_shipping_fields'), 999);
 
16
  }
17
 
18
  public static function instance()
30
  {
31
  global $current_section;
32
  ?>
33
+ <li><a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=wooccm&section=shipping' ) ); ?>" class="<?php echo ($current_section == 'shipping' ? 'current' : ''); ?>"><?php esc_html_e('Shipping', 'woocommerce-checkout-manager'); ?></a> | </li>
34
  <?php
35
  }
36
 
94
 
95
  return $shipping_fields;
96
  }
 
97
  }
98
 
99
  WOOCCM_Field_Controller_Shipping::instance();
includes/controller/class-wooccm-order.php CHANGED
@@ -50,13 +50,13 @@ class WOOCCM_Order_Controller extends WOOCCM_Upload
50
  public function frontend_scripts()
51
  {
52
 
53
- if (is_account_page() || !empty( is_wc_endpoint_url('order-received'))) {
54
 
55
  WOOCCM()->register_scripts();
56
 
57
  wp_enqueue_style('wooccm');
58
  wp_enqueue_style('dashicons');
59
- wp_enqueue_script('wooccm-order-upload');
60
  }
61
  }
62
 
@@ -253,7 +253,7 @@ class WOOCCM_Order_Controller extends WOOCCM_Upload
253
  {
254
  global $current_section;
255
  ?>
256
- <li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm&section=order'); ?>" class="<?php echo ($current_section == 'order' ? 'current' : ''); ?>"><?php esc_html_e('Order', 'woocommerce-checkout-manager'); ?></a> | </li>
257
  <?php
258
  }
259
 
50
  public function frontend_scripts()
51
  {
52
 
53
+ if (is_account_page() || !empty(is_wc_endpoint_url('order-received'))) {
54
 
55
  WOOCCM()->register_scripts();
56
 
57
  wp_enqueue_style('wooccm');
58
  wp_enqueue_style('dashicons');
59
+ wp_enqueue_script('wooccm-order-upload');
60
  }
61
  }
62
 
253
  {
254
  global $current_section;
255
  ?>
256
+ <li><a href="<?php echo esc_url( admin_url('admin.php?page=wc-settings&tab=wooccm&section=order') ); ?>" class="<?php echo ($current_section == 'order' ? 'current' : ''); ?>"><?php esc_html_e('Order', 'woocommerce-checkout-manager'); ?></a> | </li>
257
  <?php
258
  }
259
 
includes/controller/class-wooccm-premium.php CHANGED
@@ -1,56 +1,49 @@
1
  <?php
2
 
3
- class WOOCCM_Checkout_Premium_Controller
4
- {
5
-
6
- protected static $_instance;
7
-
8
- public function __construct()
9
- {
10
- add_action('wooccm_sections_header', array($this, 'add_header'));
11
- add_action('admin_menu', array($this, 'add_menu'));
12
- add_action('admin_head', array($this, 'remove_menu'));
13
- }
14
-
15
- public static function instance()
16
- {
17
- if (is_null(self::$_instance)) {
18
- self::$_instance = new self();
19
- }
20
- return self::$_instance;
21
- }
22
-
23
- function remove_menu()
24
- {
25
- ?>
26
- <style>
27
- li.toplevel_page_wooccm {
28
- display: none;
29
- }
30
- </style>
31
- <?php
32
- }
33
-
34
- // Admin
35
- // -------------------------------------------------------------------------
36
-
37
- function add_page()
38
- {
39
- include_once(WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/premium.php');
40
- }
41
-
42
- function add_header()
43
- {
44
- ?>
45
- <li><a href="<?php echo admin_url('admin.php?page=' . WOOCCM_PREFIX); ?>"><?php echo esc_html__('Premium', 'woocommerce-checkout-manager'); ?></a></li> |
46
- <?php
47
- }
48
-
49
- function add_menu()
50
- {
51
- add_menu_page(WOOCCM_PLUGIN_NAME, WOOCCM_PLUGIN_NAME, 'manage_woocommerce', WOOCCM_PREFIX, array($this, 'add_page'));
52
- add_submenu_page(WOOCCM_PREFIX, esc_html__('Premium', 'woocommerce-checkout-manager'), esc_html__('Premium', 'woocommerce-checkout-manager'), 'manage_woocommerce', WOOCCM_PREFIX, array($this, 'add_page'));
53
- }
54
  }
55
 
56
  WOOCCM_Checkout_Premium_Controller::instance();
1
  <?php
2
 
3
+ class WOOCCM_Checkout_Premium_Controller {
4
+
5
+
6
+ protected static $_instance;
7
+
8
+ public function __construct() {
9
+ add_action( 'wooccm_sections_header', array( $this, 'add_header' ) );
10
+ add_action( 'admin_menu', array( $this, 'add_menu' ) );
11
+ add_action( 'admin_head', array( $this, 'remove_menu' ) );
12
+ }
13
+
14
+ public static function instance() {
15
+ if ( is_null( self::$_instance ) ) {
16
+ self::$_instance = new self();
17
+ }
18
+ return self::$_instance;
19
+ }
20
+
21
+ function remove_menu() { ?>
22
+ <style>
23
+ li.toplevel_page_wooccm {
24
+ display: none;
25
+ }
26
+ </style>
27
+ <?php
28
+ }
29
+
30
+ // Admin
31
+ // -------------------------------------------------------------------------
32
+
33
+ function add_page() {
34
+ include_once WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/premium.php';
35
+ }
36
+
37
+ function add_header() {
38
+ ?>
39
+ <li><a href="<?php echo esc_url( admin_url( 'admin.php?page=' . WOOCCM_PREFIX ) ); ?>"><?php echo esc_html__( 'Premium', 'woocommerce-checkout-manager' ); ?></a></li> |
40
+ <?php
41
+ }
42
+
43
+ function add_menu() {
44
+ add_menu_page( WOOCCM_PLUGIN_NAME, WOOCCM_PLUGIN_NAME, 'manage_woocommerce', WOOCCM_PREFIX, array( $this, 'add_page' ) );
45
+ add_submenu_page( WOOCCM_PREFIX, esc_html__( 'Premium', 'woocommerce-checkout-manager' ), esc_html__( 'Premium', 'woocommerce-checkout-manager' ), 'manage_woocommerce', WOOCCM_PREFIX, array( $this, 'add_page' ) );
46
+ }
 
 
 
 
 
 
 
47
  }
48
 
49
  WOOCCM_Checkout_Premium_Controller::instance();
includes/controller/class-wooccm-suggestions.php CHANGED
@@ -1,71 +1,61 @@
1
  <?php
2
 
3
- class WOOCCM_Checkout_Suggestions_Controller
4
- {
5
-
6
- protected static $_instance;
7
-
8
- public function __construct()
9
- {
10
- add_action('wooccm_sections_header', array($this, 'add_header'));
11
- add_action('admin_menu', array($this, 'add_menu'));
12
- add_action('admin_init', array($this, 'add_redirect'));
13
- add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
14
- }
15
-
16
- public static function instance()
17
- {
18
- if (is_null(self::$_instance)) {
19
- self::$_instance = new self();
20
- }
21
- return self::$_instance;
22
- }
23
-
24
- // Admin
25
- // -------------------------------------------------------------------------
26
-
27
- public function add_page()
28
- {
29
- include_once(WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-suggestions-list-table.php');
30
- include_once(WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/suggestions.php');
31
- }
32
-
33
- public function add_menu()
34
- {
35
- add_submenu_page(WOOCCM_PREFIX, esc_html__('Suggestions', 'woocommerce-checkout-manager'), esc_html__('Suggestions', 'woocommerce-checkout-manager'), 'manage_woocommerce', WOOCCM_PREFIX . '_suggestions', array($this, 'add_page'));
36
- }
37
-
38
- function add_header()
39
- {
40
- ?>
41
- <li><a href="<?php echo admin_url('admin.php?page=wooccm_suggestions'); ?>"><?php echo esc_html__('Suggestions', 'woocommerce-checkout-manager'); ?></a></li> |
42
- <?php
43
- }
44
-
45
- // fix for activateUrl on install now button
46
- public function network_admin_url($url, $path)
47
- {
48
-
49
- if (wp_doing_ajax() && !is_network_admin()) {
50
- if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'install-plugin') {
51
- if (strpos($url, 'plugins.php') !== false) {
52
- $url = self_admin_url($path);
53
- }
54
- }
55
- }
56
-
57
- return $url;
58
- }
59
-
60
- public function add_redirect()
61
- {
62
-
63
- if (isset($_REQUEST['activate']) && $_REQUEST['activate'] == 'true') {
64
- if (wp_get_referer() == admin_url('admin.php?page=' . WOOCCM_PREFIX . '_suggestions')) {
65
- wp_redirect(admin_url('admin.php?page=' . WOOCCM_PREFIX . '_suggestions'));
66
- }
67
- }
68
- }
69
  }
70
 
71
  WOOCCM_Checkout_Suggestions_Controller::instance();
1
  <?php
2
 
3
+ class WOOCCM_Checkout_Suggestions_Controller {
4
+
5
+
6
+ protected static $_instance;
7
+
8
+ public function __construct() {
9
+ add_action( 'wooccm_sections_header', array( $this, 'add_header' ) );
10
+ add_action( 'admin_menu', array( $this, 'add_menu' ) );
11
+ add_action( 'admin_init', array( $this, 'add_redirect' ) );
12
+ add_filter( 'network_admin_url', array( $this, 'network_admin_url' ), 10, 2 );
13
+ }
14
+
15
+ public static function instance() {
16
+ if ( is_null( self::$_instance ) ) {
17
+ self::$_instance = new self();
18
+ }
19
+ return self::$_instance;
20
+ }
21
+
22
+ // Admin
23
+ // -------------------------------------------------------------------------
24
+
25
+ public function add_page() {
26
+ include_once WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-suggestions-list-table.php';
27
+ include_once WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/suggestions.php';
28
+ }
29
+
30
+ public function add_menu() {
31
+ add_submenu_page( WOOCCM_PREFIX, esc_html__( 'Suggestions', 'woocommerce-checkout-manager' ), esc_html__( 'Suggestions', 'woocommerce-checkout-manager' ), 'manage_woocommerce', WOOCCM_PREFIX . '_suggestions', array( $this, 'add_page' ) );
32
+ }
33
+
34
+ function add_header() { ?>
35
+ <li><a href="<?php echo esc_url( admin_url( 'admin.php?page=wooccm_suggestions' ) ); ?>"><?php echo esc_html__( 'Suggestions', 'woocommerce-checkout-manager' ); ?></a></li> |
36
+ <?php
37
+ }
38
+
39
+ // fix for activateUrl on install now button
40
+ public function network_admin_url( $url, $path ) {
41
+ if ( wp_doing_ajax() && ! is_network_admin() ) {
42
+ if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'install-plugin' ) {
43
+ if ( strpos( $url, 'plugins.php' ) !== false ) {
44
+ $url = self_admin_url( $path );
45
+ }
46
+ }
47
+ }
48
+
49
+ return $url;
50
+ }
51
+
52
+ public function add_redirect() {
53
+ if ( isset( $_REQUEST['activate'] ) && $_REQUEST['activate'] == 'true' ) {
54
+ if ( wp_get_referer() == admin_url( 'admin.php?page=' . WOOCCM_PREFIX . '_suggestions' ) ) {
55
+ wp_redirect( admin_url( 'admin.php?page=' . WOOCCM_PREFIX . '_suggestions' ) );
56
+ }
57
+ }
58
+ }
 
 
 
 
 
 
 
 
 
 
59
  }
60
 
61
  WOOCCM_Checkout_Suggestions_Controller::instance();
includes/model/class-wooccm-field-additional.php CHANGED
@@ -2,21 +2,21 @@
2
 
3
  if (!class_exists('WOOCCM_Field_Additional')) {
4
 
5
- include_once( WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field.php' );
6
 
7
- class WOOCCM_Field_Additional extends WOOCCM_Field {
 
8
 
9
  protected static $_instance;
10
  protected $prefix = 'additional';
11
  protected $table = 'wooccm_additional';
12
 
13
- public static function instance() {
 
14
  if (is_null(self::$_instance)) {
15
  self::$_instance = new self();
16
  }
17
  return self::$_instance;
18
  }
19
-
20
  }
21
-
22
  }
2
 
3
  if (!class_exists('WOOCCM_Field_Additional')) {
4
 
5
+ include_once(WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field.php');
6
 
7
+ class WOOCCM_Field_Additional extends WOOCCM_Field
8
+ {
9
 
10
  protected static $_instance;
11
  protected $prefix = 'additional';
12
  protected $table = 'wooccm_additional';
13
 
14
+ public static function instance()
15
+ {
16
  if (is_null(self::$_instance)) {
17
  self::$_instance = new self();
18
  }
19
  return self::$_instance;
20
  }
 
21
  }
 
22
  }
includes/model/class-wooccm-field-billing.php CHANGED
@@ -2,35 +2,35 @@
2
 
3
  if (!class_exists('WOOCCM_Field_Billing')) {
4
 
5
- include_once( WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field.php' );
6
 
7
- class WOOCCM_Field_Billing extends WOOCCM_Field {
 
8
 
9
  protected static $_instance;
10
  //protected $fields = array();
11
  protected $prefix = 'billing';
12
  protected $table = 'wooccm_billing';
13
  protected $defaults = array(
14
- 'country',
15
- 'first_name',
16
- 'last_name',
17
- 'company',
18
- 'address_1',
19
- 'address_2',
20
- 'city',
21
- 'state',
22
- 'postcode',
23
- 'email',
24
- 'phone'
25
  );
26
 
27
- public static function instance() {
 
28
  if (is_null(self::$_instance)) {
29
  self::$_instance = new self();
30
  }
31
  return self::$_instance;
32
  }
33
-
34
  }
35
-
36
  }
2
 
3
  if (!class_exists('WOOCCM_Field_Billing')) {
4
 
5
+ include_once(WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field.php');
6
 
7
+ class WOOCCM_Field_Billing extends WOOCCM_Field
8
+ {
9
 
10
  protected static $_instance;
11
  //protected $fields = array();
12
  protected $prefix = 'billing';
13
  protected $table = 'wooccm_billing';
14
  protected $defaults = array(
15
+ 'country',
16
+ 'first_name',
17
+ 'last_name',
18
+ 'company',
19
+ 'address_1',
20
+ 'address_2',
21
+ 'city',
22
+ 'state',
23
+ 'postcode',
24
+ 'email',
25
+ 'phone'
26
  );
27
 
28
+ public static function instance()
29
+ {
30
  if (is_null(self::$_instance)) {
31
  self::$_instance = new self();
32
  }
33
  return self::$_instance;
34
  }
 
35
  }
 
36
  }
includes/model/class-wooccm-field-shipping.php CHANGED
@@ -2,32 +2,32 @@
2
 
3
  if (!class_exists('WOOCCM_Field_Shipping')) {
4
 
5
- include_once( WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field.php' );
6
 
7
- class WOOCCM_Field_Shipping extends WOOCCM_Field {
 
8
 
9
  protected static $_instance;
10
  protected $prefix = 'shipping';
11
  protected $table = 'wooccm_shipping';
12
  protected $defaults = array(
13
- 'country',
14
- 'first_name',
15
- 'last_name',
16
- 'company',
17
- 'address_1',
18
- 'address_2',
19
- 'city',
20
- 'state',
21
- 'postcode',
22
  );
23
 
24
- public static function instance() {
 
25
  if (is_null(self::$_instance)) {
26
  self::$_instance = new self();
27
  }
28
  return self::$_instance;
29
  }
30
-
31
  }
32
-
33
  }
2
 
3
  if (!class_exists('WOOCCM_Field_Shipping')) {
4
 
5
+ include_once(WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field.php');
6
 
7
+ class WOOCCM_Field_Shipping extends WOOCCM_Field
8
+ {
9
 
10
  protected static $_instance;
11
  protected $prefix = 'shipping';
12
  protected $table = 'wooccm_shipping';
13
  protected $defaults = array(
14
+ 'country',
15
+ 'first_name',
16
+ 'last_name',
17
+ 'company',
18
+ 'address_1',
19
+ 'address_2',
20
+ 'city',
21
+ 'state',
22
+ 'postcode',
23
  );
24
 
25
+ public static function instance()
26
+ {
27
  if (is_null(self::$_instance)) {
28
  self::$_instance = new self();
29
  }
30
  return self::$_instance;
31
  }
 
32
  }
 
33
  }
includes/quadlayers/widget.php CHANGED
@@ -30,9 +30,9 @@ class QL_Widget
30
  <div>
31
  <div style="margin-top: 11px;float: left;width: 70%;">
32
  <?php esc_html_e('Hi! We are Quadlayers! Welcome to QuadLayers! We’re a team of international people who have been working in the WordPress sphere for the last ten years.', 'woocommerce-checkout-manager'); ?>
33
- <div style="margin-top: 11px; float: left; width: 70%;"><a href="<?php echo admin_url('admin.php?page=' . WOOCCM_PREFIX . '_suggestions'); ?>" target="_blank" class="button button-secondary"><?php esc_html_e('More products', 'woocommerce-checkout-manager'); ?></a></div>
34
  </div>
35
- <img style="width: 30%;margin-top: 11px;float: right; max-width: 95px;" src="<?php echo plugins_url('/assets/backend/img/quadlayers.jpg', WOOCCM_PLUGIN_FILE); ?>" />
36
  </div>
37
  <div style="clear: both;"></div>
38
  </div>
@@ -65,16 +65,16 @@ class QL_Widget
65
  $author = $item['author'];
66
  $author = ucfirst($author);
67
  $author = ' <cite>' . esc_html(strip_tags($author)) . '</cite>';
68
- printf(__('<li><a href="%s" target="_blank">%s </a>%s%s%s</li>', 'woocommerce-checkout-manager'), $link, $title, $date, $summary, $author);
69
  } ?>
70
  <?php } else {
71
- printf(__('<li>%s</li>', 'woocommerce-checkout-manager'), $feed_items);
72
  } ?>
73
  </ul>
74
  </div>
75
  <div style="display: flex; justify-content: space-between;align-items: center;margin: 16px -12px 0;padding: 12px 12px 0; border-top: 1px solid #eee;">
76
- <a href="<?php printf('https://quadlayers.com/blog/?utm_source=%s&utm_medium=software&utm_campaign=wordpress&utm_content=dashboard', WOOCCM_PREFIX); ?>" target="_blank"><?php esc_html_e('Read more like this on our blog', 'woocommerce-checkout-manager') ?></a>
77
- <a class="button-primary" href="<?php printf('https://quadlayers.com/?utm_source=%s&utm_medium=software&utm_campaign=wordpress&utm_content=dashboard', WOOCCM_PREFIX); ?>" target="_blank"><?php esc_html_e('QuadLayers', 'woocommerce-checkout-manager') ?></a>
78
  </div>
79
  <?php
80
  }
30
  <div>
31
  <div style="margin-top: 11px;float: left;width: 70%;">
32
  <?php esc_html_e('Hi! We are Quadlayers! Welcome to QuadLayers! We’re a team of international people who have been working in the WordPress sphere for the last ten years.', 'woocommerce-checkout-manager'); ?>
33
+ <div style="margin-top: 11px; float: left; width: 70%;"><a href="<?php echo esc_url(admin_url('admin.php?page=' . WOOCCM_PREFIX . '_suggestions')); ?>" target="_blank" class="button button-secondary"><?php esc_html_e('More products', 'woocommerce-checkout-manager'); ?></a></div>
34
  </div>
35
+ <img style="width: 30%;margin-top: 11px;float: right; max-width: 95px;" src="<?php echo esc_url(plugins_url('/assets/backend/img/quadlayers.jpg', WOOCCM_PLUGIN_FILE)); ?>" />
36
  </div>
37
  <div style="clear: both;"></div>
38
  </div>
65
  $author = $item['author'];
66
  $author = ucfirst($author);
67
  $author = ' <cite>' . esc_html(strip_tags($author)) . '</cite>';
68
+ printf(('<li><a href="%s" target="_blank">%s </a>%s%s%s</li>'), esc_url($link), esc_html($title), esc_html($date), esc_url($summary), esc_url($author));
69
  } ?>
70
  <?php } else {
71
+ printf(('<li>%s</li>'), wp_kses_post($feed_items));
72
  } ?>
73
  </ul>
74
  </div>
75
  <div style="display: flex; justify-content: space-between;align-items: center;margin: 16px -12px 0;padding: 12px 12px 0; border-top: 1px solid #eee;">
76
+ <a href="<?php printf('https://quadlayers.com/blog/?utm_source=%s&utm_medium=software&utm_campaign=wordpress&utm_content=dashboard', esc_attr(WOOCCM_PREFIX)); ?>" target="_blank"><?php esc_html_e('Read more like this on our blog', 'woocommerce-checkout-manager') ?></a>
77
+ <a class="button-primary" href="<?php printf('https://quadlayers.com/?utm_source=%s&utm_medium=software&utm_campaign=wordpress&utm_content=dashboard', esc_attr(WOOCCM_PREFIX)); ?>" target="_blank"><?php esc_html_e('QuadLayers', 'woocommerce-checkout-manager') ?></a>
78
  </div>
79
  <?php
80
  }
includes/view/backend/meta-boxes/html-order-uploads.php CHANGED
@@ -17,7 +17,7 @@
17
  $image_attributes2 = wp_get_attachment_image_src($attachment_id);
18
  $filename = basename($image_attributes);
19
  $wp_filetype = wp_check_filetype($filename);
20
- ?>
21
  <tr class="image">
22
  <td class="thumb">
23
  <div class="wc-order-item-thumbnail">
@@ -30,18 +30,18 @@
30
  if ($image_attributes2[1] == '') {
31
  echo '-';
32
  } else {
33
- echo $image_attributes2[1] . ' x ' . $image_attributes2[2];
34
  }
35
  ?>
36
  </td>
37
- <td><?php echo strtoupper($wp_filetype['ext']); ?></td>
38
  <td class="column-actions" nowrap>
39
  <!--<a href="<?php echo esc_url($image_attributes2[0]); ?>" target="_blank" class="button"><?php esc_html_e('Download', 'woocommerce-checkout-manager'); ?></a>-->
40
  <a class="button wooccm_delete_attachment" data-attachment_id="<?php echo esc_attr($attachment_id); ?>" data-tip="<?php esc_html_e('Delete', 'woocommerce-checkout-manager'); ?>"><?php esc_html_e('Delete', 'woocommerce-checkout-manager'); ?></a>
41
  </td>
42
  </tr>
43
  <?php endforeach; ?>
44
- <?php else: ?>
45
  <tr>
46
  <td colspan="6" style="text-align:left;"><?php esc_html_e('No files have been uploaded to this order.', 'woocommerce-checkout-manager'); ?></td>
47
  </tr>
17
  $image_attributes2 = wp_get_attachment_image_src($attachment_id);
18
  $filename = basename($image_attributes);
19
  $wp_filetype = wp_check_filetype($filename);
20
+ ?>
21
  <tr class="image">
22
  <td class="thumb">
23
  <div class="wc-order-item-thumbnail">
30
  if ($image_attributes2[1] == '') {
31
  echo '-';
32
  } else {
33
+ echo esc_html( $image_attributes2[1] ) . ' x ' . esc_html( $image_attributes2[2] );
34
  }
35
  ?>
36
  </td>
37
+ <td><?php echo esc_html( strtoupper( $wp_filetype['ext'] ) ); ?></td>
38
  <td class="column-actions" nowrap>
39
  <!--<a href="<?php echo esc_url($image_attributes2[0]); ?>" target="_blank" class="button"><?php esc_html_e('Download', 'woocommerce-checkout-manager'); ?></a>-->
40
  <a class="button wooccm_delete_attachment" data-attachment_id="<?php echo esc_attr($attachment_id); ?>" data-tip="<?php esc_html_e('Delete', 'woocommerce-checkout-manager'); ?>"><?php esc_html_e('Delete', 'woocommerce-checkout-manager'); ?></a>
41
  </td>
42
  </tr>
43
  <?php endforeach; ?>
44
+ <?php else : ?>
45
  <tr>
46
  <td colspan="6" style="text-align:left;"><?php esc_html_e('No files have been uploaded to this order.', 'woocommerce-checkout-manager'); ?></td>
47
  </tr>
includes/view/backend/pages/additional.php CHANGED
@@ -1,9 +1,9 @@
1
- <?php include_once( 'parts/tabs.php' ); ?>
2
- <h1 class="screen-reader-text"><?php esc_html_e('Additional', 'woocommerce-checkout-manager'); ?></h1>
3
- <h2><?php esc_html_e('Additional fields', 'woocommerce-checkout-manager'); ?></h2>
4
- <div id="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
5
- <p><?php printf(esc_html__('Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager'), $current_section); ?></p>
6
  </div>
7
- <?php include_once( 'parts/actions.php' ); ?>
8
- <?php include_once( 'parts/loop.php' ); ?>
9
- <?php include_once( 'modals/field.php' ); ?>
1
+ <?php require_once 'parts/tabs.php'; ?>
2
+ <h1 class="screen-reader-text"><?php esc_html_e( 'Additional', 'woocommerce-checkout-manager' ); ?></h1>
3
+ <h2><?php esc_html_e( 'Additional fields', 'woocommerce-checkout-manager' ); ?></h2>
4
+ <div id="<?php printf( 'wooccm_%s_settings-description', $current_section ); ?>">
5
+ <p><?php printf( esc_html__( 'Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager' ), $current_section ); ?></p>
6
  </div>
7
+ <?php require_once 'parts/actions.php'; ?>
8
+ <?php require_once 'parts/loop.php'; ?>
9
+ <?php require_once 'modals/field.php'; ?>
includes/view/backend/pages/billing.php CHANGED
@@ -1,9 +1,9 @@
1
- <?php include_once( 'parts/tabs.php' ); ?>
2
- <h1 class="screen-reader-text"><?php esc_html_e('Billing', 'woocommerce-checkout-manager'); ?></h1>
3
- <h2><?php esc_html_e('Billing fields', 'woocommerce-checkout-manager'); ?></h2>
4
- <div id="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
5
- <p><?php printf(esc_html__('Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager'), $current_section); ?></p>
6
  </div>
7
- <?php include_once( 'parts/actions.php' ); ?>
8
- <?php include_once( 'parts/loop.php' ); ?>
9
- <?php include_once( 'modals/field.php' ); ?>
1
+ <?php require_once 'parts/tabs.php'; ?>
2
+ <h1 class="screen-reader-text"><?php esc_html_e( 'Billing', 'woocommerce-checkout-manager' ); ?></h1>
3
+ <h2><?php esc_html_e( 'Billing fields', 'woocommerce-checkout-manager' ); ?></h2>
4
+ <div id="<?php printf( 'wooccm_%s_settings-description', $current_section ); ?>">
5
+ <p><?php printf( esc_html__( 'Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager' ), $current_section ); ?></p>
6
  </div>
7
+ <?php require_once 'parts/actions.php'; ?>
8
+ <?php require_once 'parts/loop.php'; ?>
9
+ <?php require_once 'modals/field.php'; ?>
includes/view/backend/pages/checkout.php CHANGED
@@ -1,7 +1,7 @@
1
- <?php include_once( 'parts/tabs.php' ); ?>
2
- <h1 class="screen-reader-text"><?php esc_html_e('Checkout', 'woocommerce-checkout-manager'); ?></h1>
3
- <h2><?php esc_html_e('Checkout settings', 'woocommerce-checkout-manager'); ?></h2>
4
- <div id="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
5
- <p><?php printf(esc_html__('Customize and manage the checkout settings.', 'woocommerce-checkout-manager'), $current_section); ?></p>
6
  </div>
7
- <?php woocommerce_admin_fields($settings); ?>
1
+ <?php require_once 'parts/tabs.php'; ?>
2
+ <h1 class="screen-reader-text"><?php esc_html_e( 'Checkout', 'woocommerce-checkout-manager' ); ?></h1>
3
+ <h2><?php esc_html_e( 'Checkout settings', 'woocommerce-checkout-manager' ); ?></h2>
4
+ <div id="<?php printf( 'wooccm_%s_settings-description', $current_section ); ?>">
5
+ <p><?php printf( esc_html__( 'Customize and manage the checkout settings.', 'woocommerce-checkout-manager' ), $current_section ); ?></p>
6
  </div>
7
+ <?php woocommerce_admin_fields( $settings ); ?>
includes/view/backend/pages/email.php CHANGED
@@ -1,7 +1,7 @@
1
- <?php include_once( 'parts/tabs.php' ); ?>
2
- <h1 class="screen-reader-text"><?php esc_html_e('Email', 'woocommerce-checkout-manager'); ?></h1>
3
- <h2><?php esc_html_e('Email settings', 'woocommerce-checkout-manager'); ?></h2>
4
- <div id="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
5
- <p><?php printf(esc_html__('Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager'), $current_section); ?></p>
6
  </div>
7
- <?php woocommerce_admin_fields($settings); ?>
1
+ <?php require_once 'parts/tabs.php'; ?>
2
+ <h1 class="screen-reader-text"><?php esc_html_e( 'Email', 'woocommerce-checkout-manager' ); ?></h1>
3
+ <h2><?php esc_html_e( 'Email settings', 'woocommerce-checkout-manager' ); ?></h2>
4
+ <div id="<?php printf( 'wooccm_%s_settings-description', $current_section ); ?>">
5
+ <p><?php printf( esc_html__( 'Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager' ), $current_section ); ?></p>
6
  </div>
7
+ <?php woocommerce_admin_fields( $settings ); ?>
includes/view/backend/pages/modals/field.php CHANGED
@@ -1,20 +1,20 @@
1
  <script type="text/html" id='tmpl-wooccm-modal-main'>
2
- <?php include_once( 'parts/main.php' ); ?>
3
  </script>
4
  <script type="text/html" id='tmpl-wooccm-modal-tabs'>
5
- <?php include_once( 'parts/tabs.php' ); ?>
6
  </script>
7
  <script type="text/html" id='tmpl-wooccm-modal-panels'>
8
- <?php include_once( 'parts/panel-general.php' ); ?>
9
- <?php include_once( 'parts/panel-select2.php' ); ?>
10
- <?php include_once( 'parts/panel-options.php' ); ?>
11
- <?php include_once( 'parts/panel-filter.php' ); ?>
12
- <?php include_once( 'parts/panel-display.php' ); ?>
13
- <?php include_once( 'parts/panel-price.php' ); ?>
14
- <?php include_once( 'parts/panel-datepicker.php' ); ?>
15
- <?php include_once( 'parts/panel-timepicker.php' ); ?>
16
- <?php include_once( 'parts/panel-admin.php' ); ?>
17
  </script>
18
  <script type="text/html" id='tmpl-wooccm-modal-info'>
19
- <?php include_once( 'parts/info.php' ); ?>
20
- </script>
1
  <script type="text/html" id='tmpl-wooccm-modal-main'>
2
+ <?php require_once 'parts/main.php'; ?>
3
  </script>
4
  <script type="text/html" id='tmpl-wooccm-modal-tabs'>
5
+ <?php require_once 'parts/tabs.php'; ?>
6
  </script>
7
  <script type="text/html" id='tmpl-wooccm-modal-panels'>
8
+ <?php require_once 'parts/panel-general.php'; ?>
9
+ <?php require_once 'parts/panel-select2.php'; ?>
10
+ <?php require_once 'parts/panel-options.php'; ?>
11
+ <?php require_once 'parts/panel-filter.php'; ?>
12
+ <?php require_once 'parts/panel-display.php'; ?>
13
+ <?php require_once 'parts/panel-price.php'; ?>
14
+ <?php require_once 'parts/panel-datepicker.php'; ?>
15
+ <?php require_once 'parts/panel-timepicker.php'; ?>
16
+ <?php require_once 'parts/panel-admin.php'; ?>
17
  </script>
18
  <script type="text/html" id='tmpl-wooccm-modal-info'>
19
+ <?php require_once 'parts/info.php'; ?>
20
+ </script>
includes/view/backend/pages/modals/parts/info.php CHANGED
@@ -1,77 +1,77 @@
1
  <span class="settings-save-status">
2
  <span class="spinner"></span>
3
- <span class="saved"><?php esc_html_e('Saved.'); ?></span>
4
  </span>
5
 
6
  <div class="details">
7
- <div class="filename"><strong><?php esc_html_e('Field id', 'woocommerce-checkout-manager'); ?>:</strong> {{data.id}}</div>
8
- <div class="filename"><strong><?php esc_html_e('Field key', 'woocommerce-checkout-manager'); ?>:</strong> #{{data.key}}</div>
9
- <# if (data.parent != undefined) { #>
10
- <div class="filename"><strong><?php esc_html_e('Parent type', 'woocommerce-checkout-manager'); ?>:</strong> {{data.parent.type}}</div>
11
- <# } #>
12
  </div>
13
 
14
  <div class="panel woocommerce_options_panel">
15
  <div class="settings">
16
- <p class="form-field">
17
- <label><?php esc_html_e('Conditional', 'woocommerce-checkout-manager'); ?></label>
18
- <input <# if (data.conditional) { #>checked="checked"<# } #> type="checkbox" name="conditional" value="1">
19
- <span class="description"><?php esc_html_e('Activate conditional field requirement.', 'woocommerce-checkout-manager'); ?></span>
20
- </p>
21
  </div>
22
  <div class="settings">
23
- <p class="form-field">
24
- <label><?php esc_html_e('Parent', 'woocommerce-checkout-manager'); ?></label>
25
- <select class="media-modal-parent media-modal-render-info wooccm-enhanced-select" name="conditional_parent_key" data-placeholder="<?php esc_attr_e('Select parent field&hellip;', 'woocommerce-checkout-manager'); ?>" data-allow_clear="false">
26
- <option <# if (data.conditional_parent_key == '') { #>selected="selected"<# } #> value=""></option>
27
- <?php foreach ($fields as $field_id => $field) : ?>
28
- <?php if (in_array($field['type'], $conditionals)): ?>
29
- <# if ( data.id != '<?php echo esc_attr($field['id']); ?>' ) { #>
30
- <option <# if ( data.conditional_parent_key == '<?php echo esc_attr($field['key']); ?>' ) { #>selected="selected"<# } #> value="<?php echo esc_attr($field['key']); ?>"><?php printf('%s', $field['label'] ? esc_html($field['label']) : sprintf(esc_html__('Field %s', 'woocommerce-checkout-manager'), $field_id)); ?></option>
31
- <# } #>
32
- <?php endif; ?>
33
- <?php endforeach; ?>
34
- </select>
35
- <span class="description"><?php esc_html_e('Select conditional parent field.', 'woocommerce-checkout-manager'); ?></span>
36
- </p>
37
  </div>
38
  <div class="settings">
39
- <p class="form-field">
40
- <# if( data.parent != undefined && data.parent.label != '' ) { #>
41
- <label>{{data.parent.label}}</label>
42
- <# } else { #>
43
- <label><?php esc_html_e('Value', 'woocommerce-checkout-manager'); ?></label>
44
- <# } #>
45
- <# if ( data.parent != undefined && _.contains(<?php echo json_encode($option); ?>, data.parent.type) && _.isObject(data.parent.options)) { #>
46
- <select class="wooccm-enhanced-select" name="conditional_parent_value">
47
- <# _.each(data.parent.options, function (option, index) { #>
48
- <option <# if ( option.label == data.conditional_parent_value ) { #>selected="selected"<# } #> value="{{option.label}}">{{option.label}}</option>
49
- <# }); #>
50
- </select>
51
- <# } else if( data.parent != undefined && data.parent.type == 'checkbox' ) { #>
52
- <select class="select short" name="conditional_parent_value">
53
- <option <# if ( 1 == data.conditional_parent_value ) { #>selected="selected"<# } #> value="1"><?php esc_html_e('Yes'); ?></option>
54
- <option <# if ( 0 == data.conditional_parent_value ) { #>selected="selected"<# } #> value="0"><?php esc_html_e('No'); ?></option>
55
- </select>
56
- <# } else if( data.parent != undefined && data.parent.type == 'country' ) { #>
57
- <select class="wooccm-enhanced-select" name="conditional_parent_value" data-placeholder="<?php esc_attr_e('Preserve default country&hellip;', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true">
58
- <option <# if (data.default == '') { #>selected="selected"<# } #> value=""></option>
59
- <?php foreach (WC()->countries->get_countries() as $id => $name) : ?>
60
- <option <# if (data.conditional_parent_value == '<?php echo esc_attr($id); ?>') { #>selected="selected"<# } #> value="<?php echo esc_attr($id); ?>"><?php echo esc_html($name); ?></option>
61
- <?php endforeach; ?>
62
- </select>
63
- <# } else if( data.parent != undefined ) { #>
64
- <input type="text" name="conditional_parent_value" placeholder="{{data.parent.default}}" value="{{data.conditional_parent_value}}">
65
- <# } else { #>
66
- <input type="text" name="conditional_parent_value" placeholder="<?php esc_html_e('Conditional parent value', 'woocommerce-checkout-manager'); ?>" value="{{data.conditional_parent_value}}">
67
- <# } #>
68
- <span class="description"><?php esc_html_e('Show field if parent has this value.', 'woocommerce-checkout-manager'); ?></span>
69
- </p>
70
  </div>
71
  </div>
72
 
73
  <div class="actions">
74
- <a target="_blank" class="view-attachment" href="<?php echo wc_get_page_permalink('checkout'); ?>"><?php esc_html_e('View checkout page', 'woocommerce-checkout-manager'); ?></a> |
75
- <a target="_blank" href="<?php echo WOOCCM_PURCHASE_URL; ?>"><?php esc_html_e('Get premium version', 'woocommerce-checkout-manager'); ?></a> |
76
- <a target="_blank" href="<?php echo WOOCCM_DOCUMENTATION_URL; ?>"><?php esc_html_e('View documentation', 'woocommerce-checkout-manager'); ?></a>
77
- </div>
1
  <span class="settings-save-status">
2
  <span class="spinner"></span>
3
+ <span class="saved"><?php esc_html_e( 'Saved.' ); ?></span>
4
  </span>
5
 
6
  <div class="details">
7
+ <div class="filename"><strong><?php esc_html_e( 'Field id', 'woocommerce-checkout-manager' ); ?>:</strong> {{data.id}}</div>
8
+ <div class="filename"><strong><?php esc_html_e( 'Field key', 'woocommerce-checkout-manager' ); ?>:</strong> #{{data.key}}</div>
9
+ <# if (data.parent !=undefined) { #>
10
+ <div class="filename"><strong><?php esc_html_e( 'Parent type', 'woocommerce-checkout-manager' ); ?>:</strong> {{data.parent.type}}</div>
11
+ <# } #>
12
  </div>
13
 
14
  <div class="panel woocommerce_options_panel">
15
  <div class="settings">
16
+ <p class="form-field">
17
+ <label><?php esc_html_e( 'Conditional', 'woocommerce-checkout-manager' ); ?></label>
18
+ <input <# if (data.conditional) { #>checked="checked"<# } #> type="checkbox" name="conditional" value="1">
19
+ <span class="description"><?php esc_html_e( 'Activate conditional field requirement.', 'woocommerce-checkout-manager' ); ?></span>
20
+ </p>
21
  </div>
22
  <div class="settings">
23
+ <p class="form-field">
24
+ <label><?php esc_html_e( 'Parent', 'woocommerce-checkout-manager' ); ?></label>
25
+ <select class="media-modal-parent media-modal-render-info wooccm-enhanced-select" name="conditional_parent_key" data-placeholder="<?php esc_attr_e( 'Select parent field&hellip;', 'woocommerce-checkout-manager' ); ?>" data-allow_clear="false">
26
+ <option <# if (data.conditional_parent_key=='' ) { #>selected="selected"<# } #> value=""></option>
27
+ <?php foreach ( $fields as $field_id => $field ) : ?>
28
+ <?php if ( in_array( $field['type'], $conditionals ) ) : ?>
29
+ <# if ( data.id !='<?php echo esc_attr( $field['id'] ); ?>' ) { #>
30
+ <option <# if ( data.conditional_parent_key=='<?php echo esc_attr( $field['key'] ); ?>' ) { #>selected="selected"<# } #> value="<?php echo esc_attr( $field['key'] ); ?>"><?php printf( '%s', $field['label'] ? esc_html( $field['label'] ) : sprintf( esc_html__( 'Field %s', 'woocommerce-checkout-manager' ), $field_id ) ); ?></option>
31
+ <# } #>
32
+ <?php endif; ?>
33
+ <?php endforeach; ?>
34
+ </select>
35
+ <span class="description"><?php esc_html_e( 'Select conditional parent field.', 'woocommerce-checkout-manager' ); ?></span>
36
+ </p>
37
  </div>
38
  <div class="settings">
39
+ <p class="form-field">
40
+ <# if( data.parent !=undefined && data.parent.label !='' ) { #>
41
+ <label>{{data.parent.label}}</label>
42
+ <# } else { #>
43
+ <label><?php esc_html_e( 'Value', 'woocommerce-checkout-manager' ); ?></label>
44
+ <# } #>
45
+ <# if ( data.parent !=undefined && _.contains(<?php echo json_encode( $option ); ?>, data.parent.type) && _.isObject(data.parent.options)) { #>
46
+ <select class="wooccm-enhanced-select" name="conditional_parent_value">
47
+ <# _.each(data.parent.options, function (option, index) { #>
48
+ <option <# if ( option.label==data.conditional_parent_value ) { #>selected="selected"<# } #> value="{{option.label}}">{{option.label}}</option>
49
+ <# }); #>
50
+ </select>
51
+ <# } else if( data.parent !=undefined && data.parent.type=='checkbox' ) { #>
52
+ <select class="select short" name="conditional_parent_value">
53
+ <option <# if ( 1==data.conditional_parent_value ) { #>selected="selected"<# } #> value="1"><?php esc_html_e( 'Yes' ); ?></option>
54
+ <option <# if ( 0==data.conditional_parent_value ) { #>selected="selected"<# } #> value="0"><?php esc_html_e( 'No' ); ?></option>
55
+ </select>
56
+ <# } else if( data.parent !=undefined && data.parent.type=='country' ) { #>
57
+ <select class="wooccm-enhanced-select" name="conditional_parent_value" data-placeholder="<?php esc_attr_e( 'Preserve default country&hellip;', 'woocommerce-checkout-manager' ); ?>" data-allow_clear="true">
58
+ <option <# if (data.default=='' ) { #>selected="selected"<# } #> value=""></option>
59
+ <?php foreach ( WC()->countries->get_countries() as $id => $name ) : ?>
60
+ <option <# if (data.conditional_parent_value=='<?php echo esc_attr( $id ); ?>' ) { #>selected="selected"<# } #> value="<?php echo esc_attr( $id ); ?>"><?php echo esc_html( $name ); ?></option>
61
+ <?php endforeach; ?>
62
+ </select>
63
+ <# } else if( data.parent !=undefined ) { #>
64
+ <input type="text" name="conditional_parent_value" placeholder="{{data.parent.default}}" value="{{data.conditional_parent_value}}">
65
+ <# } else { #>
66
+ <input type="text" name="conditional_parent_value" placeholder="<?php esc_html_e( 'Conditional parent value', 'woocommerce-checkout-manager' ); ?>" value="{{data.conditional_parent_value}}">
67
+ <# } #>
68
+ <span class="description"><?php esc_html_e( 'Show field if parent has this value.', 'woocommerce-checkout-manager' ); ?></span>
69
+ </p>
70
  </div>
71
  </div>
72
 
73
  <div class="actions">
74
+ <a target="_blank" class="view-attachment" href="<?php echo wc_get_page_permalink( 'checkout' ); ?>"><?php esc_html_e( 'View checkout page', 'woocommerce-checkout-manager' ); ?></a> |
75
+ <a target="_blank" href="<?php echo WOOCCM_PURCHASE_URL; ?>"><?php esc_html_e( 'Get premium version', 'woocommerce-checkout-manager' ); ?></a> |
76
+ <a target="_blank" href="<?php echo WOOCCM_DOCUMENTATION_URL; ?>"><?php esc_html_e( 'View documentation', 'woocommerce-checkout-manager' ); ?></a>
77
+ </div>
includes/view/backend/pages/modals/parts/main.php CHANGED
@@ -1,53 +1,55 @@
1
  <div class="media-modal-backdrop">&nbsp;</div>
2
- <div tabindex="0" id="<?php echo esc_attr(WOOCCM_PREFIX . '_modal'); ?>" class="media-modal wp-core-ui upload-php processing" role="dialog" aria-modal="true" aria-labelledby="media-frame-title">
3
  <div class="media-modal-content" role="document">
4
- <form class="media-modal-form" method="POST">
5
- <# if ( data.id != undefined ) { #>
6
- <input type="hidden" name="id" value="{{data.id}}" />
7
- <input type="hidden" name="order" value="{{data.order}}" />
8
- <# } #>
9
- <div class="edit-attachment-frame mode-select hide-menu hide-router">
10
- <div class="edit-media-header">
11
- <# if ( data.id != undefined ) { #>
12
- <button type="button" class="media-modal-prev left dashicons" <# if ( data.order == 1 ) { #>disabled="disabled"<# } #>><span class="screen-reader-text"><?php esc_html_e('Edit previous media item'); ?></span></button>
13
- <button type="button" class="media-modal-next right dashicons" <# if ( data.order == <?php echo esc_attr(count($fields)); ?> ) { #>disabled="disabled"<# } #>><span class="screen-reader-text"><?php esc_html_e('Edit next media item'); ?></span></button>
14
- <# } #>
15
- <button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php esc_html_e('Close dialog'); ?></span></span></button>
16
- </div>
17
- <div class="media-frame-title">
18
- <h1><?php esc_html_e('Edit field', 'woocommerce-checkout-manager'); ?> #<# if ( data.id != undefined ) { #>{{data.id}}<# } else { #><?php echo esc_html_e('New', 'woocommerce-checkout-manager'); ?><# } #></h1>
19
- </div>
20
- <div class="media-frame-content" style="bottom:61px;">
21
- <div class="attachment-details" style="overflow: hidden;">
22
- <div class="attachment-media-view landscape">
23
- <div id="woocommerce-product-data" style="height:100%;">
24
- <div class="panel-wrap" style="height:100%;">
25
- <div id="wooccm-modal-tabs">
26
- </div>
27
- <div id="wooccm-modal-panels" style="height: 100%;overflow-x: hidden;">
28
- </div>
29
- </div>
30
- </div>
31
- </div>
32
- <div id="wooccm-modal-info" class="attachment-info">
33
- </div>
34
- </div>
35
- </div>
36
- <div class="media-frame-toolbar" style="left:0;">
37
- <div class="media-toolbar">
38
- <div class="media-toolbar-secondary"></div>
39
- <div class="media-toolbar-primary search-form">
40
- <button type="submit" class="media-modal-submit button button-primary media-button button-large" <# if ( data.id != undefined ) { #>disabled="disabled"<# } #>><?php esc_html_e('Save'); ?></button>
41
- <button type="button" class="media-modal-close button button-secondary media-button button-large" style="
42
- height: auto;
43
- float: none;
44
- position: inherit;
45
- padding: inherit;
46
- "><?php esc_html_e('Close'); ?></button>
47
- </div>
48
- </div>
49
- </div>
50
- </div>
51
- </form>
 
 
52
  </div>
53
- </div>
1
  <div class="media-modal-backdrop">&nbsp;</div>
2
+ <div tabindex="0" id="<?php echo esc_attr( WOOCCM_PREFIX . '_modal' ); ?>" class="media-modal wp-core-ui upload-php processing" role="dialog" aria-modal="true" aria-labelledby="media-frame-title">
3
  <div class="media-modal-content" role="document">
4
+ <form class="media-modal-form" method="POST">
5
+ <# if ( data.id !=undefined ) { #>
6
+ <input type="hidden" name="id" value="{{data.id}}" />
7
+ <input type="hidden" name="order" value="{{data.order}}" />
8
+ <# } #>
9
+ <div class="edit-attachment-frame mode-select hide-menu hide-router">
10
+ <div class="edit-media-header">
11
+ <# if ( data.id !=undefined ) { #>
12
+ <button type="button" class="media-modal-prev left dashicons" <# if ( data.order==1 ) { #>disabled="disabled"<# } #>><span class="screen-reader-text"><?php esc_html_e( 'Edit previous media item' ); ?></span></button>
13
+ <button type="button" class="media-modal-next right dashicons" <# if ( data.order==<?php echo esc_attr( count( $fields ) ); ?> ) { #>disabled="disabled"<# } #>><span class="screen-reader-text"><?php esc_html_e( 'Edit next media item' ); ?></span></button>
14
+ <# } #>
15
+ <button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php esc_html_e( 'Close dialog' ); ?></span></span></button>
16
+ </div>
17
+ <div class="media-frame-title">
18
+ <h1><?php esc_html_e( 'Edit field', 'woocommerce-checkout-manager' ); ?> #<# if ( data.id !=undefined ) { #>{{data.id}}
19
+ <# } else { #><?php echo esc_html_e( 'New', 'woocommerce-checkout-manager' ); ?><# } #>
20
+ </h1>
21
+ </div>
22
+ <div class="media-frame-content" style="bottom:61px;">
23
+ <div class="attachment-details" style="overflow: hidden;">
24
+ <div class="attachment-media-view landscape">
25
+ <div id="woocommerce-product-data" style="height:100%;">
26
+ <div class="panel-wrap" style="height:100%;">
27
+ <div id="wooccm-modal-tabs">
28
+ </div>
29
+ <div id="wooccm-modal-panels" style="height: 100%;overflow-x: hidden;">
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ <div id="wooccm-modal-info" class="attachment-info">
35
+ </div>
36
+ </div>
37
+ </div>
38
+ <div class="media-frame-toolbar" style="left:0;">
39
+ <div class="media-toolbar">
40
+ <div class="media-toolbar-secondary"></div>
41
+ <div class="media-toolbar-primary search-form">
42
+ <button type="submit" class="media-modal-submit button button-primary media-button button-large" <# if ( data.id !=undefined ) { #>disabled="disabled"<# } #>><?php esc_html_e( 'Save' ); ?></button>
43
+ <button type="button" class="media-modal-close button button-secondary media-button button-large" style="
44
+ height: auto;
45
+ float: none;
46
+ position: inherit;
47
+ padding: inherit;
48
+ "><?php esc_html_e( 'Close' ); ?></button>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ </form>
54
  </div>
55
+ </div>
includes/view/backend/pages/modals/parts/panel-admin.php CHANGED
@@ -1,24 +1,24 @@
1
- <# if (!_.contains(<?php echo json_encode($template); ?>, data.type)) { #>
2
- <div class="panel woocommerce_options_panel <# if (data.panel != 'admin') { #>hidden<# } #>">
3
- <div class="options_group wooccm-premium">
4
- <p class="form-field">
5
- <label><?php esc_html_e('Listable', 'woocommerce-checkout-manager'); ?></label>
6
- <input <# if ( data.listable ) { #>checked="checked"<# } #> type="checkbox" name="listable" value="1">
7
- <span class="description hidden"><?php esc_html_e('Display in View Orders screen', 'woocommerce-checkout-manager'); ?></span>
8
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
9
- </p>
10
- <p class="form-field">
11
- <label><?php esc_html_e('Sortable', 'woocommerce-checkout-manager'); ?></label>
12
- <input <# if ( data.sortable ) { #>checked="checked"<# } #> type="checkbox" name="sortable" value="1">
13
- <span class="description hidden"><?php esc_html_e('Allow Sorting on View Orders screen', 'woocommerce-checkout-manager'); ?></span>
14
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
15
- </p>
16
- <p class="form-field">
17
- <label><?php esc_html_e('Filterable', 'woocommerce-checkout-manager'); ?></label>
18
- <input <# if ( data.filterable ) { #>checked="checked"<# } #> type="checkbox" name="filterable" value="1">
19
- <span class="description hidden"><?php esc_html_e('Allow Filtering on View Orders screen', 'woocommerce-checkout-manager'); ?></span>
20
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
21
- </p>
 
22
  </div>
23
- </div>
24
- <# } #>
1
+ <# if (!_.contains(<?php echo json_encode( $template ); ?>, data.type)) { #>
2
+ <div class="panel woocommerce_options_panel <# if (data.panel != 'admin') { #>hidden<# } #>">
3
+ <div class="options_group wooccm-premium">
4
+ <p class="form-field">
5
+ <label><?php esc_html_e( 'Listable', 'woocommerce-checkout-manager' ); ?></label>
6
+ <input <# if ( data.listable ) { #>checked="checked"<# } #> type="checkbox" name="listable" value="1">
7
+ <span class="description hidden"><?php esc_html_e( 'Display in View Orders screen', 'woocommerce-checkout-manager' ); ?></span>
8
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
9
+ </p>
10
+ <p class="form-field">
11
+ <label><?php esc_html_e( 'Sortable', 'woocommerce-checkout-manager' ); ?></label>
12
+ <input <# if ( data.sortable ) { #>checked="checked"<# } #> type="checkbox" name="sortable" value="1">
13
+ <span class="description hidden"><?php esc_html_e( 'Allow Sorting on View Orders screen', 'woocommerce-checkout-manager' ); ?></span>
14
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
15
+ </p>
16
+ <p class="form-field">
17
+ <label><?php esc_html_e( 'Filterable', 'woocommerce-checkout-manager' ); ?></label>
18
+ <input <# if ( data.filterable ) { #>checked="checked"<# } #> type="checkbox" name="filterable" value="1">
19
+ <span class="description hidden"><?php esc_html_e( 'Allow Filtering on View Orders screen', 'woocommerce-checkout-manager' ); ?></span>
20
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
21
+ </p>
22
+ </div>
23
  </div>
24
+ <# } #>
 
includes/view/backend/pages/modals/parts/panel-datepicker.php CHANGED
@@ -1,64 +1,64 @@
1
- <# if (data.type == 'date') { #>
2
- <div class="panel woocommerce_options_panel <# if (data.panel != 'datepicker') { #>hidden<# } #>">
3
- <div class="options_group wooccm-premium">
4
- <p class="form-field">
5
- <label><?php esc_html_e('Enhance', 'woocommerce-checkout-manager'); ?></label>
6
- <input <# if ( data.select2 ) { #>checked="checked"<# } #> class="media-modal-render-panels" type="checkbox" name="select2" value="1">
7
- <span class="description hidden"><?php esc_html_e('Enhance date behaviour with datepicker.', 'woocommerce-checkout-manager'); ?></span>
8
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
9
- </p>
10
- </div>
11
- <div class="options_group wooccm-premium">
12
- <p class="form-field">
13
- <label><?php esc_html_e('Date format', 'woocommerce-checkout-manager'); ?></label>
14
- <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="text" placeholder="dd-mm-yy" name="date_format" value="{{data.date_format}}">
15
- <span class="description"><a target="_blank" href="https://quadlayers.com/documentation/woocommerce-checkout-manager/fields/datepicker/?utm_source=wooccm_admin">Documentation on date and time formatting</a>.</span>
16
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
17
- </p>
18
- </div>
19
- <div class="options_group wooccm-premium">
20
- <p class="form-field">
21
- <label><?php esc_html_e('Date limit', 'woocommerce-checkout-manager'); ?></label>
22
- <select <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="media-modal-render-panels select short" name="date_limit">
23
- <option <# if ( data.date_limit == 'variable' ) { #>selected="selected"<# } #> value="variable"><?php esc_html_e('Since current date', 'woocommerce-checkout-manager'); ?></option>
24
- <option <# if ( data.date_limit == 'fixed' ) { #>selected="selected"<# } #> value="fixed"><?php esc_html_e('Between fixed dates', 'woocommerce-checkout-manager'); ?></option>
25
- </select>
26
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
27
- </p>
28
- </div>
29
- <div class="options_group wooccm-premium">
30
- <p class="form-field">
31
- <label><?php esc_html_e('Days disable', 'woocommerce-checkout-manager'); ?></label>
32
- <select <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="wooccm-enhanced-select" name="date_limit_days[]" data-placeholder="<?php esc_attr_e('Disable week days', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
33
- <?php for ($day_index = 0; $day_index <= 6; $day_index++) : ?>
34
- <option <# if ( _.contains(data.date_limit_days, '<?php echo esc_attr($day_index); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($day_index); ?>"><?php echo $wp_locale->get_weekday($day_index); ?></option>
35
- <?php endfor; ?>
36
- </select>
37
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
38
-