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
- </p>
39
- </div>
40
- <# if ( data.date_limit == 'variable' ) { #>
41
- <div class="options_group wooccm-premium wooccm-enhanced-between-days">
42
- <p class="form-field dimensions_field">
43
- <label><?php esc_html_e('Between days', 'woocommerce-checkout-manager'); ?></label>
44
- <span class="wrap">
45
- <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%" type="number" placeholder="-3" min="-365" max="365" class="short " name="date_limit_variable_min" value="{{data.date_limit_variable_min}}" required>
46
- <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%;margin: 0;" type="number" placeholder="3" min="-365" max="365" class="short" name="date_limit_variable_max" value="{{data.date_limit_variable_max}}" required>
47
- </span>
48
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
49
- </p>
50
- </div>
51
- <# } else { #>
52
- <div class="options_group wooccm-premium wooccm-enhanced-between-dates">
53
- <p class="form-field dimensions_field">
54
- <label><?php esc_html_e('Between dates', 'woocommerce-checkout-manager'); ?></label>
55
- <span class="wrap">
56
- <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%" type="text" class="short " name="date_limit_fixed_min" value="{{data.date_limit_fixed_min}}" placeholder="<?php esc_html_e('From… YYYY-MM-DD', 'woocommerce-checkout-manager'); ?>" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])">
57
- <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%;margin: 0;" type="text" class="short" name="date_limit_fixed_max" value="{{data.date_limit_fixed_max}}" placeholder="<?php esc_html_e('From… YYYY-MM-DD', 'woocommerce-checkout-manager'); ?>" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])">
58
- </span>
59
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
60
- </p>
 
 
61
  </div>
62
  <# } #>
63
- </div>
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
+ </p>
39
+ </div>
40
+ <# if ( data.date_limit=='variable' ) { #>
41
+ <div class="options_group wooccm-premium wooccm-enhanced-between-days">
42
+ <p class="form-field dimensions_field">
43
+ <label><?php esc_html_e( 'Between days', 'woocommerce-checkout-manager' ); ?></label>
44
+ <span class="wrap">
45
+ <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%" type="number" placeholder="-3" min="-365" max="365" class="short " name="date_limit_variable_min" value="{{data.date_limit_variable_min}}" required>
46
+ <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%;margin: 0;" type="number" placeholder="3" min="-365" max="365" class="short" name="date_limit_variable_max" value="{{data.date_limit_variable_max}}" required>
47
+ </span>
48
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
49
+ </p>
50
+ </div>
51
+ <# } else { #>
52
+ <div class="options_group wooccm-premium wooccm-enhanced-between-dates">
53
+ <p class="form-field dimensions_field">
54
+ <label><?php esc_html_e( 'Between dates', 'woocommerce-checkout-manager' ); ?></label>
55
+ <span class="wrap">
56
+ <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%" type="text" class="short " name="date_limit_fixed_min" value="{{data.date_limit_fixed_min}}" placeholder="<?php esc_html_e( 'From… YYYY-MM-DD', 'woocommerce-checkout-manager' ); ?>" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])">
57
+ <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%;margin: 0;" type="text" class="short" name="date_limit_fixed_max" value="{{data.date_limit_fixed_max}}" placeholder="<?php esc_html_e( 'From… YYYY-MM-DD', 'woocommerce-checkout-manager' ); ?>" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])">
58
+ </span>
59
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
60
+ </p>
61
+ </div>
62
+ <# } #>
63
  </div>
64
  <# } #>
 
 
includes/view/backend/pages/modals/parts/panel-display.php CHANGED
@@ -1,34 +1,34 @@
1
  <div class="panel woocommerce_options_panel <# if (data.panel != 'display') { #>hidden<# } #>">
2
  <div class="options_group wooccm-premium">
3
- <p class="form-field">
4
- <label><?php esc_html_e('Hide on account', 'woocommerce-checkout-manager'); ?></label>
5
- <input <# if (data.hide_account) { #>checked="checked"<# } #> type="checkbox" name="hide_account" value="1">
6
- <span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the account page', 'woocommerce-checkout-manager'); ?></span>
7
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
8
- </p>
9
- <p class="form-field">
10
- <label><?php esc_html_e('Hide on checkout', 'woocommerce-checkout-manager'); ?></label>
11
- <input <# if (data.hide_checkout) { #>checked="checked"<# } #> type="checkbox" name="hide_checkout" value="1">
12
- <span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the checkout page', 'woocommerce-checkout-manager'); ?></span>
13
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
14
- </p>
15
- <p class="form-field">
16
- <label><?php esc_html_e('Hide on orders', 'woocommerce-checkout-manager'); ?></label>
17
- <input <# if (data.hide_order) { #>checked="checked"<# } #> type="checkbox" name="hide_order" value="1">
18
- <span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the user order', 'woocommerce-checkout-manager'); ?></span>
19
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
20
- </p>
21
- <p class="form-field">
22
- <label><?php esc_html_e('Hide on emails', 'woocommerce-checkout-manager'); ?></label>
23
- <input <# if (data.hide_email) { #>checked="checked"<# } #> type="checkbox" name="hide_email" value="1">
24
- <span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the user email', 'woocommerce-checkout-manager'); ?></span>
25
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
26
- </p>
27
- <p class="form-field">
28
- <label><?php esc_html_e('Hide on invoices', 'woocommerce-checkout-manager'); ?></label>
29
- <input <# if (data.hide_invoice) { #>checked="checked"<# } #> type="checkbox" name="hide_invoice" value="1">
30
- <span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the order invoice', 'woocommerce-checkout-manager'); ?></span>
31
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
32
- </p>
33
  </div>
34
- </div>
1
  <div class="panel woocommerce_options_panel <# if (data.panel != 'display') { #>hidden<# } #>">
2
  <div class="options_group wooccm-premium">
3
+ <p class="form-field">
4
+ <label><?php esc_html_e( 'Hide on account', 'woocommerce-checkout-manager' ); ?></label>
5
+ <input <# if (data.hide_account) { #>checked="checked"<# } #> type="checkbox" name="hide_account" value="1">
6
+ <span class="description hidden" style="display: inline-block"><?php esc_html_e( 'Hide this field on the account page', 'woocommerce-checkout-manager' ); ?></span>
7
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
8
+ </p>
9
+ <p class="form-field">
10
+ <label><?php esc_html_e( 'Hide on checkout', 'woocommerce-checkout-manager' ); ?></label>
11
+ <input <# if (data.hide_checkout) { #>checked="checked"<# } #> type="checkbox" name="hide_checkout" value="1">
12
+ <span class="description hidden" style="display: inline-block"><?php esc_html_e( 'Hide this field on the checkout page', 'woocommerce-checkout-manager' ); ?></span>
13
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
14
+ </p>
15
+ <p class="form-field">
16
+ <label><?php esc_html_e( 'Hide on orders', 'woocommerce-checkout-manager' ); ?></label>
17
+ <input <# if (data.hide_order) { #>checked="checked"<# } #> type="checkbox" name="hide_order" value="1">
18
+ <span class="description hidden" style="display: inline-block"><?php esc_html_e( 'Hide this field on the user order', 'woocommerce-checkout-manager' ); ?></span>
19
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
20
+ </p>
21
+ <p class="form-field">
22
+ <label><?php esc_html_e( 'Hide on emails', 'woocommerce-checkout-manager' ); ?></label>
23
+ <input <# if (data.hide_email) { #>checked="checked"<# } #> type="checkbox" name="hide_email" value="1">
24
+ <span class="description hidden" style="display: inline-block"><?php esc_html_e( 'Hide this field on the user email', 'woocommerce-checkout-manager' ); ?></span>
25
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
26
+ </p>
27
+ <p class="form-field">
28
+ <label><?php esc_html_e( 'Hide on invoices', 'woocommerce-checkout-manager' ); ?></label>
29
+ <input <# if (data.hide_invoice) { #>checked="checked"<# } #> type="checkbox" name="hide_invoice" value="1">
30
+ <span class="description hidden" style="display: inline-block"><?php esc_html_e( 'Hide this field on the order invoice', 'woocommerce-checkout-manager' ); ?></span>
31
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
32
+ </p>
33
  </div>
34
+ </div>
includes/view/backend/pages/modals/parts/panel-filter.php CHANGED
@@ -1,80 +1,80 @@
1
  <div class="panel woocommerce_options_panel <# if (data.panel != 'filter') { #>hidden<# } #>">
2
  <div class="options_group wooccm-premium wooccm-enhanced-between-days">
3
- <p class="form-field dimensions_field">
4
- <label><?php esc_html_e('Cart subtotal', 'woocommerce-checkout-manager'); ?></label>
5
- <span class="wrap">
6
- <input style="width:48.1%" type="number" pattern="[0-9]+([\.,][0-9]+)?" step="0.01" placeholder="<?php esc_attr_e('minimun', 'woocommerce-checkout-manager'); ?>" min="0" class="short " name="show_cart_minimum" value="{{data.show_cart_minimum}}">
7
- <input style="width:48.1%;margin: 0;" pattern="[0-9]+([\.,][0-9]+)?" step="0.01" type="number" placeholder="<?php esc_attr_e('maximun', 'woocommerce-checkout-manager'); ?>" min="0" class="short" name="show_cart_maximun" value="{{data.show_cart_maximun}}">
8
- </span>
9
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
10
- </p>
11
  </div>
12
  <div class="options_group">
13
- <p class="form-field">
14
- <label><?php esc_html_e('Show for roles', 'woocommerce-checkout-manager'); ?></label>
15
- <select class="wooccm-enhanced-select" name="show_role[]" data-placeholder="<?php esc_attr_e('Filter by roles', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
16
- <?php foreach ($wp_roles->roles as $key => $value): ?>
17
- <option <# if ( _.contains(data.show_role, '<?php echo esc_attr($key); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($key); ?>"><?php echo esc_html($value['name']); ?></option>
18
- <?php endforeach; ?>
19
- </select>
20
- </p>
21
- <p class="form-field">
22
- <label><?php esc_html_e('Hide for roles', 'woocommerce-checkout-manager'); ?></label>
23
- <select class="wooccm-enhanced-select" name="hide_role[]" data-placeholder="<?php esc_attr_e('Filter by roles', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
24
- <?php foreach ($wp_roles->roles as $key => $value): ?>
25
- <option <# if ( _.contains(data.hide_role, '<?php echo esc_attr($key); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($key); ?>"><?php echo esc_html($value['name']); ?></option>
26
- <?php endforeach; ?>
27
- </select>
28
- </p>
29
  </div>
30
 
31
  <div class="options_group">
32
- <p class="form-field">
33
- <label><?php esc_html_e('More', 'woocommerce-checkout-manager'); ?></label>
34
- <input <# if (data.more_product) { #>checked="checked"<# } #> type="checkbox" name="more_product" value="1">
35
- <span class="description"><?php esc_html_e('Apply conditions event it there is more than one product', 'woocommerce-checkout-manager'); ?></span>
36
- </p>
37
  </div>
38
 
39
  <div class="options_group">
40
- <p class="form-field">
41
- <label><?php esc_html_e('Show for products', 'woocommerce-checkout-manager'); ?></label>
42
- <select class="wooccm-product-search" name="show_product[]" data-placeholder="<?php esc_attr_e('Filter by product', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.show_product}}" data-allow_clear="true" multiple="multiple">
43
- <# _.each(data.show_product_selected, function(title, id){ #>
44
- <option value="{{id}}" selected="selected">{{title}}</option>
45
- <# }); #>
46
- </select>
47
- </p>
48
- <p class="form-field">
49
- <label><?php esc_html_e('Hide for products', 'woocommerce-checkout-manager'); ?></label>
50
- <select class="wooccm-product-search" name="hide_product[]" data-placeholder="<?php esc_attr_e('Filter by product', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.hide_product}}" data-allow_clear="true" multiple="multiple">
51
- <# _.each(data.hide_product_selected, function(title, id){ #>
52
- <option value="{{id}}" selected="selected">{{title}}</option>
53
- <# }); #>
54
- </select>
55
- </p>
56
  </div>
57
 
58
  <div class="options_group">
59
- <p class="form-field">
60
- <label><?php esc_html_e('Show for category', 'woocommerce-checkout-manager'); ?></label>
61
- <select class="wooccm-enhanced-select" name="show_product_cat[]" data-placeholder="<?php esc_attr_e('Filter by categories', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.show_product_cat}}" data-allow_clear="true" multiple="multiple">
62
- <?php if ($product_categories) : ?>
63
- <?php foreach ($product_categories as $category): ?>
64
- <option <# if ( _.contains(data.show_product_cat, '<?php echo esc_attr($category->term_id); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($category->term_id); ?>"><?php echo esc_html($category->name); ?></option>
65
- <?php endforeach; ?>
66
- <?php endif; ?>
67
- </select>
68
- </p>
69
- <p class="form-field">
70
- <label><?php esc_html_e('Hide for category', 'woocommerce-checkout-manager'); ?></label>
71
- <select class="wooccm-enhanced-select" name="hide_product_cat[]" data-placeholder="<?php esc_attr_e('Filter by categories', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.hide_product_cat}}" data-allow_clear="true" multiple="multiple">
72
- <?php if ($product_categories) : ?>
73
- <?php foreach ($product_categories as $category): ?>
74
- <option <# if ( _.contains(data.hide_product_cat, '<?php echo esc_attr($category->term_id); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($category->term_id); ?>"><?php echo esc_html($category->name); ?></option>
75
- <?php endforeach; ?>
76
- <?php endif; ?>
77
- </select>
78
- </p>
79
  </div>
80
- </div>
1
  <div class="panel woocommerce_options_panel <# if (data.panel != 'filter') { #>hidden<# } #>">
2
  <div class="options_group wooccm-premium wooccm-enhanced-between-days">
3
+ <p class="form-field dimensions_field">
4
+ <label><?php esc_html_e( 'Cart subtotal', 'woocommerce-checkout-manager' ); ?></label>
5
+ <span class="wrap">
6
+ <input style="width:48.1%" type="number" pattern="[0-9]+([\.,][0-9]+)?" step="0.01" placeholder="<?php esc_attr_e( 'minimun', 'woocommerce-checkout-manager' ); ?>" min="0" class="short " name="show_cart_minimum" value="{{data.show_cart_minimum}}">
7
+ <input style="width:48.1%;margin: 0;" pattern="[0-9]+([\.,][0-9]+)?" step="0.01" type="number" placeholder="<?php esc_attr_e( 'maximun', 'woocommerce-checkout-manager' ); ?>" min="0" class="short" name="show_cart_maximun" value="{{data.show_cart_maximun}}">
8
+ </span>
9
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
10
+ </p>
11
  </div>
12
  <div class="options_group">
13
+ <p class="form-field">
14
+ <label><?php esc_html_e( 'Show for roles', 'woocommerce-checkout-manager' ); ?></label>
15
+ <select class="wooccm-enhanced-select" name="show_role[]" data-placeholder="<?php esc_attr_e( 'Filter by roles', 'woocommerce-checkout-manager' ); ?>" data-allow_clear="true" multiple="multiple">
16
+ <?php foreach ( $wp_roles->roles as $key => $value ) : ?>
17
+ <option <# if ( _.contains(data.show_role, '<?php echo esc_attr( $key ); ?>' ) ) { #>selected="selected"<# } #> value="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $value['name'] ); ?></option>
18
+ <?php endforeach; ?>
19
+ </select>
20
+ </p>
21
+ <p class="form-field">
22
+ <label><?php esc_html_e( 'Hide for roles', 'woocommerce-checkout-manager' ); ?></label>
23
+ <select class="wooccm-enhanced-select" name="hide_role[]" data-placeholder="<?php esc_attr_e( 'Filter by roles', 'woocommerce-checkout-manager' ); ?>" data-allow_clear="true" multiple="multiple">
24
+ <?php foreach ( $wp_roles->roles as $key => $value ) : ?>
25
+ <option <# if ( _.contains(data.hide_role, '<?php echo esc_attr( $key ); ?>' ) ) { #>selected="selected"<# } #> value="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $value['name'] ); ?></option>
26
+ <?php endforeach; ?>
27
+ </select>
28
+ </p>
29
  </div>
30
 
31
  <div class="options_group">
32
+ <p class="form-field">
33
+ <label><?php esc_html_e( 'More', 'woocommerce-checkout-manager' ); ?></label>
34
+ <input <# if (data.more_product) { #>checked="checked"<# } #> type="checkbox" name="more_product" value="1">
35
+ <span class="description"><?php esc_html_e( 'Apply conditions event it there is more than one product', 'woocommerce-checkout-manager' ); ?></span>
36
+ </p>
37
  </div>
38
 
39
  <div class="options_group">
40
+ <p class="form-field">
41
+ <label><?php esc_html_e( 'Show for products', 'woocommerce-checkout-manager' ); ?></label>
42
+ <select class="wooccm-product-search" name="show_product[]" data-placeholder="<?php esc_attr_e( 'Filter by product', 'woocommerce-checkout-manager' ); ?>" data-selected="{{data.show_product}}" data-allow_clear="true" multiple="multiple">
43
+ <# _.each(data.show_product_selected, function(title, id){ #>
44
+ <option value="{{id}}" selected="selected">{{title}}</option>
45
+ <# }); #>
46
+ </select>
47
+ </p>
48
+ <p class="form-field">
49
+ <label><?php esc_html_e( 'Hide for products', 'woocommerce-checkout-manager' ); ?></label>
50
+ <select class="wooccm-product-search" name="hide_product[]" data-placeholder="<?php esc_attr_e( 'Filter by product', 'woocommerce-checkout-manager' ); ?>" data-selected="{{data.hide_product}}" data-allow_clear="true" multiple="multiple">
51
+ <# _.each(data.hide_product_selected, function(title, id){ #>
52
+ <option value="{{id}}" selected="selected">{{title}}</option>
53
+ <# }); #>
54
+ </select>
55
+ </p>
56
  </div>
57
 
58
  <div class="options_group">
59
+ <p class="form-field">
60
+ <label><?php esc_html_e( 'Show for category', 'woocommerce-checkout-manager' ); ?></label>
61
+ <select class="wooccm-enhanced-select" name="show_product_cat[]" data-placeholder="<?php esc_attr_e( 'Filter by categories', 'woocommerce-checkout-manager' ); ?>" data-selected="{{data.show_product_cat}}" data-allow_clear="true" multiple="multiple">
62
+ <?php if ( $product_categories ) : ?>
63
+ <?php foreach ( $product_categories as $category ) : ?>
64
+ <option <# if ( _.contains(data.show_product_cat, '<?php echo esc_attr( $category->term_id ); ?>' ) ) { #>selected="selected"<# } #> value="<?php echo esc_attr( $category->term_id ); ?>"><?php echo esc_html( $category->name ); ?></option>
65
+ <?php endforeach; ?>
66
+ <?php endif; ?>
67
+ </select>
68
+ </p>
69
+ <p class="form-field">
70
+ <label><?php esc_html_e( 'Hide for category', 'woocommerce-checkout-manager' ); ?></label>
71
+ <select class="wooccm-enhanced-select" name="hide_product_cat[]" data-placeholder="<?php esc_attr_e( 'Filter by categories', 'woocommerce-checkout-manager' ); ?>" data-selected="{{data.hide_product_cat}}" data-allow_clear="true" multiple="multiple">
72
+ <?php if ( $product_categories ) : ?>
73
+ <?php foreach ( $product_categories as $category ) : ?>
74
+ <option <# if ( _.contains(data.hide_product_cat, '<?php echo esc_attr( $category->term_id ); ?>' ) ) { #>selected="selected"<# } #> value="<?php echo esc_attr( $category->term_id ); ?>"><?php echo esc_html( $category->name ); ?></option>
75
+ <?php endforeach; ?>
76
+ <?php endif; ?>
77
+ </select>
78
+ </p>
79
  </div>
80
+ </div>
includes/view/backend/pages/modals/parts/panel-general.php CHANGED
@@ -1,192 +1,197 @@
1
  <div class="panel woocommerce_options_panel <# if (data.panel != 'general') { #>hidden<# } #>">
2
- <div class="options_group">
3
- <p class="form-field">
4
- <label><?php esc_html_e('Name', 'woocommerce-checkout-manager'); ?></label>
5
- <# if ( _.contains(<?php echo json_encode($defaults); ?>, data.name)) { #>
6
- <span class="woocommerce-help-tip" data-tip="<?php esc_html_e('You can\'t change the slug of default fields.', 'woocommerce-checkout-manager'); ?>"></span>
7
- <input class="short" type="text" name="name" placeholder="<?php esc_html_e('myfield', 'woocommerce-checkout-manager'); ?>" value="{{data.name}}" readonly="readonly">
8
- <# } else { #>
9
- <span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Currently is not possible to change the name of the fields.', 'woocommerce-checkout-manager'); ?><?php //esc_html_e('To edit Abbreviations open General > Switches > Editing Of Abbreviation Fields.', 'woocommerce-checkout-manager'); ?>"></span>
10
- <input class="short" type="text" name="name" placeholder="<?php esc_html_e('myfield', 'woocommerce-checkout-manager'); ?>" value="{{data.name}}" readonly="readonly" <?php /* if (empty($options['checkness']['abbreviation'])) { ?>readonly="readonly"<?php } */ ?>>
11
- <# } #>
12
- </p>
13
- </div>
14
- <div class="options_group">
15
- <p class="form-field">
16
- <label><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></label>
17
- <# if ( _.contains(<?php echo json_encode($defaults); ?>, data.name)) { #>
18
- <input class="short" type="text" name="type" value="{{data.type}}" readonly="readonly">
19
- <# } else { #>
20
- <select class="media-modal-render-tabs wooccm-enhanced-select" name="type">
21
- <?php if ($types): ?>
22
- <?php foreach ($types as $type => $name) : ?>
23
- <option <# if ( data.type == '<?php echo esc_attr($type); ?>' ) { #>selected="selected"<# } #> <# if ( _.contains(<?php echo json_encode($disabled); ?>, '<?php echo esc_attr($type); ?>' )) { #>disabled="disabled"<# } #> value="<?php echo esc_attr($type); ?>"><?php echo esc_html($name); ?></option>
24
- <?php endforeach; ?>
25
- <?php endif; ?>
26
- </select>
27
- <# } #>
28
- <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Type of the checkout field.', 'woocommerce-checkout-manager'); ?>"></span>
29
- </p>
30
- <# if (data.type == 'colorpicker') { #>
31
- <p class="form-field">
32
- <label><?php esc_html_e('Picker Type', 'woocommerce-checkout-manager'); ?></label>
33
- <select class="select short" name="pickertype">
34
- <option <# if ( data.pickertype == 'farbtastic' ) { #>selected="selected"<# } #> value="farbtastic"><?php esc_html_e('Farbtastic', 'woocommerce-checkout-manager'); ?></option>
35
- <option <# if ( data.pickertype == 'iris' ) { #>selected="selected"<# } #> value="iris"><?php esc_html_e('Iris', 'woocommerce-checkout-manager'); ?></option>
36
- </select>
37
- </p>
38
- <# } #>
39
- </div>
40
  <div class="options_group">
41
- <p class="form-field">
42
- <label><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></label>
43
- <input class="short "type="text" name="label" placeholder="<?php esc_html_e('My Field Name', 'woocommerce-checkout-manager'); ?>" value="{{data.label}}">
44
- <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Label text of the checkout field.', 'woocommerce-checkout-manager'); ?>"></span>
45
- </p>
46
- <# if ( !_.contains(<?php echo json_encode($template); ?>, data.type )) { #>
47
- <p class="form-field">
48
- <label><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></label>
49
- <input class="short" type="text" name="placeholder" placeholder="<?php esc_html_e('This is a placeholder', 'woocommerce-checkout-manager'); ?>" value="{{data.placeholder}}">
50
- <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Placeholder text of the checkout field.', 'woocommerce-checkout-manager'); ?>"></span>
51
- </p>
52
- <# } #>
53
- <# if ( data.type == 'file' ) { #>
54
- <p class="form-field">
55
- <label><?php esc_html_e('Button', 'woocommerce-checkout-manager'); ?></label>
56
- <input class="short" type="text" name="placeholder" placeholder="<?php esc_html_e('Upload your files', 'woocommerce-checkout-manager'); ?>" value="{{data.placeholder}}">
57
- <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Text for the button name.', 'woocommerce-checkout-manager'); ?>"></span>
58
- </p>
59
- <# } #>
60
  </div>
61
- <# if ( !_.contains(<?php echo json_encode($template); ?>, data.type )) { #>
62
  <div class="options_group">
63
- <p class="form-field">
64
- <label><?php esc_html_e('Description', 'woocommerce-checkout-manager'); ?></label>
65
- <textarea class="short" type="text" name="description" placeholder="<?php esc_html_e('Description of the checkout field', 'woocommerce-checkout-manager'); ?>">{{data.description}}</textarea>
66
- <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Placeholder text of the checkout field.', 'woocommerce-checkout-manager'); ?>"></span>
67
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  </div>
69
- <# } #>
70
- <# if ( data.type == 'message') { #>
71
  <div class="options_group">
72
- <p class="form-field">
73
- <label><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></label>
74
- <select class="wooccm-enhanced-select" name="message_type">
75
- <option <# if ( 'info' == data.message_type ) { #>selected="selected"<# } #> value="info"><?php esc_html_e('Info', 'woocommerce-checkout-manager'); ?></option>
76
- <option <# if ( 'message' == data.message_type ) { #>selected="selected"<# } #> value="message"><?php esc_html_e('Success', 'woocommerce-checkout-manager'); ?></option>
77
- <option <# if ( 'error' == data.message_type ) { #>selected="selected"<# } #> value="error"><?php esc_html_e('Error', 'woocommerce-checkout-manager'); ?></option>
78
- </select>
79
- <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Message alert type.', 'woocommerce-checkout-manager'); ?>"></span>
80
- </p>
81
- <p class="form-field">
82
- <label><?php esc_html_e('Message', 'woocommerce-checkout-manager'); ?></label>
83
- <textarea class="short" name="description" placeholder="<?php esc_html_e('Message content', 'woocommerce-checkout-manager'); ?>">{{data.description}}</textarea>
84
- <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Message content.', 'woocommerce-checkout-manager'); ?>"></span>
85
- </p>
 
 
 
 
 
86
  </div>
87
- <# } #>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
 
89
- <# if ( data.type == 'button') { #>
90
- <div class="options_group">
91
- <p class="form-field">
92
- <label><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></label>
93
- <select class="wooccm-enhanced-select" name="button_type">
94
- <option <# if ( '' == data.button_type ) { #>selected="selected"<# } #> value=""><?php esc_html_e('Default', 'woocommerce-checkout-manager'); ?></option>
95
- <option <# if ( 'alt' == data.button_type ) { #>selected="selected"<# } #> value="alt"><?php esc_html_e('Alt', 'woocommerce-checkout-manager'); ?></option>
96
- </select>
97
- <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Message alert type.', 'woocommerce-checkout-manager'); ?>"></span>
98
- </p>
99
- <p class="form-field">
100
- <label><?php esc_html_e('Link', 'woocommerce-checkout-manager'); ?></label>
101
- <input class="short" type="text" name="button_link" placeholder="<?php esc_html_e('URL', 'woocommerce-checkout-manager'); ?>" value="{{data.button_link}}"/>
102
- <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Button URL.', 'woocommerce-checkout-manager'); ?>"></span>
103
- </p>
104
- </div>
105
- <# } #>
106
 
107
- <# if ( !_.contains(<?php echo json_encode(array_merge($template, $option)); ?>, data.type)) { #>
108
- <div class="options_group">
109
- <p class="form-field">
110
- <label><?php esc_html_e('Default', 'woocommerce-checkout-manager'); ?></label>
111
- <# if (data.type == 'checkbox') { #>
112
- <select class="wooccm-enhanced-select" name="default">
113
- <option <# if ( 1 == data.default ) { #>selected="selected"<# } #> value="1"><?php esc_html_e('Yes'); ?></option>
114
- <option <# if ( 0 == data.default ) { #>selected="selected"<# } #> value="0"><?php esc_html_e('No'); ?></option>
115
- </select>
116
- <# } else if (data.type == 'number') { #>
117
- <input class="short" type="number" name="default" placeholder="<?php esc_html_e('Enter a default value (optional)', 'woocommerce-checkout-manager'); ?>" value="{{data.default}}">
118
- <# } else { #>
119
- <input class="short" type="text" name="default" placeholder="<?php esc_html_e('Enter a default value (optional)', 'woocommerce-checkout-manager'); ?>" value="{{data.default}}">
120
- <# } #>
121
- <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Default value of the checkout field.', 'woocommerce-checkout-manager'); ?>"></span>
122
- </p>
123
- </div>
124
- <# } #>
125
 
126
- <# if ( data.type == 'number') { #>
127
- <p class="form-field dimensions_field">
128
- <label><?php esc_html_e('Number', 'woocommerce-checkout-manager'); ?></label>
129
- <span class="wrap">
130
- <input style="width:48.1%" type="number" pattern="[0-9]+([\.,][0-9]+)?" step="0.01" placeholder="<?php esc_attr_e('minimun', 'woocommerce-checkout-manager'); ?>" class="short" name="min" value="{{data.min}}">
131
- <input style="width:48.1%;margin: 0;" pattern="[0-9]+([\.,][0-9]+)?" step="0.01" type="number" placeholder="<?php esc_attr_e('maximun', 'woocommerce-checkout-manager'); ?>" class="short" name="max" value="{{data.max}}">
132
- </span>
133
- </p>
134
- <# } #>
135
 
136
- <# if ( data.type == 'text' || data.type == 'textarea') { #>
137
- <p class="form-field dimensions_field">
138
- <label><?php esc_html_e('Maxlength', 'woocommerce-checkout-manager'); ?></label>
139
- <input class="short" type="text" name="maxlength" placeholder="<?php esc_html_e('Enter a maxlength value (optional)', 'woocommerce-checkout-manager'); ?>" value="{{data.maxlength}}">
140
- </p>
141
- <# } #>
142
 
143
- <# if (data.type == 'file') { #>
144
- <!--<div class="options_group">
145
- <p class="form-field">
146
- <label><?php esc_html_e('Upload files', 'woocommerce-checkout-manager'); ?></label>
147
- <input class="short" type="number" placeholder="1" min="0" max="12" name="file_limit" value="{{data.file_limit}}">
148
- </p>
149
- <p class="form-field">
150
- <select class="wooccm-enhanced-select" name="file_types" multiple="multiple" data-placeholder="<?php esc_attr_e('Choose the allowed types&hellip;', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" >
151
- <?php foreach (wp_get_mime_types() as $type => $name) : ?>
152
- <option <# if ( _.contains(data.file_types, '<?php echo esc_attr($type); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($type); ?>"><?php echo esc_html($type); ?></option>
153
  <?php endforeach; ?>
154
- </select>
155
- </p>
156
  </div>-->
157
- <# } #>
158
 
159
- <# if (data.type == 'country') { #>
160
- <div class="options_group">
161
- <p class="form-field">
162
- <label><?php esc_html_e('Default', 'woocommerce-checkout-manager'); ?></label>
163
- <select class="wooccm-enhanced-select" name="default" data-placeholder="<?php esc_attr_e('Preserve default country&hellip;', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true">
164
- <option <# if (data.default == '') { #>selected="selected"<# } #> value=""></option>
165
- <?php foreach (WC()->countries->get_countries() as $id => $name) : ?>
166
- <option <# if (data.default == '<?php echo esc_attr($id); ?>') { #>selected="selected"<# } #> value="<?php echo esc_attr($id); ?>"><?php echo esc_html($name); ?></option>
167
- <?php endforeach; ?>
168
- </select>
169
- </p>
170
- </div>
171
- <# } #>
172
 
173
- <# if (data.type == 'state') { #>
174
- <div class="options_group">
175
- <p class="form-field">
176
- <label><?php esc_html_e('Country', 'woocommerce-checkout-manager'); ?></label>
177
- <select class="wooccm-enhanced-select" name="country" data-placeholder="<?php esc_attr_e('Select country&hellip;', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" >
178
- <?php foreach (WC()->countries->get_countries() as $id => $name) : ?>
179
- <option <# if (data.country == '<?php echo esc_attr($id); ?>') { #>selected="selected"<# } #> value="<?php echo esc_attr($id); ?>"><?php echo esc_html($name); ?></option>
180
- <?php endforeach; ?>
181
- </select>
182
- </p>
183
- </div>
184
- <# } #>
185
 
186
- <div class="options_group">
187
- <p class="form-field">
188
- <label><?php esc_html_e('Extra class', 'woocommerce-checkout-manager'); ?></label>
189
- <input class="short" type="text" name="extra_class" value="{{data.extra_class}}">
190
- </p>
191
- </div>
192
- </div>
1
  <div class="panel woocommerce_options_panel <# if (data.panel != 'general') { #>hidden<# } #>">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <div class="options_group">
3
+ <p class="form-field">
4
+ <label><?php esc_html_e( 'Name', 'woocommerce-checkout-manager' ); ?></label>
5
+ <# if ( _.contains(<?php echo json_encode( $defaults ); ?>, data.name)) { #>
6
+ <span class="woocommerce-help-tip" data-tip="<?php esc_html_e( 'You can\'t change the slug of default fields.', 'woocommerce-checkout-manager' ); ?>"></span>
7
+ <input class="short" type="text" name="name" placeholder="<?php esc_html_e( 'myfield', 'woocommerce-checkout-manager' ); ?>" value="{{data.name}}" readonly="readonly">
8
+ <# } else { #>
9
+ <span class="woocommerce-help-tip" data-tip="<?php esc_html_e( 'Currently is not possible to change the name of the fields.', 'woocommerce-checkout-manager' ); ?>
10
+ <?php
11
+ // esc_html_e('To edit Abbreviations open General > Switches > Editing Of Abbreviation Fields.', 'woocommerce-checkout-manager');
12
+ ?>
13
+ "></span>
14
+ <input class="short" type="text" name="name" placeholder="<?php esc_html_e( 'myfield', 'woocommerce-checkout-manager' ); ?>" value="{{data.name}}" readonly="readonly" <?php /* if (empty($options['checkness']['abbreviation'])) { ?>readonly="readonly"<?php } */ ?>>
15
+ <# } #>
16
+ </p>
 
 
 
 
 
17
  </div>
 
18
  <div class="options_group">
19
+ <p class="form-field">
20
+ <label><?php esc_html_e( 'Type', 'woocommerce-checkout-manager' ); ?></label>
21
+ <# if ( _.contains(<?php echo json_encode( $defaults ); ?>, data.name)) { #>
22
+ <input class="short" type="text" name="type" value="{{data.type}}" readonly="readonly">
23
+ <# } else { #>
24
+ <select class="media-modal-render-tabs wooccm-enhanced-select" name="type">
25
+ <?php if ( $types ) : ?>
26
+ <?php foreach ( $types as $type => $name ) : ?>
27
+ <option <# if ( data.type=='<?php echo esc_attr( $type ); ?>' ) { #>selected="selected"<# } #>
28
+ <# if ( _.contains(<?php echo json_encode( $disabled ); ?>, '<?php echo esc_attr( $type ); ?>' )) { #>disabled="disabled"<# } #> value="<?php echo esc_attr( $type ); ?>"><?php echo esc_html( $name ); ?></option>
29
+ <?php endforeach; ?>
30
+ <?php endif; ?>
31
+ </select>
32
+ <# } #>
33
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e( 'Type of the checkout field.', 'woocommerce-checkout-manager' ); ?>"></span>
34
+ </p>
35
+ <# if (data.type=='colorpicker' ) { #>
36
+ <p class="form-field">
37
+ <label><?php esc_html_e( 'Picker Type', 'woocommerce-checkout-manager' ); ?></label>
38
+ <select class="select short" name="pickertype">
39
+ <option <# if ( data.pickertype=='farbtastic' ) { #>selected="selected"<# } #> value="farbtastic"><?php esc_html_e( 'Farbtastic', 'woocommerce-checkout-manager' ); ?></option>
40
+ <option <# if ( data.pickertype=='iris' ) { #>selected="selected"<# } #> value="iris"><?php esc_html_e( 'Iris', 'woocommerce-checkout-manager' ); ?></option>
41
+ </select>
42
+ </p>
43
+ <# } #>
44
  </div>
 
 
45
  <div class="options_group">
46
+ <p class="form-field">
47
+ <label><?php esc_html_e( 'Label', 'woocommerce-checkout-manager' ); ?></label>
48
+ <input class="short " type="text" name="label" placeholder="<?php esc_html_e( 'My Field Name', 'woocommerce-checkout-manager' ); ?>" value="{{data.label}}">
49
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e( 'Label text of the checkout field.', 'woocommerce-checkout-manager' ); ?>"></span>
50
+ </p>
51
+ <# if ( !_.contains(<?php echo json_encode( $template ); ?>, data.type )) { #>
52
+ <p class="form-field">
53
+ <label><?php esc_html_e( 'Placeholder', 'woocommerce-checkout-manager' ); ?></label>
54
+ <input class="short" type="text" name="placeholder" placeholder="<?php esc_html_e( 'This is a placeholder', 'woocommerce-checkout-manager' ); ?>" value="{{data.placeholder}}">
55
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e( 'Placeholder text of the checkout field.', 'woocommerce-checkout-manager' ); ?>"></span>
56
+ </p>
57
+ <# } #>
58
+ <# if ( data.type=='file' ) { #>
59
+ <p class="form-field">
60
+ <label><?php esc_html_e( 'Button', 'woocommerce-checkout-manager' ); ?></label>
61
+ <input class="short" type="text" name="placeholder" placeholder="<?php esc_html_e( 'Upload your files', 'woocommerce-checkout-manager' ); ?>" value="{{data.placeholder}}">
62
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e( 'Text for the button name.', 'woocommerce-checkout-manager' ); ?>"></span>
63
+ </p>
64
+ <# } #>
65
  </div>
66
+ <# if ( !_.contains(<?php echo json_encode( $template ); ?>, data.type )) { #>
67
+ <div class="options_group">
68
+ <p class="form-field">
69
+ <label><?php esc_html_e( 'Description', 'woocommerce-checkout-manager' ); ?></label>
70
+ <textarea class="short" type="text" name="description" placeholder="<?php esc_html_e( 'Description of the checkout field', 'woocommerce-checkout-manager' ); ?>">{{data.description}}</textarea>
71
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e( 'Placeholder text of the checkout field.', 'woocommerce-checkout-manager' ); ?>"></span>
72
+ </p>
73
+ </div>
74
+ <# } #>
75
+ <# if ( data.type=='message' ) { #>
76
+ <div class="options_group">
77
+ <p class="form-field">
78
+ <label><?php esc_html_e( 'Type', 'woocommerce-checkout-manager' ); ?></label>
79
+ <select class="wooccm-enhanced-select" name="message_type">
80
+ <option <# if ( 'info'==data.message_type ) { #>selected="selected"<# } #> value="info"><?php esc_html_e( 'Info', 'woocommerce-checkout-manager' ); ?></option>
81
+ <option <# if ( 'message'==data.message_type ) { #>selected="selected"<# } #> value="message"><?php esc_html_e( 'Success', 'woocommerce-checkout-manager' ); ?></option>
82
+ <option <# if ( 'error'==data.message_type ) { #>selected="selected"<# } #> value="error"><?php esc_html_e( 'Error', 'woocommerce-checkout-manager' ); ?></option>
83
+ </select>
84
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e( 'Message alert type.', 'woocommerce-checkout-manager' ); ?>"></span>
85
+ </p>
86
+ <p class="form-field">
87
+ <label><?php esc_html_e( 'Message', 'woocommerce-checkout-manager' ); ?></label>
88
+ <textarea class="short" name="description" placeholder="<?php esc_html_e( 'Message content', 'woocommerce-checkout-manager' ); ?>">{{data.description}}</textarea>
89
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e( 'Message content.', 'woocommerce-checkout-manager' ); ?>"></span>
90
+ </p>
91
+ </div>
92
+ <# } #>
93
 
94
+ <# if ( data.type=='button' ) { #>
95
+ <div class="options_group">
96
+ <p class="form-field">
97
+ <label><?php esc_html_e( 'Type', 'woocommerce-checkout-manager' ); ?></label>
98
+ <select class="wooccm-enhanced-select" name="button_type">
99
+ <option <# if ( ''==data.button_type ) { #>selected="selected"<# } #> value=""><?php esc_html_e( 'Default', 'woocommerce-checkout-manager' ); ?></option>
100
+ <option <# if ( 'alt'==data.button_type ) { #>selected="selected"<# } #> value="alt"><?php esc_html_e( 'Alt', 'woocommerce-checkout-manager' ); ?></option>
101
+ </select>
102
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e( 'Message alert type.', 'woocommerce-checkout-manager' ); ?>"></span>
103
+ </p>
104
+ <p class="form-field">
105
+ <label><?php esc_html_e( 'Link', 'woocommerce-checkout-manager' ); ?></label>
106
+ <input class="short" type="text" name="button_link" placeholder="<?php esc_html_e( 'URL', 'woocommerce-checkout-manager' ); ?>" value="{{data.button_link}}" />
107
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e( 'Button URL.', 'woocommerce-checkout-manager' ); ?>"></span>
108
+ </p>
109
+ </div>
110
+ <# } #>
111
 
112
+ <# if ( !_.contains(<?php echo json_encode( array_merge( $template, $option ) ); ?>, data.type)) { #>
113
+ <div class="options_group">
114
+ <p class="form-field">
115
+ <label><?php esc_html_e( 'Default', 'woocommerce-checkout-manager' ); ?></label>
116
+ <# if (data.type=='checkbox' ) { #>
117
+ <select class="wooccm-enhanced-select" name="default">
118
+ <option <# if ( 1==data.default ) { #>selected="selected"<# } #> value="1"><?php esc_html_e( 'Yes' ); ?></option>
119
+ <option <# if ( 0==data.default ) { #>selected="selected"<# } #> value="0"><?php esc_html_e( 'No' ); ?></option>
120
+ </select>
121
+ <# } else if (data.type=='number' ) { #>
122
+ <input class="short" type="number" name="default" placeholder="<?php esc_html_e( 'Enter a default value (optional)', 'woocommerce-checkout-manager' ); ?>" value="{{data.default}}">
123
+ <# } else { #>
124
+ <input class="short" type="text" name="default" placeholder="<?php esc_html_e( 'Enter a default value (optional)', 'woocommerce-checkout-manager' ); ?>" value="{{data.default}}">
125
+ <# } #>
126
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e( 'Default value of the checkout field.', 'woocommerce-checkout-manager' ); ?>"></span>
127
+ </p>
128
+ </div>
129
+ <# } #>
130
 
131
+ <# if ( data.type=='number' ) { #>
132
+ <p class="form-field dimensions_field">
133
+ <label><?php esc_html_e( 'Number', 'woocommerce-checkout-manager' ); ?></label>
134
+ <span class="wrap">
135
+ <input style="width:48.1%" type="number" pattern="[0-9]+([\.,][0-9]+)?" step="0.01" placeholder="<?php esc_attr_e( 'minimun', 'woocommerce-checkout-manager' ); ?>" class="short" name="min" value="{{data.min}}">
136
+ <input style="width:48.1%;margin: 0;" pattern="[0-9]+([\.,][0-9]+)?" step="0.01" type="number" placeholder="<?php esc_attr_e( 'maximun', 'woocommerce-checkout-manager' ); ?>" class="short" name="max" value="{{data.max}}">
137
+ </span>
138
+ </p>
139
+ <# } #>
140
 
141
+ <# if ( data.type=='text' || data.type=='textarea' ) { #>
142
+ <p class="form-field dimensions_field">
143
+ <label><?php esc_html_e( 'Maxlength', 'woocommerce-checkout-manager' ); ?></label>
144
+ <input class="short" type="text" name="maxlength" placeholder="<?php esc_html_e( 'Enter a maxlength value (optional)', 'woocommerce-checkout-manager' ); ?>" value="{{data.maxlength}}">
145
+ </p>
146
+ <# } #>
147
 
148
+ <# if (data.type=='file' ) { #>
149
+ <!--<div class="options_group">
150
+ <p class="form-field">
151
+ <label><?php esc_html_e( 'Upload files', 'woocommerce-checkout-manager' ); ?></label>
152
+ <input class="short" type="number" placeholder="1" min="0" max="12" name="file_limit" value="{{data.file_limit}}">
153
+ </p>
154
+ <p class="form-field">
155
+ <select class="wooccm-enhanced-select" name="file_types" multiple="multiple" data-placeholder="<?php esc_attr_e( 'Choose the allowed types&hellip;', 'woocommerce-checkout-manager' ); ?>" data-allow_clear="true" >
156
+ <?php foreach ( wp_get_mime_types() as $type => $name ) : ?>
157
+ <option <# if ( _.contains(data.file_types, '<?php echo esc_attr( $type ); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr( $type ); ?>"><?php echo esc_html( $type ); ?></option>
158
  <?php endforeach; ?>
159
+ </select>
160
+ </p>
161
  </div>-->
162
+ <# } #>
163
 
164
+ <# if (data.type=='country' ) { #>
165
+ <div class="options_group">
166
+ <p class="form-field">
167
+ <label><?php esc_html_e( 'Default', 'woocommerce-checkout-manager' ); ?></label>
168
+ <select class="wooccm-enhanced-select" name="default" data-placeholder="<?php esc_attr_e( 'Preserve default country&hellip;', 'woocommerce-checkout-manager' ); ?>" data-allow_clear="true">
169
+ <option <# if (data.default=='' ) { #>selected="selected"<# } #> value=""></option>
170
+ <?php foreach ( WC()->countries->get_countries() as $id => $name ) : ?>
171
+ <option <# if (data.default=='<?php echo esc_attr( $id ); ?>' ) { #>selected="selected"<# } #> value="<?php echo esc_attr( $id ); ?>"><?php echo esc_html( $name ); ?></option>
172
+ <?php endforeach; ?>
173
+ </select>
174
+ </p>
175
+ </div>
176
+ <# } #>
177
 
178
+ <# if (data.type=='state' ) { #>
179
+ <div class="options_group">
180
+ <p class="form-field">
181
+ <label><?php esc_html_e( 'Country', 'woocommerce-checkout-manager' ); ?></label>
182
+ <select class="wooccm-enhanced-select" name="country" data-placeholder="<?php esc_attr_e( 'Select country&hellip;', 'woocommerce-checkout-manager' ); ?>" data-allow_clear="true">
183
+ <?php foreach ( WC()->countries->get_countries() as $id => $name ) : ?>
184
+ <option <# if (data.country=='<?php echo esc_attr( $id ); ?>' ) { #>selected="selected"<# } #> value="<?php echo esc_attr( $id ); ?>"><?php echo esc_html( $name ); ?></option>
185
+ <?php endforeach; ?>
186
+ </select>
187
+ </p>
188
+ </div>
189
+ <# } #>
190
 
191
+ <div class="options_group">
192
+ <p class="form-field">
193
+ <label><?php esc_html_e( 'Extra class', 'woocommerce-checkout-manager' ); ?></label>
194
+ <input class="short" type="text" name="extra_class" value="{{data.extra_class}}">
195
+ </p>
196
+ </div>
197
+ </div>
includes/view/backend/pages/modals/parts/panel-options.php CHANGED
@@ -1,75 +1,75 @@
1
- <# if ( _.contains(<?php echo json_encode($option); ?>, data.type)) { #>
2
- <div class="panel woocommerce_options_panel <# if (data.panel != 'options') { #>hidden<# } #>">
3
- <# if ( _.isObject(data.options)) { #>
4
- <div class="options_group">
5
- <table class="wc_gateways widefat wooccm-enhanced-options" style="border:none;box-shadow: none">
6
- <thead>
7
- <tr>
8
- <th class="check-column" style="width: 5%;">
9
- <label class="screen-reader-text" for="select-all"><?php esc_html_e('Select all', 'woocommerce-checkout-manager'); ?></label>
10
- <input type="checkbox" id="select-all">
11
- </th>
12
- <th scope="col" style="width: 40%;">
13
- <?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?>
14
- </th>
15
- <th scope="col" style="width: 30%;max-width: 85px;">
16
- <span class="wooccm-premium"><?php esc_html_e('Price', 'woocommerce-checkout-manager'); ?></span>
17
- <span class="woocommerce-help-tip" data-tip="<?php esc_html_e('This is a premium feature.', 'woocommerce-checkout-manager'); ?>"></span>
18
- </th>
19
- <th scope="col" style="width: 10%;min-width: 80px;">
20
- <span class="wooccm-premium"><?php esc_html_e('Taxable', 'woocommerce-checkout-manager'); ?></span>
21
- <span class="woocommerce-help-tip" data-tip="<?php esc_html_e('This is a premium feature.', 'woocommerce-checkout-manager'); ?>"></span>
22
- </th>
23
- <th scope="col" style="width: 15%;">
24
- <?php esc_html_e('Default', 'woocommerce-checkout-manager'); ?>
25
- </th>
26
- <th scope="col" style="width: 5%;">&nbsp;</th>
27
- </tr>
28
- </thead>
29
- <tbody class="ui-sortable">
30
- <# _.each(data.options, function (option, index) { #>
31
- <tr>
32
- <td class="check-column">
33
- <input class="check" type="checkbox" <# if(index === 0) { #>disabled="disabled"<# } #>/>
34
- </td>
35
- <td>
36
- <input type="text" class="label" name="options[{{index}}][label]" value="{{option.label}}">
37
- </td>
38
- <td class="wooccm-premium">
39
- <input type="number" class="add-price" name="options[{{index}}][add_price_total]" step="0.01" value="{{option.add_price_total}}">
40
- <select class="add-price-type" name="options[{{index}}][add_price_type]">
41
- <option value="fixed" <# if(option.add_price_type == 'fixed') { #>selected="selected"<# } #>>$</option>
42
- <option value="percent" <# if(option.add_price_type == 'percent') { #>selected="selected"<# } #>>%</option>
43
- </select>
44
- </td>
45
- <td class="wooccm-premium">
46
- <input type="checkbox" name="options[{{index}}][add_price_tax]" value="1" <# if (option.add_price_tax) { #>checked="checked"<# } #> />
47
- </td>
48
- <td>
49
- <# if ( _.contains(<?php echo json_encode($multiple); ?>, data.type)) { #>
50
- <input value="{{option.label}}" type="checkbox" name="options[{{index}}][default]" <# if (option.default) { #>checked="checked"<# } #> />
51
- <# } else { #>
52
- <input value="{{option.label}}" type="radio" name="default" <# if (data.default == option.label) { #>checked="checked"<# } #> />
53
- <# } #>
54
- </td>
55
- <td class="sort ui-sortable-handle">
56
- <div class="wc-item-reorder-nav">
57
- <input value="{{option.order}}" style="width: 50px" class="add-order" type="hidden" name="options[{{index}}][order]"/>
58
- </div>
59
- </td>
60
- </tr>
61
- <# }); #>
62
- </tbody>
63
- <tfoot>
64
- <tr>
65
- <th colspan="6">
66
- <button type="button" class="button button-primary add-option"><?php esc_html_e('Add new option', 'woocommerce-checkout-manager'); ?></button>
67
- <button type="button" class="button button-secondary remove-options"><?php esc_html_e('Delete selected', 'woocommerce-checkout-manager'); ?></button>
68
- </th>
69
- </tr>
70
- </tfoot>
71
- </table>
 
 
72
  </div>
73
  <# } #>
74
- </div>
75
- <# } #>
1
+ <# if ( _.contains(<?php echo json_encode( $option ); ?>, data.type)) { #>
2
+ <div class="panel woocommerce_options_panel <# if (data.panel != 'options') { #>hidden<# } #>">
3
+ <# if ( _.isObject(data.options)) { #>
4
+ <div class="options_group">
5
+ <table class="wc_gateways widefat wooccm-enhanced-options" style="border:none;box-shadow: none">
6
+ <thead>
7
+ <tr>
8
+ <th class="check-column" style="width: 5%;">
9
+ <label class="screen-reader-text" for="select-all"><?php esc_html_e( 'Select all', 'woocommerce-checkout-manager' ); ?></label>
10
+ <input type="checkbox" id="select-all">
11
+ </th>
12
+ <th scope="col" style="width: 40%;">
13
+ <?php esc_html_e( 'Label', 'woocommerce-checkout-manager' ); ?>
14
+ </th>
15
+ <th scope="col" style="width: 30%;max-width: 85px;">
16
+ <span class="wooccm-premium"><?php esc_html_e( 'Price', 'woocommerce-checkout-manager' ); ?></span>
17
+ <span class="woocommerce-help-tip" data-tip="<?php esc_html_e( 'This is a premium feature.', 'woocommerce-checkout-manager' ); ?>"></span>
18
+ </th>
19
+ <th scope="col" style="width: 10%;min-width: 80px;">
20
+ <span class="wooccm-premium"><?php esc_html_e( 'Taxable', 'woocommerce-checkout-manager' ); ?></span>
21
+ <span class="woocommerce-help-tip" data-tip="<?php esc_html_e( 'This is a premium feature.', 'woocommerce-checkout-manager' ); ?>"></span>
22
+ </th>
23
+ <th scope="col" style="width: 15%;">
24
+ <?php esc_html_e( 'Default', 'woocommerce-checkout-manager' ); ?>
25
+ </th>
26
+ <th scope="col" style="width: 5%;">&nbsp;</th>
27
+ </tr>
28
+ </thead>
29
+ <tbody class="ui-sortable">
30
+ <# _.each(data.options, function (option, index) { #>
31
+ <tr>
32
+ <td class="check-column">
33
+ <input class="check" type="checkbox" <# if(index===0) { #>disabled="disabled"<# } #>/>
34
+ </td>
35
+ <td>
36
+ <input type="text" class="label" name="options[{{index}}][label]" value="{{option.label}}">
37
+ </td>
38
+ <td class="wooccm-premium">
39
+ <input type="number" class="add-price" name="options[{{index}}][add_price_total]" step="0.01" value="{{option.add_price_total}}">
40
+ <select class="add-price-type" name="options[{{index}}][add_price_type]">
41
+ <option value="fixed" <# if(option.add_price_type=='fixed' ) { #>selected="selected"<# } #>>$</option>
42
+ <option value="percent" <# if(option.add_price_type=='percent' ) { #>selected="selected"<# } #>>%</option>
43
+ </select>
44
+ </td>
45
+ <td class="wooccm-premium">
46
+ <input type="checkbox" name="options[{{index}}][add_price_tax]" value="1" <# if (option.add_price_tax) { #>checked="checked"<# } #> />
47
+ </td>
48
+ <td>
49
+ <# if ( _.contains(<?php echo json_encode( $multiple ); ?>, data.type)) { #>
50
+ <input value="{{option.label}}" type="checkbox" name="options[{{index}}][default]" <# if (option.default) { #>checked="checked"<# } #> />
51
+ <# } else { #>
52
+ <input value="{{option.label}}" type="radio" name="default" <# if (data.default==option.label) { #>checked="checked"<# } #> />
53
+ <# } #>
54
+ </td>
55
+ <td class="sort ui-sortable-handle">
56
+ <div class="wc-item-reorder-nav">
57
+ <input value="{{option.order}}" style="width: 50px" class="add-order" type="hidden" name="options[{{index}}][order]" />
58
+ </div>
59
+ </td>
60
+ </tr>
61
+ <# }); #>
62
+ </tbody>
63
+ <tfoot>
64
+ <tr>
65
+ <th colspan="6">
66
+ <button type="button" class="button button-primary add-option"><?php esc_html_e( 'Add new option', 'woocommerce-checkout-manager' ); ?></button>
67
+ <button type="button" class="button button-secondary remove-options"><?php esc_html_e( 'Delete selected', 'woocommerce-checkout-manager' ); ?></button>
68
+ </th>
69
+ </tr>
70
+ </tfoot>
71
+ </table>
72
+ </div>
73
+ <# } #>
74
  </div>
75
  <# } #>
 
 
includes/view/backend/pages/modals/parts/panel-price.php CHANGED
@@ -1,32 +1,32 @@
1
- <# if (!_.contains(<?php echo json_encode(array_merge($option, $template)); ?>, data.type)) { #>
2
- <div class="panel woocommerce_options_panel <# if (data.panel != 'price') { #>hidden<# } #>">
3
- <div class="options_group wooccm-premium">
4
- <p class="form-field">
5
- <label><?php esc_html_e('Price', 'woocommerce-checkout-manager'); ?></label>
6
- <input <# if (data.add_price) { #>checked="checked"<# } #> type="checkbox" name="add_price" value="1">
7
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
8
- </p>
9
- <p class="form-field">
10
- <label><?php esc_html_e('Name', 'woocommerce-checkout-manager'); ?></label>
11
- <input class="short" name="add_price_name" type="text" value="{{data.add_price_name}}" placeholder="<?php esc_html_e('My Custom Charge', 'woocommerce-checkout-manager'); ?>">
12
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
13
- </p>
14
- <p class="form-field">
15
- <label><?php esc_html_e('Total', 'woocommerce-checkout-manager'); ?></label>
16
- <input class="short" name="add_price_total" type="text" value="{{data.add_price_total}}" placeholder="50">
17
- <select style="margin:0 0 0 10px;line-height: 30px; height: 30px;" class="select" name="add_price_type">
18
- <option <# if (data.add_price_type == 'fixed') { #>selected="selected"<# } #> value="fixed">$</option>
19
- <option <# if (data.add_price_type == 'percent') { #>selected="selected"<# } #> value="percent">%</option>
20
- </select>
21
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
22
- </p>
 
 
 
 
 
 
 
 
23
  </div>
24
- <div class="options_group wooccm-premium">
25
- <p class="form-field">
26
- <label><?php esc_html_e('Tax', 'woocommerce-checkout-manager'); ?></label>
27
- <input <# if (data.add_price_tax) { #>checked="checked"<# } #> type="checkbox" name="add_price_tax" value="1">
28
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
29
- </p>
30
- </div>
31
- </div>
32
- <# } #>
1
+ <# if (!_.contains(<?php echo json_encode( array_merge( $option, $template ) ); ?>, data.type)) { #>
2
+ <div class="panel woocommerce_options_panel <# if (data.panel != 'price') { #>hidden<# } #>">
3
+ <div class="options_group wooccm-premium">
4
+ <p class="form-field">
5
+ <label><?php esc_html_e( 'Price', 'woocommerce-checkout-manager' ); ?></label>
6
+ <input <# if (data.add_price) { #>checked="checked"<# } #> type="checkbox" name="add_price" value="1">
7
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
8
+ </p>
9
+ <p class="form-field">
10
+ <label><?php esc_html_e( 'Name', 'woocommerce-checkout-manager' ); ?></label>
11
+ <input class="short" name="add_price_name" type="text" value="{{data.add_price_name}}" placeholder="<?php esc_html_e( 'My Custom Charge', 'woocommerce-checkout-manager' ); ?>">
12
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
13
+ </p>
14
+ <p class="form-field">
15
+ <label><?php esc_html_e( 'Total', 'woocommerce-checkout-manager' ); ?></label>
16
+ <input class="short" name="add_price_total" type="text" value="{{data.add_price_total}}" placeholder="50">
17
+ <select style="margin:0 0 0 10px;line-height: 30px; height: 30px;" class="select" name="add_price_type">
18
+ <option <# if (data.add_price_type=='fixed' ) { #>selected="selected"<# } #> value="fixed">$</option>
19
+ <option <# if (data.add_price_type=='percent' ) { #>selected="selected"<# } #> value="percent">%</option>
20
+ </select>
21
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
22
+ </p>
23
+ </div>
24
+ <div class="options_group wooccm-premium">
25
+ <p class="form-field">
26
+ <label><?php esc_html_e( 'Tax', 'woocommerce-checkout-manager' ); ?></label>
27
+ <input <# if (data.add_price_tax) { #>checked="checked"<# } #> type="checkbox" name="add_price_tax" value="1">
28
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
29
+ </p>
30
+ </div>
31
  </div>
32
+ <# } #>
 
 
 
 
 
 
 
 
includes/view/backend/pages/modals/parts/panel-select2.php CHANGED
@@ -1,40 +1,40 @@
1
- <# if (_.contains(<?php echo json_encode(array('select', 'multiselect')); ?>, data.type)) { #>
2
- <div class="panel woocommerce_options_panel <# if (data.panel != 'select2') { #>hidden<# } #>">
3
- <div class="options_group wooccm-premium">
4
- <p class="form-field">
5
- <label><?php esc_html_e('Select2', 'woocommerce-checkout-manager'); ?></label>
6
- <input <# if ( data.select2 ) { #>checked="checked"<# } #> type="checkbox" name="select2" value="1">
7
- <span class="description hidden"><?php esc_html_e('Enhance select behaviour with select2.', '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('Allow clear', 'woocommerce-checkout-manager'); ?></label>
14
- <input <# if ( data.select2_allowclear ) { #>checked="checked"<# } #> type="checkbox" name="select2_allowclear" value="1">
15
- <span class="description hidden"><?php esc_html_e('Provides support for clearable selections.', 'woocommerce-checkout-manager'); ?></span>
16
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
17
- </p>
18
- <p class="form-field">
19
- <label><?php esc_html_e('Allow search', 'woocommerce-checkout-manager'); ?></label>
20
- <input <# if ( data.select2_search ) { #>checked="checked"<# } #> type="checkbox" name="select2_search" value="1">
21
- <span class="description hidden"><?php esc_html_e('Display the search box for options.', 'woocommerce-checkout-manager'); ?></span>
22
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
23
- </p>
24
- </div>
25
- <div class="options_group wooccm-premium">
26
- <p class="form-field">
27
- <label><?php esc_html_e('Select on close', 'woocommerce-checkout-manager'); ?></label>
28
- <input <# if ( data.select2_selectonclose ) { #>checked="checked"<# } #> type="checkbox" name="select2_selectonclose" value="1">
29
- <span class="description hidden"><?php esc_html_e('Implements automatic selection when the dropdown is closed.', 'woocommerce-checkout-manager'); ?></span>
30
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
31
- </p>
32
- <p class="form-field">
33
- <label><?php esc_html_e('Close on select', 'woocommerce-checkout-manager'); ?></label>
34
- <input <# if ( data.select2_closeonselect ) { #>checked="checked"<# } #> type="checkbox" name="select2_closeonselect" value="1">
35
- <span class="description hidden"><?php esc_html_e('Controls whether the dropdown is closed after a selection is made.', 'woocommerce-checkout-manager'); ?></span>
36
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
37
- </p>
38
- </div>
39
- </div>
40
- <# } #>
1
+ <# if (_.contains(<?php echo json_encode( array( 'select', 'multiselect' ) ); ?>, data.type)) { #>
2
+ <div class="panel woocommerce_options_panel <# if (data.panel != 'select2') { #>hidden<# } #>">
3
+ <div class="options_group wooccm-premium">
4
+ <p class="form-field">
5
+ <label><?php esc_html_e( 'Select2', 'woocommerce-checkout-manager' ); ?></label>
6
+ <input <# if ( data.select2 ) { #>checked="checked"<# } #> type="checkbox" name="select2" value="1">
7
+ <span class="description hidden"><?php esc_html_e( 'Enhance select behaviour with select2.', '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( 'Allow clear', 'woocommerce-checkout-manager' ); ?></label>
14
+ <input <# if ( data.select2_allowclear ) { #>checked="checked"<# } #> type="checkbox" name="select2_allowclear" value="1">
15
+ <span class="description hidden"><?php esc_html_e( 'Provides support for clearable selections.', 'woocommerce-checkout-manager' ); ?></span>
16
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
17
+ </p>
18
+ <p class="form-field">
19
+ <label><?php esc_html_e( 'Allow search', 'woocommerce-checkout-manager' ); ?></label>
20
+ <input <# if ( data.select2_search ) { #>checked="checked"<# } #> type="checkbox" name="select2_search" value="1">
21
+ <span class="description hidden"><?php esc_html_e( 'Display the search box for options.', 'woocommerce-checkout-manager' ); ?></span>
22
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
23
+ </p>
24
+ </div>
25
+ <div class="options_group wooccm-premium">
26
+ <p class="form-field">
27
+ <label><?php esc_html_e( 'Select on close', 'woocommerce-checkout-manager' ); ?></label>
28
+ <input <# if ( data.select2_selectonclose ) { #>checked="checked"<# } #> type="checkbox" name="select2_selectonclose" value="1">
29
+ <span class="description hidden"><?php esc_html_e( 'Implements automatic selection when the dropdown is closed.', 'woocommerce-checkout-manager' ); ?></span>
30
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
31
+ </p>
32
+ <p class="form-field">
33
+ <label><?php esc_html_e( 'Close on select', 'woocommerce-checkout-manager' ); ?></label>
34
+ <input <# if ( data.select2_closeonselect ) { #>checked="checked"<# } #> type="checkbox" name="select2_closeonselect" value="1">
35
+ <span class="description hidden"><?php esc_html_e( 'Controls whether the dropdown is closed after a selection is made.', 'woocommerce-checkout-manager' ); ?></span>
36
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
37
+ </p>
38
+ </div>
39
  </div>
40
+ <# } #>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/view/backend/pages/modals/parts/panel-timepicker.php CHANGED
@@ -1,37 +1,37 @@
1
- <# if (data.type == 'time') { #>
2
- <div class="panel woocommerce_options_panel <# if (data.panel != 'timepicker') { #>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 time behaviour with timepicker.', '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('Hour start', 'woocommerce-checkout-manager'); ?></label>
14
- <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="number" min="0" max="24" placeholder="6" step="1" name="time_limit_start" value="{{data.time_limit_start}}">
15
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
16
- </p>
17
- <p class="form-field">
18
- <label><?php esc_html_e('Hour end', 'woocommerce-checkout-manager'); ?></label>
19
- <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="number" min="0" max="24" placeholder="9" step="1" name="time_limit_end" value="{{data.time_limit_end}}">
20
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
21
- </p>
22
- <p class="form-field">
23
- <label><?php esc_html_e('Minutes interval', 'woocommerce-checkout-manager'); ?></label>
24
- <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="number" min="0" max="60" step="5" placeholder="15" name="time_limit_interval" value="{{data.time_limit_interval}}">
25
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
26
- </p>
27
- </div>
28
- <div class="options_group wooccm-premium">
29
- <p class="form-field">
30
- <label><?php esc_html_e('format 24hs', 'woocommerce-checkout-manager'); ?></label>
31
- <input <# if ( data.time_format_ampm ) { #>checked="checked"<# } #> class="media-modal-render-panels" type="checkbox" name="time_format_ampm" value="1" >
32
- <span class="description hidden"><?php esc_html_e('Time Format AM/PM', 'woocommerce-checkout-manager'); ?></span>
33
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
34
- </p>
35
- </div>
36
- </div>
37
- <# } #>
1
+ <# if (data.type=='time' ) { #>
2
+ <div class="panel woocommerce_options_panel <# if (data.panel != 'timepicker') { #>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 time behaviour with timepicker.', '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( 'Hour start', 'woocommerce-checkout-manager' ); ?></label>
14
+ <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="number" min="0" max="24" placeholder="6" step="1" name="time_limit_start" value="{{data.time_limit_start}}">
15
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
16
+ </p>
17
+ <p class="form-field">
18
+ <label><?php esc_html_e( 'Hour end', 'woocommerce-checkout-manager' ); ?></label>
19
+ <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="number" min="0" max="24" placeholder="9" step="1" name="time_limit_end" value="{{data.time_limit_end}}">
20
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
21
+ </p>
22
+ <p class="form-field">
23
+ <label><?php esc_html_e( 'Minutes interval', 'woocommerce-checkout-manager' ); ?></label>
24
+ <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="number" min="0" max="60" step="5" placeholder="15" name="time_limit_interval" value="{{data.time_limit_interval}}">
25
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
26
+ </p>
27
+ </div>
28
+ <div class="options_group wooccm-premium">
29
+ <p class="form-field">
30
+ <label><?php esc_html_e( 'format 24hs', 'woocommerce-checkout-manager' ); ?></label>
31
+ <input <# if ( data.time_format_ampm ) { #>checked="checked"<# } #> class="media-modal-render-panels" type="checkbox" name="time_format_ampm" value="1" >
32
+ <span class="description hidden"><?php esc_html_e( 'Time Format AM/PM', 'woocommerce-checkout-manager' ); ?></span>
33
+ <span class="description premium">(<?php esc_html_e( 'This is a premium feature', 'woocommerce-checkout-manager' ); ?>)</span>
34
+ </p>
35
+ </div>
36
  </div>
37
+ <# } #>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/view/backend/pages/modals/parts/tabs.php CHANGED
@@ -1,41 +1,41 @@
1
  <ul class="wc-tabs">
2
  <li class="media-modal-tab active">
3
- <a href="#general"><span><?php esc_html_e('General', 'woocommerce-checkout-manager'); ?></span></a>
4
- </li>
5
- <# if ( _.contains(<?php echo json_encode(array('select', 'multiselect')); ?>, data.type)) { #>
6
- <li class="media-modal-tab">
7
- <a href="#select2"><span><?php esc_html_e('Select2', 'woocommerce-checkout-manager'); ?></span></a>
8
- </li>
9
- <# } #>
10
- <# if ( _.contains(<?php echo json_encode($option); ?>, data.type)) { #>
11
- <li class="media-modal-tab">
12
- <a href="#options"><span><?php esc_html_e('Options', 'woocommerce-checkout-manager'); ?></span></a>
13
- </li>
14
- <# } #>
15
- <li class="media-modal-tab">
16
- <a href="#filter"><span><?php esc_html_e('Filter', 'woocommerce-checkout-manager'); ?></span></a>
17
- </li>
18
- <li class="media-modal-tab">
19
- <a href="#display"><span><?php esc_html_e('Display', 'woocommerce-checkout-manager'); ?></span></a>
20
- </li>
21
- <# if ( !_.contains(<?php echo json_encode(array_merge($option, $template)); ?>, data.type)) { #>
22
- <li class="media-modal-tab">
23
- <a href="#price"><span><?php esc_html_e('Price', 'woocommerce-checkout-manager'); ?></span></a>
24
- </li>
25
- <# } #>
26
- <# if (data.type == 'time') { #>
27
- <li class="media-modal-tab">
28
- <a href="#timepicker"><span><?php esc_html_e('Timepicker', 'woocommerce-checkout-manager'); ?></span></a>
29
- </li>
30
- <# } #>
31
- <# if (data.type == 'date') { #>
32
- <li class="media-modal-tab">
33
- <a href="#datepicker"><span><?php esc_html_e('Datepicker', 'woocommerce-checkout-manager'); ?></span></a>
34
- </li>
35
- <# } #>
36
- <# if ( !_.contains(<?php echo json_encode($template); ?>, data.type)) { #>
37
- <li class="media-modal-tab">
38
- <a href="#admin"><span><?php esc_html_e('Admin', 'woocommerce-checkout-manager'); ?></span></a>
39
- </li>
40
- <# } #>
41
- </ul>
1
  <ul class="wc-tabs">
2
  <li class="media-modal-tab active">
3
+ <a href="#general"><span><?php esc_html_e( 'General', 'woocommerce-checkout-manager' ); ?></span></a>
4
+ </li>
5
+ <# if ( _.contains(<?php echo json_encode( array( 'select', 'multiselect' ) ); ?>, data.type)) { #>
6
+ <li class="media-modal-tab">
7
+ <a href="#select2"><span><?php esc_html_e( 'Select2', 'woocommerce-checkout-manager' ); ?></span></a>
8
+ </li>
9
+ <# } #>
10
+ <# if ( _.contains(<?php echo json_encode( $option ); ?>, data.type)) { #>
11
+ <li class="media-modal-tab">
12
+ <a href="#options"><span><?php esc_html_e( 'Options', 'woocommerce-checkout-manager' ); ?></span></a>
13
+ </li>
14
+ <# } #>
15
+ <li class="media-modal-tab">
16
+ <a href="#filter"><span><?php esc_html_e( 'Filter', 'woocommerce-checkout-manager' ); ?></span></a>
17
+ </li>
18
+ <li class="media-modal-tab">
19
+ <a href="#display"><span><?php esc_html_e( 'Display', 'woocommerce-checkout-manager' ); ?></span></a>
20
+ </li>
21
+ <# if ( !_.contains(<?php echo json_encode( array_merge( $option, $template ) ); ?>, data.type)) { #>
22
+ <li class="media-modal-tab">
23
+ <a href="#price"><span><?php esc_html_e( 'Price', 'woocommerce-checkout-manager' ); ?></span></a>
24
+ </li>
25
+ <# } #>
26
+ <# if (data.type=='time' ) { #>
27
+ <li class="media-modal-tab">
28
+ <a href="#timepicker"><span><?php esc_html_e( 'Timepicker', 'woocommerce-checkout-manager' ); ?></span></a>
29
+ </li>
30
+ <# } #>
31
+ <# if (data.type=='date' ) { #>
32
+ <li class="media-modal-tab">
33
+ <a href="#datepicker"><span><?php esc_html_e( 'Datepicker', 'woocommerce-checkout-manager' ); ?></span></a>
34
+ </li>
35
+ <# } #>
36
+ <# if ( !_.contains(<?php echo json_encode( $template ); ?>, data.type)) { #>
37
+ <li class="media-modal-tab">
38
+ <a href="#admin"><span><?php esc_html_e( 'Admin', 'woocommerce-checkout-manager' ); ?></span></a>
39
+ </li>
40
+ <# } #>
41
+ </ul>
includes/view/backend/pages/order.php CHANGED
@@ -1,8 +1,8 @@
1
- <?php include_once( 'parts/tabs.php' ); ?>
2
- <h1 class="screen-reader-text"><?php esc_html_e('Order', 'woocommerce-checkout-manager'); ?></h1>
3
- <h2><?php esc_html_e('Order 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 order settings.', 'woocommerce-checkout-manager'), $current_section); ?></p>
6
  </div>
7
 
8
- <?php woocommerce_admin_fields($settings); ?>
1
+ <?php require_once 'parts/tabs.php'; ?>
2
+ <h1 class="screen-reader-text"><?php esc_html_e( 'Order', 'woocommerce-checkout-manager' ); ?></h1>
3
+ <h2><?php esc_html_e( 'Order 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 order settings.', 'woocommerce-checkout-manager' ), $current_section ); ?></p>
6
  </div>
7
 
8
+ <?php woocommerce_admin_fields( $settings ); ?>
includes/view/backend/pages/parts/actions.php CHANGED
@@ -1,12 +1,12 @@
1
- <div id="<?php printf('wooccm_%s_settings-actions', $current_section); ?>" class="tablenav top" style="margin-bottom:15px">
2
  <div class="alignleft actions bulkactions">
3
- <a href="javascript:;" id="<?php printf('wooccm_%s_settings_add', $current_section); ?>" class="button button-primary"><?php esc_html_e('+ Add New Field', 'woocommerce-checkout-manager') ?></a>
4
- <!--<a href="javascript:;" id="<?php printf('wooccm_%s_settings_import', $current_section); ?>" class="button button-secondary"><?php esc_html_e('Import', 'woocommerce-checkout-manager') ?></a>-->
5
- <a href="javascript:;" id="<?php printf('wooccm_%s_settings_reset', $current_section); ?>" class="button button-secondary"><?php esc_html_e('Reset', 'woocommerce-checkout-manager') ?></a>
6
  </div>
7
- <?php if ('additional' == $current_section) : ?>
8
- <div class="alignright actions">
9
- <?php woocommerce_admin_fields($settings); ?>
10
- </div>
11
  <?php endif; ?>
12
- </div>
1
+ <div id="<?php printf( 'wooccm_%s_settings-actions', $current_section ); ?>" class="tablenav top" style="margin-bottom:15px">
2
  <div class="alignleft actions bulkactions">
3
+ <a href="javascript:;" id="<?php printf( 'wooccm_%s_settings_add', $current_section ); ?>" class="button button-primary"><?php esc_html_e( '+ Add New Field', 'woocommerce-checkout-manager' ); ?></a>
4
+ <!--<a href="javascript:;" id="<?php printf( 'wooccm_%s_settings_import', $current_section ); ?>" class="button button-secondary"><?php esc_html_e( 'Import', 'woocommerce-checkout-manager' ); ?></a>-->
5
+ <a href="javascript:;" id="<?php printf( 'wooccm_%s_settings_reset', $current_section ); ?>" class="button button-secondary"><?php esc_html_e( 'Reset', 'woocommerce-checkout-manager' ); ?></a>
6
  </div>
7
+ <?php if ( 'additional' == $current_section ) : ?>
8
+ <div class="alignright actions">
9
+ <?php woocommerce_admin_fields( $settings ); ?>
10
+ </div>
11
  <?php endif; ?>
12
+ </div>
includes/view/backend/pages/parts/header.php CHANGED
@@ -1,15 +1,17 @@
1
  <div class="wrap about-wrap full-width-layout">
2
 
3
- <h1><?php esc_html_e('Suggestions', 'woocommerce-checkout-manager'); ?></h1>
4
 
5
- <p class="about-text"><?php printf(esc_html__('Thanks for using our product! We recommend these extensions that will add new features to stand out your business and improve your sales.', 'woocommerce-checkout-manager'), WOOCCM_PLUGIN_NAME); ?></p>
6
 
7
  <p class="about-text">
8
- <?php printf('<a href="%s" target="_blank">%s</a>', WOOCCM_PURCHASE_URL, esc_html__('Purchase', 'woocommerce-checkout-manager')); ?></a> |
9
- <?php printf('<a href="%s" target="_blank">%s</a>', WOOCCM_DOCUMENTATION_URL, esc_html__('Documentation', 'woocommerce-checkout-manager')); ?></a>
10
  </p>
11
 
12
- <?php printf('<a href="%s" target="_blank"><div style="
 
 
13
  background: #006bff url(%s) no-repeat;
14
  background-position: top center;
15
  background-size: 130px 130px;
@@ -22,27 +24,33 @@
22
  height: 40px;
23
  display: inline-block;
24
  width: 140px;
25
- " class="wp-badge">%s</div></a>', 'https://quadlayers.com/?utm_source=wooccm_admin', plugins_url('/assets/backend/img/quadlayers.jpg', WOOCCM_PLUGIN_FILE), esc_html__('QuadLayers', 'woocommerce-checkout-manager')); ?>
 
 
 
 
 
26
 
27
  </div>
28
 
29
  <?php
30
- if (isset($GLOBALS['submenu'][WOOCCM_PREFIX])) {
31
- if (is_array($GLOBALS['submenu'][WOOCCM_PREFIX])) {
32
- ?>
33
- <div class="wrap about-wrap full-width-layout qlwrap">
34
- <h2 class="nav-tab-wrapper">
35
- <?php
36
- foreach ($GLOBALS['submenu'][WOOCCM_PREFIX] as $tab) {
37
- if (strpos($tab[2], '.php') !== false)
38
- continue;
39
- ?>
40
- <a href="<?php echo admin_url('admin.php?page=' . esc_attr($tab[2])); ?>" class="nav-tab<?php echo (isset($_GET['page']) && $_GET['page'] == $tab[2]) ? ' nav-tab-active' : ''; ?>"><?php echo $tab[0]; ?></a>
41
- <?php
42
- }
43
- ?>
44
- </h2>
45
- </div>
46
- <?php
47
- }
 
48
  }
1
  <div class="wrap about-wrap full-width-layout">
2
 
3
+ <h1><?php esc_html_e( 'Suggestions', 'woocommerce-checkout-manager' ); ?></h1>
4
 
5
+ <p class="about-text"><?php printf( esc_html__( 'Thanks for using our product! We recommend these extensions that will add new features to stand out your business and improve your sales.', 'woocommerce-checkout-manager' ), WOOCCM_PLUGIN_NAME ); ?></p>
6
 
7
  <p class="about-text">
8
+ <?php printf( '<a href="%s" target="_blank">%s</a>', WOOCCM_PURCHASE_URL, esc_html__( 'Purchase', 'woocommerce-checkout-manager' ) ); ?></a> |
9
+ <?php printf( '<a href="%s" target="_blank">%s</a>', WOOCCM_DOCUMENTATION_URL, esc_html__( 'Documentation', 'woocommerce-checkout-manager' ) ); ?></a>
10
  </p>
11
 
12
+ <?php
13
+ printf(
14
+ '<a href="%s" target="_blank"><div style="
15
  background: #006bff url(%s) no-repeat;
16
  background-position: top center;
17
  background-size: 130px 130px;
24
  height: 40px;
25
  display: inline-block;
26
  width: 140px;
27
+ " class="wp-badge">%s</div></a>',
28
+ 'https://quadlayers.com/?utm_source=wooccm_admin',
29
+ plugins_url( '/assets/backend/img/quadlayers.jpg', WOOCCM_PLUGIN_FILE ),
30
+ esc_html__( 'QuadLayers', 'woocommerce-checkout-manager' )
31
+ );
32
+ ?>
33
 
34
  </div>
35
 
36
  <?php
37
+ if ( isset( $GLOBALS['submenu'][ WOOCCM_PREFIX ] ) ) {
38
+ if ( is_array( $GLOBALS['submenu'][ WOOCCM_PREFIX ] ) ) {
39
+ ?>
40
+ <div class="wrap about-wrap full-width-layout qlwrap">
41
+ <h2 class="nav-tab-wrapper">
42
+ <?php
43
+ foreach ( $GLOBALS['submenu'][ WOOCCM_PREFIX ] as $tab ) {
44
+ if ( strpos( $tab[2], '.php' ) !== false ) {
45
+ continue;
46
+ }
47
+ ?>
48
+ <a href="<?php echo admin_url( 'admin.php?page=' . esc_attr( $tab[2] ) ); ?>" class="nav-tab<?php echo ( isset( $_GET['page'] ) && $_GET['page'] == $tab[2] ) ? ' nav-tab-active' : ''; ?>"><?php echo $tab[0]; ?></a>
49
+ <?php
50
+ }
51
+ ?>
52
+ </h2>
53
+ </div>
54
+ <?php
55
+ }
56
  }
includes/view/backend/pages/parts/loop.php CHANGED
@@ -1,134 +1,134 @@
1
  <table class="form-table">
2
  <tbody>
3
- <tr valign="top">
4
- <td class="<?php printf('wooccm_%s_wrapper', $current_section); ?> wc_payment_gateways_wrapper" colspan="2">
5
- <table id="<?php printf('wooccm_%s_fields', $current_section); ?>" class="wc_gateways widefat" cellspacing="0" aria-describedby="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
6
- <thead>
7
- <tr>
8
- <th class="sort" style="width:1%"></th>
9
- <th class="required" style="width:1%"><?php esc_html_e('Required', 'woocommerce-checkout-manager'); ?></th>
10
- <th class="position" style="width:1%;min-width: 100px;"><?php esc_html_e('Position', 'woocommerce-checkout-manager'); ?></th>
11
- <th class="clear"><?php esc_html_e('Clear', 'woocommerce-checkout-manager'); ?><span class="woocommerce-help-tip" style="position:absolute;top:50%;margin-top:-0.5em;" data-tip="<?php esc_html_e('Disallow floating elements on the left and right side of this field.', 'woocommerce-checkout-manager'); ?>"></span></th>
12
- <th class="type" style="width:1%"><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></th>
13
- <th class="label" style="width:1%;min-width: 100px;"><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></th>
14
- <th class="placeholder"><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></th>
15
- <!--<th class="listable"><?php esc_html_e('Listable', 'woocommerce-checkout-manager'); ?></th>
16
- <th class="sortable"><?php esc_html_e('Sortable', 'woocommerce-checkout-manager'); ?></th>
17
- <th class="filterable"><?php esc_html_e('Filterable', 'woocommerce-checkout-manager'); ?></th>-->
18
- <th class="parent" style="width:1%"><?php esc_html_e('Parent', 'woocommerce-checkout-manager'); ?></th>
19
- <th class="id" style="width:1%;"><?php esc_html_e('ID', 'woocommerce-checkout-manager'); ?></th>
20
- <th class="status" style="width:1%"><?php esc_html_e('Disabled', 'woocommerce-checkout-manager'); ?></th>
21
- <th class="edit" style="width:1%"></th>
22
- <th class="delete" style="width:1%"></th>
23
- </tr>
24
- </thead>
25
- <tbody class="ui-sortable">
26
- <?php if (count($fields)) : ?>
27
- <?php foreach ($fields as $id => $field) : ?>
28
- <tr data-field_id="<?php echo esc_attr($field['id']); ?>" data-field_order="<?php echo esc_attr($field['order']); ?>">
29
- <td class="sort ui-sortable-handle">
30
- <div class="wc-item-reorder-nav">
31
- <button type="button" class="wc-move-up wc-move-disabled" tabindex="-1" aria-hidden="true" aria-label="<?php echo esc_attr(sprintf(esc_html__('Move the "%s" payment method up', 'woocommerce-checkout-manager'), $field['label'])); ?>"><?php esc_html_e('Move up', 'woocommerce-checkout-manager'); ?></button>
32
- <button type="button" class="wc-move-down" tabindex="0" aria-hidden="false" aria-label="<?php echo esc_attr(sprintf(esc_html__('Move the "%s" payment method down', 'woocommerce-checkout-manager'), $field['label'])); ?>"><?php esc_html_e('Move down', 'woocommerce-checkout-manager'); ?></button>
33
- <input type="hidden" name="field_order[]" value="<?php echo esc_attr($id); ?>">
34
- </div>
35
- </td>
36
- <td class="required">
37
- <a data-field_attr="required" class="wooccm-field-toggle-attribute" href="#">
38
- <?php
39
- if ($field['required'] === true) {
40
- echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(esc_html__('The "%s" field currently enabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('Yes', 'woocommerce-checkout-manager') . '</span>';
41
- } else {
42
- echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(esc_html__('The "%s" field currently disabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('No', 'woocommerce-checkout-manager') . '</span>';
43
- }
44
- ?>
45
- </a>
46
- </td>
47
- <td class="position">
48
- <select data-field_attr="position" class="wooccm-field-change-attribute" style="width: auto; border-radius: 3px; height: 28px; line-height: 28px;" name="position">
49
- <option <?php selected($field['position'], 'form-row-wide'); ?> value="form-row-wide"><?php esc_html_e('Wide', 'woocommerce-checkout-manager'); ?></option>
50
- <option <?php selected($field['position'], 'form-row-first'); ?> value="form-row-first"><?php esc_html_e('Left', 'woocommerce-checkout-manager'); ?></option>
51
- <option <?php selected($field['position'], 'form-row-last'); ?> value="form-row-last"><?php esc_html_e('Right', 'woocommerce-checkout-manager'); ?></option>
52
- </select>
53
- </td>
54
- <td class="clear">
55
- <a data-field_attr="clear" class="wooccm-field-toggle-attribute" href="#">
56
- <?php
57
- if ($field['clear'] === true) {
58
- echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(esc_html__('The "%s" field currently enabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('Yes', 'woocommerce-checkout-manager') . '</span>';
59
- } else {
60
- echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(esc_html__('The "%s" field currently disabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('No', 'woocommerce-checkout-manager') . '</span>';
61
- }
62
- ?>
63
- </a>
64
- </td>
65
- <td class="type">
66
- <?php echo esc_html($field['type']); ?>
67
- </td>
68
- <td class="label">
69
- <?php echo esc_html($field['label']); ?>
70
- </td>
71
- <td class="placeholder">
72
- <?php echo esc_html($field['placeholder']); ?>
73
- </td>
74
- <td class="parent">
75
- <?php echo esc_attr($field['conditional_parent_key']); ?>
76
- </td>
77
- <td class="id">
78
- <?php echo esc_html($field['key']); ?>
79
- </td>
80
- <!--<td class="listable">
81
- <?php
82
- if ($field['listable'] === true) {
83
- ?>
84
- <span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
85
- <?php } else { ?>
86
- <span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
87
- <?php } ?>
88
- </td>
89
- <td class="sortable">
90
- <?php
91
- if ($field['sortable'] === true) {
92
- ?>
93
- <span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
94
- <?php } else { ?>
95
- <span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
96
- <?php } ?>
97
- </td>
98
- <td class="filterable">
99
- <?php
100
- if ($field['filterable'] === true) {
101
- ?>
102
- <span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
103
- <?php } else { ?>
104
- <span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
105
- <?php } ?>
106
- </td>-->
107
- <td class="status">
108
- <a data-field_attr="disabled" class="wooccm-field-toggle-attribute" href="#">
109
- <?php
110
- if ($field['disabled'] === true) {
111
- echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(esc_html__('The "%s" field currently enabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('Yes', 'woocommerce-checkout-manager') . '</span>';
112
- } else {
113
- echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(esc_html__('The "%s" field currently disabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('No', 'woocommerce-checkout-manager') . '</span>';
114
- }
115
- ?>
116
- </a>
117
- </td>
118
- <td class="edit">
119
- <a class="<?php printf('wooccm_%s_settings_edit', $current_section); ?> button" aria-label="<?php esc_html_e('Edit checkout field', 'woocommerce-checkout-manager'); ?>" href="javascript:;"><?php esc_html_e('Edit'); ?></a>
120
- </td>
121
- <td class="delete">
122
- <?php if (is_array($defaults) && !in_array($field['key'], array_column($defaults, 'key'))) : ?>
123
- <a class="<?php printf('wooccm_%s_settings_delete', $current_section); ?>" aria-label="<?php esc_html_e('Edit checkout field', 'woocommerce-checkout-manager'); ?>" href="javascript:;"><?php esc_html_e('Delete'); ?></a>
124
- <?php endif; ?>
125
- </td>
126
- </tr>
127
- <?php endforeach; ?>
128
- <?php endif; ?>
129
- </tbody>
130
- </table>
131
- </td>
132
- </tr>
133
  </tbody>
134
- </table>
1
  <table class="form-table">
2
  <tbody>
3
+ <tr valign="top">
4
+ <td class="<?php printf( 'wooccm_%s_wrapper', $current_section ); ?> wc_payment_gateways_wrapper" colspan="2">
5
+ <table id="<?php printf( 'wooccm_%s_fields', $current_section ); ?>" class="wc_gateways widefat" cellspacing="0" aria-describedby="<?php printf( 'wooccm_%s_settings-description', $current_section ); ?>">
6
+ <thead>
7
+ <tr>
8
+ <th class="sort" style="width:1%"></th>
9
+ <th class="required" style="width:1%"><?php esc_html_e( 'Required', 'woocommerce-checkout-manager' ); ?></th>
10
+ <th class="position" style="width:1%;min-width: 100px;"><?php esc_html_e( 'Position', 'woocommerce-checkout-manager' ); ?></th>
11
+ <th class="clear"><?php esc_html_e( 'Clear', 'woocommerce-checkout-manager' ); ?><span class="woocommerce-help-tip" style="position:absolute;top:50%;margin-top:-0.5em;" data-tip="<?php esc_html_e( 'Disallow floating elements on the left and right side of this field.', 'woocommerce-checkout-manager' ); ?>"></span></th>
12
+ <th class="type" style="width:1%"><?php esc_html_e( 'Type', 'woocommerce-checkout-manager' ); ?></th>
13
+ <th class="label" style="width:1%;min-width: 100px;"><?php esc_html_e( 'Label', 'woocommerce-checkout-manager' ); ?></th>
14
+ <th class="placeholder"><?php esc_html_e( 'Placeholder', 'woocommerce-checkout-manager' ); ?></th>
15
+ <!--<th class="listable"><?php esc_html_e( 'Listable', 'woocommerce-checkout-manager' ); ?></th>
16
+ <th class="sortable"><?php esc_html_e( 'Sortable', 'woocommerce-checkout-manager' ); ?></th>
17
+ <th class="filterable"><?php esc_html_e( 'Filterable', 'woocommerce-checkout-manager' ); ?></th>-->
18
+ <th class="parent" style="width:1%"><?php esc_html_e( 'Parent', 'woocommerce-checkout-manager' ); ?></th>
19
+ <th class="id" style="width:1%;"><?php esc_html_e( 'ID', 'woocommerce-checkout-manager' ); ?></th>
20
+ <th class="status" style="width:1%"><?php esc_html_e( 'Disabled', 'woocommerce-checkout-manager' ); ?></th>
21
+ <th class="edit" style="width:1%"></th>
22
+ <th class="delete" style="width:1%"></th>
23
+ </tr>
24
+ </thead>
25
+ <tbody class="ui-sortable">
26
+ <?php if ( count( $fields ) ) : ?>
27
+ <?php foreach ( $fields as $id => $field ) : ?>
28
+ <tr data-field_id="<?php echo esc_attr( $field['id'] ); ?>" data-field_order="<?php echo esc_attr( $field['order'] ); ?>">
29
+ <td class="sort ui-sortable-handle">
30
+ <div class="wc-item-reorder-nav">
31
+ <button type="button" class="wc-move-up wc-move-disabled" tabindex="-1" aria-hidden="true" aria-label="<?php echo esc_attr( sprintf( esc_html__( 'Move the "%s" payment method up', 'woocommerce-checkout-manager' ), $field['label'] ) ); ?>"><?php esc_html_e( 'Move up', 'woocommerce-checkout-manager' ); ?></button>
32
+ <button type="button" class="wc-move-down" tabindex="0" aria-hidden="false" aria-label="<?php echo esc_attr( sprintf( esc_html__( 'Move the "%s" payment method down', 'woocommerce-checkout-manager' ), $field['label'] ) ); ?>"><?php esc_html_e( 'Move down', 'woocommerce-checkout-manager' ); ?></button>
33
+ <input type="hidden" name="field_order[]" value="<?php echo esc_attr( $id ); ?>">
34
+ </div>
35
+ </td>
36
+ <td class="required">
37
+ <a data-field_attr="required" class="wooccm-field-toggle-attribute" href="#">
38
+ <?php
39
+ if ( $field['required'] === true ) {
40
+ echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr( sprintf( esc_html__( 'The "%s" field currently enabled', 'woocommerce-checkout-manager' ), $field['label'] ) ) . '">' . esc_attr__( 'Yes', 'woocommerce-checkout-manager' ) . '</span>';
41
+ } else {
42
+ echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr( sprintf( esc_html__( 'The "%s" field currently disabled', 'woocommerce-checkout-manager' ), $field['label'] ) ) . '">' . esc_attr__( 'No', 'woocommerce-checkout-manager' ) . '</span>';
43
+ }
44
+ ?>
45
+ </a>
46
+ </td>
47
+ <td class="position">
48
+ <select data-field_attr="position" class="wooccm-field-change-attribute" style="width: auto; border-radius: 3px; height: 28px; line-height: 28px;" name="position">
49
+ <option <?php selected( $field['position'], 'form-row-wide' ); ?> value="form-row-wide"><?php esc_html_e( 'Wide', 'woocommerce-checkout-manager' ); ?></option>
50
+ <option <?php selected( $field['position'], 'form-row-first' ); ?> value="form-row-first"><?php esc_html_e( 'Left', 'woocommerce-checkout-manager' ); ?></option>
51
+ <option <?php selected( $field['position'], 'form-row-last' ); ?> value="form-row-last"><?php esc_html_e( 'Right', 'woocommerce-checkout-manager' ); ?></option>
52
+ </select>
53
+ </td>
54
+ <td class="clear">
55
+ <a data-field_attr="clear" class="wooccm-field-toggle-attribute" href="#">
56
+ <?php
57
+ if ( $field['clear'] === true ) {
58
+ echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr( sprintf( esc_html__( 'The "%s" field currently enabled', 'woocommerce-checkout-manager' ), $field['label'] ) ) . '">' . esc_attr__( 'Yes', 'woocommerce-checkout-manager' ) . '</span>';
59
+ } else {
60
+ echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr( sprintf( esc_html__( 'The "%s" field currently disabled', 'woocommerce-checkout-manager' ), $field['label'] ) ) . '">' . esc_attr__( 'No', 'woocommerce-checkout-manager' ) . '</span>';
61
+ }
62
+ ?>
63
+ </a>
64
+ </td>
65
+ <td class="type">
66
+ <?php echo esc_html( $field['type'] ); ?>
67
+ </td>
68
+ <td class="label">
69
+ <?php echo esc_html( $field['label'] ); ?>
70
+ </td>
71
+ <td class="placeholder">
72
+ <?php echo esc_html( $field['placeholder'] ); ?>
73
+ </td>
74
+ <td class="parent">
75
+ <?php echo esc_attr( $field['conditional_parent_key'] ); ?>
76
+ </td>
77
+ <td class="id">
78
+ <?php echo esc_html( $field['key'] ); ?>
79
+ </td>
80
+ <!--<td class="listable">
81
+ <?php
82
+ if ( $field['listable'] === true ) {
83
+ ?>
84
+ <span class="status-enabled"><?php esc_html_e( 'Yes' ); ?></span>
85
+ <?php } else { ?>
86
+ <span class="status-disabled"><?php esc_html_e( 'Yes' ); ?></span>
87
+ <?php } ?>
88
+ </td>
89
+ <td class="sortable">
90
+ <?php
91
+ if ( $field['sortable'] === true ) {
92
+ ?>
93
+ <span class="status-enabled"><?php esc_html_e( 'Yes' ); ?></span>
94
+ <?php } else { ?>
95
+ <span class="status-disabled"><?php esc_html_e( 'Yes' ); ?></span>
96
+ <?php } ?>
97
+ </td>
98
+ <td class="filterable">
99
+ <?php
100
+ if ( $field['filterable'] === true ) {
101
+ ?>
102
+ <span class="status-enabled"><?php esc_html_e( 'Yes' ); ?></span>
103
+ <?php } else { ?>
104
+ <span class="status-disabled"><?php esc_html_e( 'Yes' ); ?></span>
105
+ <?php } ?>
106
+ </td>-->
107
+ <td class="status">
108
+ <a data-field_attr="disabled" class="wooccm-field-toggle-attribute" href="#">
109
+ <?php
110
+ if ( $field['disabled'] === true ) {
111
+ echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr( sprintf( esc_html__( 'The "%s" field currently enabled', 'woocommerce-checkout-manager' ), $field['label'] ) ) . '">' . esc_attr__( 'Yes', 'woocommerce-checkout-manager' ) . '</span>';
112
+ } else {
113
+ echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr( sprintf( esc_html__( 'The "%s" field currently disabled', 'woocommerce-checkout-manager' ), $field['label'] ) ) . '">' . esc_attr__( 'No', 'woocommerce-checkout-manager' ) . '</span>';
114
+ }
115
+ ?>
116
+ </a>
117
+ </td>
118
+ <td class="edit">
119
+ <a class="<?php printf( 'wooccm_%s_settings_edit', $current_section ); ?> button" aria-label="<?php esc_html_e( 'Edit checkout field', 'woocommerce-checkout-manager' ); ?>" href="javascript:;"><?php esc_html_e( 'Edit' ); ?></a>
120
+ </td>
121
+ <td class="delete">
122
+ <?php if ( is_array( $defaults ) && ! in_array( $field['key'], array_column( $defaults, 'key' ) ) ) : ?>
123
+ <a class="<?php printf( 'wooccm_%s_settings_delete', $current_section ); ?>" aria-label="<?php esc_html_e( 'Edit checkout field', 'woocommerce-checkout-manager' ); ?>" href="javascript:;"><?php esc_html_e( 'Delete' ); ?></a>
124
+ <?php endif; ?>
125
+ </td>
126
+ </tr>
127
+ <?php endforeach; ?>
128
+ <?php endif; ?>
129
+ </tbody>
130
+ </table>
131
+ </td>
132
+ </tr>
133
  </tbody>
134
+ </table>
includes/view/backend/pages/parts/tabs.php CHANGED
@@ -1,5 +1,5 @@
1
  <ul class="subsubsub">
2
- <?php do_action('wooccm_sections_header'); ?>
3
- <li><a target="_blank" href="<?php echo WOOCCM_DOCUMENTATION_URL; ?>"><?php echo esc_html__('Documentation', 'woocommerce-checkout-manager'); ?></a></li>
4
  </ul>
5
- <br class="clear" />
1
  <ul class="subsubsub">
2
+ <?php do_action( 'wooccm_sections_header' ); ?>
3
+ <li><a target="_blank" href="<?php echo WOOCCM_DOCUMENTATION_URL; ?>"><?php echo esc_html__( 'Documentation', 'woocommerce-checkout-manager' ); ?></a></li>
4
  </ul>
5
+ <br class="clear" />
includes/view/backend/pages/premium.php CHANGED
@@ -1,64 +1,64 @@
1
- <?php include_once('parts/header.php' ); ?>
2
  <div class="wrap about-wrap full-width-layout">
3
  <div class="has-2-columns is-wider-left" style="max-width: 100%">
4
- <div class="column">
5
- <div class="welcome-header">
6
- <h1><?php esc_html_e('Premium', 'woocommerce-checkout-manager'); ?></h1>
7
- <div class="about-description">
8
- <?php printf(esc_html__('%s allows you to customize, add, edit and delete fields displayed on the checkout page. With the premium version you can also create conditional fields and include custom fees based on the checkout fields.', 'woocommerce-checkout-manager'), WOOCCM_PLUGIN_NAME); ?>
9
- </div>
10
- <br/>
11
- <a class="button button-primary" target="_blank" href="<?php echo esc_url(WOOCCM_PURCHASE_URL); ?>"><?php esc_html_e('Purchase Now', 'woocommerce-checkout-manager'); ?></a>
12
- <a class="button button-secondary" target="_blank" href="<?php echo esc_url(WOOCCM_SUPPORT_URL); ?>"><?php esc_html_e('Get Support', 'woocommerce-checkout-manager'); ?></a>
13
- </div>
14
- <hr/>
15
- <div class="feature-section" style="padding: 10px 0;">
16
- <h3><?php esc_html_e('Add checkout fees', 'woocommerce-checkout-manager'); ?></h3>
17
- <p>
18
- <?php printf(esc_html__('%s allows you to include fees to each custom or core field. Fees can be fixed or percentage amounts based on checkout total.', 'woocommerce-checkout-manager'), WOOCCM_PLUGIN_NAME); ?>
19
- </p>
20
- </div>
21
- <div class="feature-section" style="padding: 10px 0;">
22
- <h3><?php esc_html_e('Remove account fields', 'woocommerce-checkout-manager'); ?></h3>
23
- <p>
24
- <?php esc_html_e('By default all fields attached to the billing or shipping sections are included in the edit address area of the user account page. With the premium version, you can hide the fields on the checkout or my account page.', 'woocommerce-checkout-manager'); ?>
25
- </p>
26
- </div>
27
- <div class="feature-section" style="padding: 10px 0;">
28
- <h3><?php esc_html_e('Enhance select fields', 'woocommerce-checkout-manager'); ?></h3>
29
- <p>
30
- <?php esc_html_e('The enhance options allow you to improve the behavior of the select and multiselect fields with the select2 jquery plugin.', 'woocommerce-checkout-manager'); ?>
31
- </p>
32
- </div>
33
- </div>
34
- <div class="column">
35
- <img src="<?php echo plugins_url('/assets/backend/img/fees.png', WOOCCM_PLUGIN_FILE); ?>">
36
- </div>
37
  </div>
38
- <hr/>
39
  <div class="has-2-columns" style="max-width: 100%">
40
- <div class="column">
41
- <img style="margin-top: -30px" src="<?php echo plugins_url('/assets/backend/img/admin.png', WOOCCM_PLUGIN_FILE); ?>">
42
- </div>
43
- <div class="column">
44
- <div class="feature-section" style="padding: 10px 0;">
45
- <h3><?php esc_html_e('Display on admin list orders', 'woocommerce-checkout-manager'); ?></h3>
46
- <p>
47
- <?php esc_html_e('This option allows you to display the fields in the WooCommerce order list.', 'woocommerce-checkout-manager'); ?>
48
- </p>
49
- </div>
50
- <div class="feature-section" style="padding: 10px 0;">
51
- <h3><?php esc_html_e('Allow sorting on admin list orders', 'woocommerce-checkout-manager'); ?></h3>
52
- <p>
53
- <?php esc_html_e('This option allows you to sort the WooCommerce orders list based on the field values.', 'woocommerce-checkout-manager'); ?>
54
- </p>
55
- </div>
56
- <div class="feature-section" style="padding: 10px 0;">
57
- <h3><?php esc_html_e('Allow filtering on admin list orders', 'woocommerce-checkout-manager'); ?></h3>
58
- <p>
59
- <?php esc_html_e('This option allows you to add a search field to filter the options based on the selected values.', 'woocommerce-checkout-manager'); ?>
60
- </p>
61
- </div>
62
- </div>
63
  </div>
64
- </div>
1
+ <?php require_once 'parts/header.php'; ?>
2
  <div class="wrap about-wrap full-width-layout">
3
  <div class="has-2-columns is-wider-left" style="max-width: 100%">
4
+ <div class="column">
5
+ <div class="welcome-header">
6
+ <h1><?php esc_html_e( 'Premium', 'woocommerce-checkout-manager' ); ?></h1>
7
+ <div class="about-description">
8
+ <?php printf( esc_html__( '%s allows you to customize, add, edit and delete fields displayed on the checkout page. With the premium version you can also create conditional fields and include custom fees based on the checkout fields.', 'woocommerce-checkout-manager' ), WOOCCM_PLUGIN_NAME ); ?>
9
+ </div>
10
+ <br />
11
+ <a class="button button-primary" target="_blank" href="<?php echo esc_url( WOOCCM_PURCHASE_URL ); ?>"><?php esc_html_e( 'Purchase Now', 'woocommerce-checkout-manager' ); ?></a>
12
+ <a class="button button-secondary" target="_blank" href="<?php echo esc_url( WOOCCM_SUPPORT_URL ); ?>"><?php esc_html_e( 'Get Support', 'woocommerce-checkout-manager' ); ?></a>
13
+ </div>
14
+ <hr />
15
+ <div class="feature-section" style="padding: 10px 0;">
16
+ <h3><?php esc_html_e( 'Add checkout fees', 'woocommerce-checkout-manager' ); ?></h3>
17
+ <p>
18
+ <?php printf( esc_html__( '%s allows you to include fees to each custom or core field. Fees can be fixed or percentage amounts based on checkout total.', 'woocommerce-checkout-manager' ), WOOCCM_PLUGIN_NAME ); ?>
19
+ </p>
20
+ </div>
21
+ <div class="feature-section" style="padding: 10px 0;">
22
+ <h3><?php esc_html_e( 'Remove account fields', 'woocommerce-checkout-manager' ); ?></h3>
23
+ <p>
24
+ <?php esc_html_e( 'By default all fields attached to the billing or shipping sections are included in the edit address area of the user account page. With the premium version, you can hide the fields on the checkout or my account page.', 'woocommerce-checkout-manager' ); ?>
25
+ </p>
26
+ </div>
27
+ <div class="feature-section" style="padding: 10px 0;">
28
+ <h3><?php esc_html_e( 'Enhance select fields', 'woocommerce-checkout-manager' ); ?></h3>
29
+ <p>
30
+ <?php esc_html_e( 'The enhance options allow you to improve the behavior of the select and multiselect fields with the select2 jquery plugin.', 'woocommerce-checkout-manager' ); ?>
31
+ </p>
32
+ </div>
33
+ </div>
34
+ <div class="column">
35
+ <img src="<?php echo plugins_url( '/assets/backend/img/fees.png', WOOCCM_PLUGIN_FILE ); ?>">
36
+ </div>
37
  </div>
38
+ <hr />
39
  <div class="has-2-columns" style="max-width: 100%">
40
+ <div class="column">
41
+ <img style="margin-top: -30px" src="<?php echo plugins_url( '/assets/backend/img/admin.png', WOOCCM_PLUGIN_FILE ); ?>">
42
+ </div>
43
+ <div class="column">
44
+ <div class="feature-section" style="padding: 10px 0;">
45
+ <h3><?php esc_html_e( 'Display on admin list orders', 'woocommerce-checkout-manager' ); ?></h3>
46
+ <p>
47
+ <?php esc_html_e( 'This option allows you to display the fields in the WooCommerce order list.', 'woocommerce-checkout-manager' ); ?>
48
+ </p>
49
+ </div>
50
+ <div class="feature-section" style="padding: 10px 0;">
51
+ <h3><?php esc_html_e( 'Allow sorting on admin list orders', 'woocommerce-checkout-manager' ); ?></h3>
52
+ <p>
53
+ <?php esc_html_e( 'This option allows you to sort the WooCommerce orders list based on the field values.', 'woocommerce-checkout-manager' ); ?>
54
+ </p>
55
+ </div>
56
+ <div class="feature-section" style="padding: 10px 0;">
57
+ <h3><?php esc_html_e( 'Allow filtering on admin list orders', 'woocommerce-checkout-manager' ); ?></h3>
58
+ <p>
59
+ <?php esc_html_e( 'This option allows you to add a search field to filter the options based on the selected values.', 'woocommerce-checkout-manager' ); ?>
60
+ </p>
61
+ </div>
62
+ </div>
63
  </div>
64
+ </div>
includes/view/backend/pages/shipping.php CHANGED
@@ -1,9 +1,9 @@
1
- <?php include_once( 'parts/tabs.php' ); ?>
2
- <h1 class="screen-reader-text"><?php esc_html_e('Shipping', 'woocommerce-checkout-manager'); ?></h1>
3
- <h2><?php esc_html_e('Shipping 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( 'Shipping', 'woocommerce-checkout-manager' ); ?></h1>
3
+ <h2><?php esc_html_e( 'Shipping 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/suggestions.php CHANGED
@@ -1,27 +1,28 @@
1
  <style>
2
  @media screen and (max-width: 2299px) and (min-width: 1600px) {
3
 
4
- #the-list {
5
- display: flex;
6
- flex-wrap: wrap;
7
- }
8
- .plugin-card {
9
- margin: 8px !important;
10
- width: calc(50% - 4px - 16px)!important;
11
- }
 
12
  }
13
  </style>
14
 
15
- <?php include_once('parts/header.php' ); ?>
16
  <div class="wrap" style="
17
- position: relative;
18
- margin: 25px 40px 0 20px;
19
- max-width: 1200px;">
20
- <?php
21
- $wp_list_table = new WOOCCM_Suggestions_List_Table();
22
- $wp_list_table->prepare_items();
23
- ?>
24
  <form id="plugin-filter" method="post" class="importer-item">
25
- <?php $wp_list_table->display(); ?>
26
  </form>
27
- </div>
1
  <style>
2
  @media screen and (max-width: 2299px) and (min-width: 1600px) {
3
 
4
+ #the-list {
5
+ display: flex;
6
+ flex-wrap: wrap;
7
+ }
8
+
9
+ .plugin-card {
10
+ margin: 8px !important;
11
+ width: calc(50% - 4px - 16px) !important;
12
+ }
13
  }
14
  </style>
15
 
16
+ <?php require_once 'parts/header.php'; ?>
17
  <div class="wrap" style="
18
+ position: relative;
19
+ margin: 25px 40px 0 20px;
20
+ max-width: 1200px;">
21
+ <?php
22
+ $wp_list_table = new WOOCCM_Suggestions_List_Table();
23
+ $wp_list_table->prepare_items();
24
+ ?>
25
  <form id="plugin-filter" method="post" class="importer-item">
26
+ <?php $wp_list_table->display(); ?>
27
  </form>
28
+ </div>
includes/view/frontend/class-wooccm-fields-handler.php CHANGED
@@ -200,11 +200,11 @@ class WOOCCM_Fields_Handler
200
  }
201
 
202
  // Number
203
- if ($field['type'] == 'number') {
204
- if ($field['max']) {
205
  $field['custom_attributes']['max'] = (int) $field['max'];
206
  }
207
- if ($field['min']) {
208
  $field['custom_attributes']['min'] = (int) $field['min'];
209
  }
210
  }
@@ -298,7 +298,7 @@ class WOOCCM_Fields_Handler
298
  'state',
299
  'postcode',
300
  ))) {
301
-
302
  $field['class'][] = 'address-field';
303
 
304
  if ($key == 'country') {
200
  }
201
 
202
  // Number
203
+ if ($field['type'] == 'number' ) {
204
+ if ($field['max'] || $field['max'] == 0) {
205
  $field['custom_attributes']['max'] = (int) $field['max'];
206
  }
207
+ if ($field['min'] || $field['min'] == 0) {
208
  $field['custom_attributes']['min'] = (int) $field['min'];
209
  }
210
  }
298
  'state',
299
  'postcode',
300
  ))) {
301
+
302
  $field['class'][] = 'address-field';
303
 
304
  if ($key == 'country') {
includes/view/frontend/class-wooccm-fields-register.php CHANGED
@@ -64,7 +64,7 @@ class WOOCCM_Fields_Register
64
  // when country field is visible default state is set via javascript
65
  if (in_array("{$load_address}_country", $keys)) {
66
  unset($fields[$field_id]['country']);
67
- }
68
  $fields[$field_id]['value'] = get_user_meta(get_current_user_id(), $field['key'], true);
69
  }
70
  }
64
  // when country field is visible default state is set via javascript
65
  if (in_array("{$load_address}_country", $keys)) {
66
  unset($fields[$field_id]['country']);
67
+ }
68
  $fields[$field_id]['value'] = get_user_meta(get_current_user_id(), $field['key'], true);
69
  }
70
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://quadlayers.com/
4
  Tags: woocommerce, woocommerce checkout, field manager, checkout editor, checkout field, shipping field, billing field, order field, additional field
5
  Requires at least: 3.4
6
  Tested up to: 6.0
7
- Stable tag: 5.5.7
8
  WC requires at least: 3.1.0
9
  WC tested up to: 6.5
10
  License: GPLv3
@@ -107,6 +107,10 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
107
 
108
  == Changelog ==
109
 
 
 
 
 
110
  = 5.5.7 =
111
  * Fix: WooCommerce upload files checkout
112
 
4
  Tags: woocommerce, woocommerce checkout, field manager, checkout editor, checkout field, shipping field, billing field, order field, additional field
5
  Requires at least: 3.4
6
  Tested up to: 6.0
7
+ Stable tag: 5.5.8
8
  WC requires at least: 3.1.0
9
  WC tested up to: 6.5
10
  License: GPLv3
107
 
108
  == Changelog ==
109
 
110
+ = 5.5.8 =
111
+ * Fix: Escaping output functions
112
+ * Fix: Input number min and max
113
+
114
  = 5.5.7 =
115
  * Fix: WooCommerce upload files checkout
116
 
templates/order/order-upload-files.php CHANGED
@@ -1,61 +1,61 @@
1
  <div class="wooccm_order_attachments_wrapper">
2
- <h2 class="woocommerce-order-details__title">
3
- <?php echo ( $title = get_option( 'wooccm_order_upload_files_title', false ) ) ? esc_html( $title ) : esc_html__( 'Uploaded files', 'woocommerce-checkout-manager' ); ?>
4
- </h2>
5
- <table class="woocommerce_order_items shop_table">
6
- <thead>
7
- <tr>
8
- <th><?php esc_html_e( 'File', 'woocommerce-checkout-manager' ); ?></th>
9
- <th><?php esc_html_e( 'Filename', 'woocommerce-checkout-manager' ); ?></th>
10
- <th><?php esc_html_e( 'Dimensions', 'woocommerce-checkout-manager' ); ?></th>
11
- <th><?php esc_html_e( 'Extension', ' woocommerce-checkout-manager' ); ?></th>
12
- <th class="column-actions"><?php esc_html_e( 'Actions', 'woocommerce-checkout-manager' ); ?></th>
13
- </tr>
14
- </thead>
15
- <tbody class="product_images">
16
- <?php
17
- if ( ! empty( $attachments ) ) :
18
- foreach ( $attachments as $attachment_id ) :
19
- $image_attributes = wp_get_attachment_url( $attachment_id );
20
- $is_image = wp_attachment_is_image( $attachment_id );
21
- $filename = basename( $image_attributes );
22
- $wp_filetype = wp_check_filetype( $filename );
23
- ?>
24
- <tr class="image">
25
- <td><?php echo wp_get_attachment_link( $attachment_id, '', false, false, wp_get_attachment_image( $attachment_id, array( 75, 75 ), false ) ); ?></td>
26
- <td><?php echo wp_get_attachment_link( $attachment_id, '', false, false, preg_replace( '/\.[^.]+$/', '', $filename ) ); ?></td>
27
- <td>
28
- <?php
29
- if ( $is_image ) {
30
- $sizes = wp_get_attachment_image_src( $attachment_id );
31
 
32
- echo $sizes[1] . 'x' . $sizes[2];
33
- }
34
- ?>
35
- </td>
36
- <td>
37
- <?php echo strtoupper( $wp_filetype['ext'] ); ?>
38
- </td>
39
- <td class="column-actions">
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>
48
- <?php endif; ?>
49
- </tbody>
50
- </table>
51
- <input type="hidden" id="delete_attachments_ids" name="delete_attachments_ids" value="<?php echo esc_attr( implode( ',', $attachments ) ); ?>" />
52
- <input type="hidden" id="all_attachments_ids" name="all_attachments_ids" value="<?php echo esc_attr( implode( ',', $attachments ) ); ?>" />
53
- <p class="order-upload">
54
- <a style="float: left; margin: 0 10px 0 0;" class="button alt fileinput-button">
55
- <span><?php esc_html_e( 'Upload Files', 'woocommerce-checkout-manager' ); ?></span>
56
- <input data-order_id="<?php echo esc_attr( $order->get_id() ); ?>" type="file" name="wooccm_order_attachment_upload" id="wooccm_order_attachment_upload" multiple />
57
- </a>
58
- <input type="button" id="wooccm_order_attachment_update" class="button button-secondary" value="<?php esc_html_e( 'Save Changes', 'woocommerce-checkout-manager' ); ?>" disabled="disabled">
59
- <span class="wooccm_upload_results"></span>
60
- </p>
61
- </div>
1
  <div class="wooccm_order_attachments_wrapper">
2
+ <h2 class="woocommerce-order-details__title">
3
+ <?php echo ($title = get_option('wooccm_order_upload_files_title', false)) ? esc_html($title) : esc_html__('Uploaded files', 'woocommerce-checkout-manager'); ?>
4
+ </h2>
5
+ <table class="woocommerce_order_items shop_table">
6
+ <thead>
7
+ <tr>
8
+ <th><?php esc_html_e('File', 'woocommerce-checkout-manager'); ?></th>
9
+ <th><?php esc_html_e('Filename', 'woocommerce-checkout-manager'); ?></th>
10
+ <th><?php esc_html_e('Dimensions', 'woocommerce-checkout-manager'); ?></th>
11
+ <th><?php esc_html_e('Extension', ' woocommerce-checkout-manager'); ?></th>
12
+ <th class="column-actions"><?php esc_html_e('Actions', 'woocommerce-checkout-manager'); ?></th>
13
+ </tr>
14
+ </thead>
15
+ <tbody class="product_images">
16
+ <?php
17
+ if (!empty($attachments)) :
18
+ foreach ($attachments as $attachment_id) :
19
+ $image_attributes = wp_get_attachment_url($attachment_id);
20
+ $is_image = wp_attachment_is_image($attachment_id);
21
+ $filename = basename($image_attributes);
22
+ $wp_filetype = wp_check_filetype($filename);
23
+ ?>
24
+ <tr class="image">
25
+ <td><?php echo wp_get_attachment_link($attachment_id, '', false, false, wp_get_attachment_image($attachment_id, array(75, 75), false)); ?></td>
26
+ <td><?php echo wp_get_attachment_link($attachment_id, '', false, false, preg_replace('/\.[^.]+$/', '', $filename)); ?></td>
27
+ <td>
28
+ <?php
29
+ if ($is_image) {
30
+ $sizes = wp_get_attachment_image_src($attachment_id);
31
 
32
+ echo $sizes[1] . 'x' . $sizes[2];
33
+ }
34
+ ?>
35
+ </td>
36
+ <td>
37
+ <?php echo strtoupper($wp_filetype['ext']); ?>
38
+ </td>
39
+ <td class="column-actions">
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>
48
+ <?php endif; ?>
49
+ </tbody>
50
+ </table>
51
+ <input type="hidden" id="delete_attachments_ids" name="delete_attachments_ids" value="<?php echo esc_attr(implode(',', $attachments)); ?>" />
52
+ <input type="hidden" id="all_attachments_ids" name="all_attachments_ids" value="<?php echo esc_attr(implode(',', $attachments)); ?>" />
53
+ <p class="order-upload">
54
+ <a style="float: left; margin: 0 10px 0 0;" class="button alt fileinput-button">
55
+ <span><?php esc_html_e('Upload Files', 'woocommerce-checkout-manager'); ?></span>
56
+ <input data-order_id="<?php echo esc_attr($order->get_id()); ?>" type="file" name="wooccm_order_attachment_upload" id="wooccm_order_attachment_upload" multiple />
57
+ </a>
58
+ <input type="button" id="wooccm_order_attachment_update" class="button button-secondary" value="<?php esc_html_e('Save Changes', 'woocommerce-checkout-manager'); ?>" disabled="disabled">
59
+ <span class="wooccm_upload_results"></span>
60
+ </p>
61
+ </div>
woocommerce-checkout-manager.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Checkout Fields Manager for WooCommerce
5
  * Plugin URI: https://quadlayers.com/portfolio/woocommerce-checkout-manager/
6
  * Description: Manages WooCommerce Checkout, the advanced way.
7
- * Version: 5.5.7
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
@@ -12,60 +12,61 @@
12
  * WC requires at least: 3.1.0
13
  * WC tested up to: 6.5
14
  */
15
- if ( ! defined( 'ABSPATH' ) ) {
16
- die( '-1' );
17
  }
18
 
19
- if ( ! defined( 'WOOCCM_PLUGIN_NAME' ) ) {
20
- define( 'WOOCCM_PLUGIN_NAME', 'Checkout Fields Manager for WooCommerce' );
21
  }
22
- if ( ! defined( 'WOOCCM_PLUGIN_VERSION' ) ) {
23
- define( 'WOOCCM_PLUGIN_VERSION', '5.5.7' );
24
  }
25
- if ( ! defined( 'WOOCCM_PLUGIN_FILE' ) ) {
26
- define( 'WOOCCM_PLUGIN_FILE', __FILE__ );
27
  }
28
- if ( ! defined( 'WOOCCM_PLUGIN_DIR' ) ) {
29
- define( 'WOOCCM_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR );
30
  }
31
- if ( ! defined( 'WOOCCM_PREFIX' ) ) {
32
- define( 'WOOCCM_PREFIX', 'wooccm' );
33
  }
34
- if ( ! defined( 'WOOCCM_WORDPRESS_URL' ) ) {
35
- define( 'WOOCCM_WORDPRESS_URL', 'https://wordpress.org/plugins/woocommerce-checkout-manager/' );
36
  }
37
- if ( ! defined( 'WOOCCM_REVIEW_URL' ) ) {
38
- define( 'WOOCCM_REVIEW_URL', 'https://wordpress.org/support/plugin/woocommerce-checkout-manager/reviews/?filter=5#new-post' );
39
  }
40
- if ( ! defined( 'WOOCCM_DOCUMENTATION_URL' ) ) {
41
- define( 'WOOCCM_DOCUMENTATION_URL', 'https://quadlayers.com/documentation/woocommerce-checkout-manager/?utm_source=wooccm_admin' );
42
  }
43
- if ( ! defined( 'WOOCCM_DEMO_URL' ) ) {
44
- define( 'WOOCCM_DEMO_URL', 'https://quadlayers.com/portfolio/woocommerce-checkout-manager/?utm_source=wooccm_admin' );
45
  }
46
- if ( ! defined( 'WOOCCM_PURCHASE_URL' ) ) {
47
- define( 'WOOCCM_PURCHASE_URL', WOOCCM_DEMO_URL );
48
  }
49
- if ( ! defined( 'WOOCCM_SUPPORT_URL' ) ) {
50
- define( 'WOOCCM_SUPPORT_URL', 'https://quadlayers.com/account/support/?utm_source=wooccm_admin' );
51
  }
52
- if ( ! defined( 'WOOCCM_GROUP_URL' ) ) {
53
- define( 'WOOCCM_GROUP_URL', 'https://www.facebook.com/groups/quadlayers' );
54
  }
55
- if ( ! defined( 'WOOCCM_DEVELOPER' ) ) {
56
- define( 'WOOCCM_DEVELOPER', false );
57
  }
58
 
59
- if ( ! class_exists( 'WOOCCM', false ) ) {
60
  include_once WOOCCM_PLUGIN_DIR . 'includes/class-wooccm.php';
61
  }
62
 
63
- if ( ! class_exists( 'QL_Widget' ) ) {
64
  include_once WOOCCM_PLUGIN_DIR . 'includes/quadlayers/widget.php';
65
  }
66
 
67
- function WOOCCM() {
68
- // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
 
69
  return WOOCCM::instance();
70
  }
71
 
4
  * Plugin Name: Checkout Fields Manager for WooCommerce
5
  * Plugin URI: https://quadlayers.com/portfolio/woocommerce-checkout-manager/
6
  * Description: Manages WooCommerce Checkout, the advanced way.
7
+ * Version: 5.5.8
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
12
  * WC requires at least: 3.1.0
13
  * WC tested up to: 6.5
14
  */
15
+ if (!defined('ABSPATH')) {
16
+ die('-1');
17
  }
18
 
19
+ if (!defined('WOOCCM_PLUGIN_NAME')) {
20
+ define('WOOCCM_PLUGIN_NAME', 'Checkout Fields Manager for WooCommerce');
21
  }
22
+ if (!defined('WOOCCM_PLUGIN_VERSION')) {
23
+ define('WOOCCM_PLUGIN_VERSION', '5.5.8');
24
  }
25
+ if (!defined('WOOCCM_PLUGIN_FILE')) {
26
+ define('WOOCCM_PLUGIN_FILE', __FILE__);
27
  }
28
+ if (!defined('WOOCCM_PLUGIN_DIR')) {
29
+ define('WOOCCM_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR);
30
  }
31
+ if (!defined('WOOCCM_PREFIX')) {
32
+ define('WOOCCM_PREFIX', 'wooccm');
33
  }
34
+ if (!defined('WOOCCM_WORDPRESS_URL')) {
35
+ define('WOOCCM_WORDPRESS_URL', 'https://wordpress.org/plugins/woocommerce-checkout-manager/');
36
  }
37
+ if (!defined('WOOCCM_REVIEW_URL')) {
38
+ define('WOOCCM_REVIEW_URL', 'https://wordpress.org/support/plugin/woocommerce-checkout-manager/reviews/?filter=5#new-post');
39
  }
40
+ if (!defined('WOOCCM_DOCUMENTATION_URL')) {
41
+ define('WOOCCM_DOCUMENTATION_URL', 'https://quadlayers.com/documentation/woocommerce-checkout-manager/?utm_source=wooccm_admin');
42
  }
43
+ if (!defined('WOOCCM_DEMO_URL')) {
44
+ define('WOOCCM_DEMO_URL', 'https://quadlayers.com/portfolio/woocommerce-checkout-manager/?utm_source=wooccm_admin');
45
  }
46
+ if (!defined('WOOCCM_PURCHASE_URL')) {
47
+ define('WOOCCM_PURCHASE_URL', WOOCCM_DEMO_URL);
48
  }
49
+ if (!defined('WOOCCM_SUPPORT_URL')) {
50
+ define('WOOCCM_SUPPORT_URL', 'https://quadlayers.com/account/support/?utm_source=wooccm_admin');
51
  }
52
+ if (!defined('WOOCCM_GROUP_URL')) {
53
+ define('WOOCCM_GROUP_URL', 'https://www.facebook.com/groups/quadlayers');
54
  }
55
+ if (!defined('WOOCCM_DEVELOPER')) {
56
+ define('WOOCCM_DEVELOPER', false);
57
  }
58
 
59
+ if (!class_exists('WOOCCM', false)) {
60
  include_once WOOCCM_PLUGIN_DIR . 'includes/class-wooccm.php';
61
  }
62
 
63
+ if (!class_exists('QL_Widget')) {
64
  include_once WOOCCM_PLUGIN_DIR . 'includes/quadlayers/widget.php';
65
  }
66
 
67
+ function WOOCCM()
68
+ {
69
+ // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
70
  return WOOCCM::instance();
71
  }
72