WooCommerce Checkout Manager - Version 6.0.1

Version Description

  • Fix: Default show aditional checkout fields in order
Download this release

Release Info

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

Code changes from version 6.0.0 to 6.0.1

includes/controller/class-wooccm-order.php CHANGED
@@ -1,323 +1,306 @@
1
  <?php
2
 
3
- class WOOCCM_Order_Controller extends WOOCCM_Upload
4
- {
5
 
6
- protected static $_instance;
7
 
8
- public function __construct()
9
- {
10
- add_action('admin_enqueue_scripts', array($this, 'admin_scripts'));
11
- add_action('wp_enqueue_scripts', array($this, 'frontend_scripts'));
12
- add_action('wp_ajax_wooccm_order_attachment_upload', array($this, 'ajax_order_attachment_upload'));
13
- add_action('wp_ajax_nopriv_wooccm_order_attachment_upload', array($this, 'ajax_order_attachment_upload'));
14
 
15
- // Order
16
- //--------------------------------------------------------------------------
17
- add_action('add_meta_boxes', array($this, 'add_metabox'));
 
 
18
 
19
- // Panel
20
- // -------------------------------------------------------------------------
21
- add_action('wooccm_sections_header', array($this, 'add_header'));
22
- add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'), 99);
23
- add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_settings'));
24
 
25
- // Frontend
26
- // -------------------------------------------------------------------------
 
 
 
27
 
28
- add_action('woocommerce_thankyou', array($this, 'add_upload_files'));
29
- add_action('woocommerce_view_order', array($this, 'add_upload_files'));
30
 
31
- add_action('woocommerce_thankyou', array($this, 'add_custom_fields'));
32
- add_action('woocommerce_view_order', array($this, 'add_custom_fields'));
33
 
34
- // Compatibility
35
- // -------------------------------------------------------------------------
36
 
37
- add_filter('default_option_wooccm_order_upload_files', array($this, 'enable_file_upload'));
38
- add_filter('default_option_wooccm_order_upload_files_order_status', array($this, 'upload_os'));
39
- add_filter('default_option_wooccm_order_upload_files_title', array($this, 'upload_title'));
40
- }
41
 
42
- public static function instance()
43
- {
44
- if (is_null(self::$_instance)) {
45
- self::$_instance = new self();
46
- }
47
- return self::$_instance;
48
- }
49
 
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
 
63
- public function admin_scripts()
64
- {
65
 
66
- if (is_admin() && $screen = get_current_screen()) {
 
 
 
 
 
 
 
 
 
 
67
 
68
- if (in_array($screen->id, array(/* 'product', 'edit-product', */'shop_order', 'edit-shop_order'))) {
69
-
70
- WOOCCM()->register_scripts();
71
-
72
- wp_enqueue_script('wooccm-order-upload');
73
- }
74
- }
75
- }
76
-
77
- public function ajax_order_attachment_upload()
78
- {
79
-
80
- if (!empty($_REQUEST) && check_admin_referer('wooccm_upload', 'nonce')) {
81
-
82
- $files = (isset($_FILES['wooccm_order_attachment_upload']) ? $_FILES['wooccm_order_attachment_upload'] : false);
83
-
84
- if (empty($files)) {
85
- //wc_order_notice(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
86
- wp_send_json_error(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
87
- }
88
-
89
- $order_id = (isset($_REQUEST['order_id']) ? absint($_REQUEST['order_id']) : false);
90
-
91
- if (empty($order_id)) {
92
- wp_send_json_error(esc_html__('Empty order id.', 'woocommerce-checkout-manager'));
93
- }
94
-
95
- if (!$post = get_post($order_id)) {
96
- wp_send_json_error(esc_html__('Invalid order id.', 'woocommerce-checkout-manager'));
97
- }
98
-
99
- if (count($attachment_ids = $this->process_uploads($files, 'wooccm_order_attachment_upload', $order_id))) {
100
-
101
- ob_start();
102
-
103
- if (!empty($_REQUEST['metabox'])) {
104
- $this->add_metabox_content($post);
105
- } else {
106
- $this->add_upload_files($post->ID);
107
- }
108
-
109
- wp_send_json_success(ob_get_clean());
110
- }
111
- wp_send_json_error(esc_html__('Unknow error.', 'woocommerce-checkout-manager'));
112
- }
113
- }
114
-
115
- public function add_upload_files($order_id)
116
- {
117
-
118
- if (get_option('wooccm_order_upload_files', 'no') === 'yes') {
119
-
120
- if ($order = wc_get_order($order_id)) {
121
-
122
- if (in_array("wc-{$order->get_status()}", array_values(get_option('wooccm_order_upload_files_order_status', array())))) {
123
-
124
- $attachments = get_posts(
125
- array(
126
- 'fields' => 'ids',
127
- 'post_type' => 'attachment',
128
- 'numberposts' => -1,
129
- 'post_status' => null,
130
- 'post_parent' => $order->get_id()
131
- )
132
- );
133
-
134
- wc_get_template('templates/order/order-upload-files.php', array('order' => $order, 'attachments' => $attachments), '', WOOCCM_PLUGIN_DIR);
135
- }
136
- }
137
- }
138
- }
139
-
140
- public function add_custom_fields($order_id)
141
- {
142
-
143
- if (get_option('wooccm_order_custom_fields', 'no') === 'yes') {
144
-
145
- if ($order = wc_get_order($order_id)) {
146
-
147
- if (in_array("wc-{$order->get_status()}", array_values(get_option('wooccm_order_custom_fields_status', array())))) {
148
-
149
- wc_get_template('templates/order/order-custom-fields.php', array('order_id' => $order_id), '', WOOCCM_PLUGIN_DIR);
150
- }
151
- }
152
- }
153
- }
154
-
155
- public function add_metabox_content($post)
156
- {
157
-
158
- if ($order = wc_get_order($post->ID)) {
159
-
160
- $attachments = get_posts(array(
161
- 'fields' => 'ids',
162
- 'post_type' => 'attachment',
163
- 'numberposts' => -1,
164
- 'post_status' => null,
165
- 'post_parent' => $order->get_id()
166
- ));
167
- include WOOCCM_PLUGIN_DIR . 'includes/view/backend/meta-boxes/html-order-uploads.php';
168
- }
169
- }
170
-
171
- // Admin
172
- // -------------------------------------------------------------------------
173
-
174
- public function add_metabox()
175
- {
176
- add_meta_box('wooccm-order-files', esc_html__('Order Files', 'woocommerce-checkout-manager'), array($this, 'add_metabox_content'), 'shop_order', 'normal', 'default');
177
- }
178
-
179
- // Panel
180
- // ---------------------------------------------------------------------------
181
-
182
- public function get_settings()
183
- {
184
- return array(
185
- array(
186
- 'type' => 'title',
187
- 'id' => 'section_title'
188
- ),
189
- array(
190
- 'name' => esc_html__('Add upload files', 'woocommerce-checkout-manager'),
191
- 'desc_tip' => esc_html__('Allow customers to upload files in the order.', 'woocommerce-checkout-manager'),
192
- 'id' => 'wooccm_order_upload_files',
193
- 'type' => 'select',
194
- 'class' => 'chosen_select',
195
- 'options' => array(
196
- 'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
197
- 'no' => esc_html__('No', 'woocommerce-checkout-manager'),
198
- ),
199
- 'default' => 'no',
200
- ),
201
- array(
202
- 'name' => esc_html__('Add for this order status', 'woocommerce-checkout-manager'),
203
- 'desc_tip' => esc_html__('Allow customers to upload files in the order.', 'woocommerce-checkout-manager'),
204
- 'id' => 'wooccm_order_upload_files_order_status',
205
- 'type' => 'multiselect',
206
- 'class' => 'chosen_select',
207
- 'options' => wc_get_order_statuses(),
208
- 'default' => array_keys(wc_get_order_statuses()),
209
- ),
210
- array(
211
- 'name' => esc_html__('Add upload files title', 'woocommerce-checkout-manager'),
212
- 'desc_tip' => esc_html__('Add custom title for the uploads files table.', 'woocommerce-checkout-manager'),
213
- 'id' => 'wooccm_order_upload_files_title',
214
- 'type' => 'text',
215
- 'placeholder' => esc_html__('Uploaded files', 'woocommerce-checkout-manager')
216
- ),
217
- array(
218
- 'name' => esc_html__('Add custom fields', 'woocommerce-checkout-manager'),
219
- 'desc_tip' => esc_html__('Show the selected fields in the order.', 'woocommerce-checkout-manager'),
220
- 'id' => 'wooccm_order_custom_fields',
221
- 'type' => 'select',
222
- 'class' => 'chosen_select',
223
- 'options' => array(
224
- 'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
225
- 'no' => esc_html__('No', 'woocommerce-checkout-manager'),
226
- ),
227
- 'default' => 'no',
228
- ),
229
- array(
230
- 'name' => esc_html__('Add for this order status', 'woocommerce-checkout-manager'),
231
- 'desc_tip' => esc_html__('Allow customers to upload files in the order.', 'woocommerce-checkout-manager'),
232
- 'id' => 'wooccm_order_custom_fields_status',
233
- 'type' => 'multiselect',
234
- 'class' => 'chosen_select',
235
- 'options' => wc_get_order_statuses(),
236
- 'default' => array_keys(wc_get_order_statuses()),
237
- ),
238
- array(
239
- 'name' => esc_html__('Add custom fields title', 'woocommerce-checkout-manager'),
240
- 'desc_tip' => esc_html__('Add custom title for the uploads files table.', 'woocommerce-checkout-manager'),
241
- 'id' => 'wooccm_order_custom_fields_title',
242
- 'type' => 'text',
243
- 'placeholder' => esc_html__('Order extra', 'woocommerce-checkout-manager')
244
- ),
245
- array(
246
- 'type' => 'sectionend',
247
- 'id' => 'section_end'
248
- )
249
- );
250
- }
251
-
252
- public function add_header()
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
-
260
- public function add_section()
261
- {
262
-
263
- global $current_section;
264
-
265
- if ('order' == $current_section) {
266
-
267
- $settings = $this->get_settings();
268
-
269
- include_once(WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/order.php');
270
- }
271
- }
272
-
273
- public function save_settings()
274
- {
275
-
276
- global $current_section;
277
-
278
- if ('order' == $current_section) {
279
- woocommerce_update_options($this->get_settings());
280
- }
281
- }
282
-
283
- // Compatibility
284
- // -------------------------------------------------------------------------
285
-
286
- public function enable_file_upload($value)
287
- {
288
-
289
- $options = get_option('wccs_settings');
290
-
291
- if (!empty($options['checkness']['enable_file_upload'])) {
292
- return 'yes';
293
- }
294
-
295
- return $value;
296
- }
297
-
298
- public function upload_os($value)
299
- {
300
-
301
- $options = get_option('wccs_settings');
302
-
303
- if (!empty($options['checkness']['upload_os'])) {
304
- return (array) @implode(',', $options['checkness']['upload_os']);
305
- }
306
-
307
- return $value;
308
- }
309
-
310
- public function upload_title($value)
311
- {
312
-
313
- $options = get_option('wccs_settings');
314
-
315
- if (!empty($options['checkness']['upload_title'])) {
316
- return $options['checkness']['upload_title'];
317
- }
318
-
319
- return $value;
320
- }
321
  }
322
 
323
  WOOCCM_Order_Controller::instance();
1
  <?php
2
 
3
+ class WOOCCM_Order_Controller extends WOOCCM_Upload {
 
4
 
 
5
 
6
+ protected static $_instance;
 
 
 
 
 
7
 
8
+ public function __construct() {
9
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
10
+ add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ) );
11
+ add_action( 'wp_ajax_wooccm_order_attachment_upload', array( $this, 'ajax_order_attachment_upload' ) );
12
+ add_action( 'wp_ajax_nopriv_wooccm_order_attachment_upload', array( $this, 'ajax_order_attachment_upload' ) );
13
 
14
+ // Order
15
+ // --------------------------------------------------------------------------
16
+ add_action( 'add_meta_boxes', array( $this, 'add_metabox' ) );
 
 
17
 
18
+ // Panel
19
+ // -------------------------------------------------------------------------
20
+ add_action( 'wooccm_sections_header', array( $this, 'add_header' ) );
21
+ add_action( 'woocommerce_sections_' . WOOCCM_PREFIX, array( $this, 'add_section' ), 99 );
22
+ add_action( 'woocommerce_settings_save_' . WOOCCM_PREFIX, array( $this, 'save_settings' ) );
23
 
24
+ // Frontend
25
+ // -------------------------------------------------------------------------
26
 
27
+ add_action( 'woocommerce_thankyou', array( $this, 'add_upload_files' ) );
28
+ add_action( 'woocommerce_view_order', array( $this, 'add_upload_files' ) );
29
 
30
+ add_action( 'woocommerce_thankyou', array( $this, 'add_custom_fields' ) );
31
+ add_action( 'woocommerce_view_order', array( $this, 'add_custom_fields' ) );
32
 
33
+ // Compatibility
34
+ // -------------------------------------------------------------------------
 
 
35
 
36
+ add_filter( 'default_option_wooccm_order_upload_files', array( $this, 'enable_file_upload' ) );
37
+ add_filter( 'default_option_wooccm_order_upload_files_order_status', array( $this, 'upload_os' ) );
38
+ add_filter( 'default_option_wooccm_order_upload_files_title', array( $this, 'upload_title' ) );
39
+ }
 
 
 
40
 
41
+ public static function instance() {
42
+ if ( is_null( self::$_instance ) ) {
43
+ self::$_instance = new self();
44
+ }
45
+ return self::$_instance;
46
+ }
47
 
48
+ public function frontend_scripts() {
49
+ if ( is_account_page() || ! empty( is_wc_endpoint_url( 'order-received' ) ) ) {
50
 
51
+ WOOCCM()->register_scripts();
52
 
53
+ wp_enqueue_style( 'wooccm' );
54
+ wp_enqueue_style( 'dashicons' );
55
+ wp_enqueue_script( 'wooccm-order-upload' );
56
+ }
57
+ }
58
 
59
+ public function admin_scripts() {
60
+ if ( is_admin() && $screen = get_current_screen() ) {
61
 
62
+ if ( in_array( $screen->id, array( /* 'product', 'edit-product', */'shop_order', 'edit-shop_order' ) ) ) {
63
+
64
+ WOOCCM()->register_scripts();
65
+
66
+ wp_enqueue_script( 'wooccm-order-upload' );
67
+ }
68
+ }
69
+ }
70
+
71
+ public function ajax_order_attachment_upload() {
72
+ if ( ! empty( $_REQUEST ) && check_admin_referer( 'wooccm_upload', 'nonce' ) ) {
73
 
74
+ $files = ( isset( $_FILES['wooccm_order_attachment_upload'] ) ? $_FILES['wooccm_order_attachment_upload'] : false );
75
+
76
+ if ( empty( $files ) ) {
77
+ // wc_order_notice(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
78
+ wp_send_json_error( esc_html__( 'No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager' ), 'error' );
79
+ }
80
+
81
+ $order_id = ( isset( $_REQUEST['order_id'] ) ? absint( $_REQUEST['order_id'] ) : false );
82
+
83
+ if ( empty( $order_id ) ) {
84
+ wp_send_json_error( esc_html__( 'Empty order id.', 'woocommerce-checkout-manager' ) );
85
+ }
86
+
87
+ if ( ! $post = get_post( $order_id ) ) {
88
+ wp_send_json_error( esc_html__( 'Invalid order id.', 'woocommerce-checkout-manager' ) );
89
+ }
90
+
91
+ if ( count( $attachment_ids = $this->process_uploads( $files, 'wooccm_order_attachment_upload', $order_id ) ) ) {
92
+
93
+ ob_start();
94
+
95
+ if ( ! empty( $_REQUEST['metabox'] ) ) {
96
+ $this->add_metabox_content( $post );
97
+ } else {
98
+ $this->add_upload_files( $post->ID );
99
+ }
100
+
101
+ wp_send_json_success( ob_get_clean() );
102
+ }
103
+ wp_send_json_error( esc_html__( 'Unknow error.', 'woocommerce-checkout-manager' ) );
104
+ }
105
+ }
106
+
107
+ public function add_upload_files( $order_id ) {
108
+ if ( get_option( 'wooccm_order_upload_files', 'no' ) === 'yes' ) {
109
+
110
+ if ( $order = wc_get_order( $order_id ) ) {
111
+
112
+ if ( in_array( "wc-{$order->get_status()}", array_values( get_option( 'wooccm_order_upload_files_order_status', array() ) ) ) ) {
113
+
114
+ $attachments = get_posts(
115
+ array(
116
+ 'fields' => 'ids',
117
+ 'post_type' => 'attachment',
118
+ 'numberposts' => -1,
119
+ 'post_status' => null,
120
+ 'post_parent' => $order->get_id(),
121
+ )
122
+ );
123
+
124
+ wc_get_template(
125
+ 'templates/order/order-upload-files.php',
126
+ array(
127
+ 'order' => $order,
128
+ 'attachments' => $attachments,
129
+ ),
130
+ '',
131
+ WOOCCM_PLUGIN_DIR
132
+ );
133
+ }
134
+ }
135
+ }
136
+ }
137
+
138
+ public function add_custom_fields( $order_id ) {
139
+ if ( get_option( 'wooccm_order_custom_fields', 'yes' ) === 'yes' ) {
140
+
141
+ if ( $order = wc_get_order( $order_id ) ) {
142
+
143
+ if ( in_array( "wc-{$order->get_status()}", array_values( get_option( 'wooccm_order_custom_fields_status', array_keys( wc_get_order_statuses() ) ) ) ) ) {
144
+
145
+ wc_get_template( 'templates/order/order-custom-fields.php', array( 'order_id' => $order_id ), '', WOOCCM_PLUGIN_DIR );
146
+ }
147
+ }
148
+ }
149
+ }
150
+
151
+ public function add_metabox_content( $post ) {
152
+ if ( $order = wc_get_order( $post->ID ) ) {
153
+
154
+ $attachments = get_posts(
155
+ array(
156
+ 'fields' => 'ids',
157
+ 'post_type' => 'attachment',
158
+ 'numberposts' => -1,
159
+ 'post_status' => null,
160
+ 'post_parent' => $order->get_id(),
161
+ )
162
+ );
163
+ include WOOCCM_PLUGIN_DIR . 'includes/view/backend/meta-boxes/html-order-uploads.php';
164
+ }
165
+ }
166
+
167
+ // Admin
168
+ // -------------------------------------------------------------------------
169
+
170
+ public function add_metabox() {
171
+ add_meta_box( 'wooccm-order-files', esc_html__( 'Order Files', 'woocommerce-checkout-manager' ), array( $this, 'add_metabox_content' ), 'shop_order', 'normal', 'default' );
172
+ }
173
+
174
+ // Panel
175
+ // ---------------------------------------------------------------------------
176
+
177
+ public function get_settings() {
178
+ return array(
179
+ array(
180
+ 'type' => 'title',
181
+ 'id' => 'section_title',
182
+ ),
183
+ array(
184
+ 'name' => esc_html__( 'Add upload files', 'woocommerce-checkout-manager' ),
185
+ 'desc_tip' => esc_html__( 'Allow customers to upload files in the order.', 'woocommerce-checkout-manager' ),
186
+ 'id' => 'wooccm_order_upload_files',
187
+ 'type' => 'select',
188
+ 'class' => 'chosen_select',
189
+ 'options' => array(
190
+ 'yes' => esc_html__( 'Yes', 'woocommerce-checkout-manager' ),
191
+ 'no' => esc_html__( 'No', 'woocommerce-checkout-manager' ),
192
+ ),
193
+ 'default' => 'no',
194
+ ),
195
+ array(
196
+ 'name' => esc_html__( 'Add for this order status', 'woocommerce-checkout-manager' ),
197
+ 'desc_tip' => esc_html__( 'Allow customers to upload files in the order.', 'woocommerce-checkout-manager' ),
198
+ 'id' => 'wooccm_order_upload_files_order_status',
199
+ 'type' => 'multiselect',
200
+ 'class' => 'chosen_select',
201
+ 'options' => wc_get_order_statuses(),
202
+ 'default' => array_keys( wc_get_order_statuses() ),
203
+ ),
204
+ array(
205
+ 'name' => esc_html__( 'Add upload files title', 'woocommerce-checkout-manager' ),
206
+ 'desc_tip' => esc_html__( 'Add custom title for the uploads files table.', 'woocommerce-checkout-manager' ),
207
+ 'id' => 'wooccm_order_upload_files_title',
208
+ 'type' => 'text',
209
+ 'placeholder' => esc_html__( 'Uploaded files', 'woocommerce-checkout-manager' ),
210
+ ),
211
+ array(
212
+ 'name' => esc_html__( 'Add custom fields', 'woocommerce-checkout-manager' ),
213
+ 'desc_tip' => esc_html__( 'Show the selected fields in the order.', 'woocommerce-checkout-manager' ),
214
+ 'id' => 'wooccm_order_custom_fields',
215
+ 'type' => 'select',
216
+ 'class' => 'chosen_select',
217
+ 'options' => array(
218
+ 'yes' => esc_html__( 'Yes', 'woocommerce-checkout-manager' ),
219
+ 'no' => esc_html__( 'No', 'woocommerce-checkout-manager' ),
220
+ ),
221
+ 'default' => 'yes',
222
+ ),
223
+ array(
224
+ 'name' => esc_html__( 'Add for this order status', 'woocommerce-checkout-manager' ),
225
+ 'desc_tip' => esc_html__( 'Allow customers to upload files in the order.', 'woocommerce-checkout-manager' ),
226
+ 'id' => 'wooccm_order_custom_fields_status',
227
+ 'type' => 'multiselect',
228
+ 'class' => 'chosen_select',
229
+ 'options' => wc_get_order_statuses(),
230
+ 'default' => array_keys( wc_get_order_statuses() ),
231
+ ),
232
+ array(
233
+ 'name' => esc_html__( 'Add custom fields title', 'woocommerce-checkout-manager' ),
234
+ 'desc_tip' => esc_html__( 'Add custom title for the uploads files table.', 'woocommerce-checkout-manager' ),
235
+ 'id' => 'wooccm_order_custom_fields_title',
236
+ 'type' => 'text',
237
+ 'placeholder' => esc_html__( 'Order extra', 'woocommerce-checkout-manager' ),
238
+ ),
239
+ array(
240
+ 'type' => 'sectionend',
241
+ 'id' => 'section_end',
242
+ ),
243
+ );
244
+ }
245
+
246
+ public function add_header() {
247
+ global $current_section;
248
+ ?>
249
+ <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>
250
+ <?php
251
+ }
252
+
253
+ public function add_section() {
254
+ global $current_section;
255
+
256
+ if ( 'order' == $current_section ) {
257
+
258
+ $settings = $this->get_settings();
259
+
260
+ include_once WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/order.php';
261
+ }
262
+ }
263
+
264
+ public function save_settings() {
265
+ global $current_section;
266
+
267
+ if ( 'order' == $current_section ) {
268
+ woocommerce_update_options( $this->get_settings() );
269
+ }
270
+ }
271
+
272
+ // Compatibility
273
+ // -------------------------------------------------------------------------
274
+
275
+ public function enable_file_upload( $value ) {
276
+ $options = get_option( 'wccs_settings' );
277
+
278
+ if ( ! empty( $options['checkness']['enable_file_upload'] ) ) {
279
+ return 'yes';
280
+ }
281
+
282
+ return $value;
283
+ }
284
+
285
+ public function upload_os( $value ) {
286
+ $options = get_option( 'wccs_settings' );
287
+
288
+ if ( ! empty( $options['checkness']['upload_os'] ) ) {
289
+ return (array) @implode( ',', $options['checkness']['upload_os'] );
290
+ }
291
+
292
+ return $value;
293
+ }
294
+
295
+ public function upload_title( $value ) {
296
+ $options = get_option( 'wccs_settings' );
297
+
298
+ if ( ! empty( $options['checkness']['upload_title'] ) ) {
299
+ return $options['checkness']['upload_title'];
300
+ }
301
+
302
+ return $value;
303
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  }
305
 
306
  WOOCCM_Order_Controller::instance();
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: checkout field editor, woocommerce checkout field editor, checkout manager
5
  Requires at least: 4.9
6
  Tested up to: 6.0.1
7
  Requires PHP: 5.6
8
- Stable tag: 6.0.0
9
  WC requires at least: 3.1.0
10
  WC tested up to: 6.6
11
  License: GPLv3
@@ -147,6 +147,9 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
147
 
148
  == Changelog ==
149
 
 
 
 
150
  = 6.0.0 =
151
  * Fix: WooCommerce compatibility
152
 
5
  Requires at least: 4.9
6
  Tested up to: 6.0.1
7
  Requires PHP: 5.6
8
+ Stable tag: 6.0.1
9
  WC requires at least: 3.1.0
10
  WC tested up to: 6.6
11
  License: GPLv3
147
 
148
  == Changelog ==
149
 
150
+ = 6.0.1 =
151
+ * Fix: Default show aditional checkout fields in order
152
+
153
  = 6.0.0 =
154
  * Fix: WooCommerce compatibility
155
 
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: Manage and customize WooCommerce Checkout fields (Add, Edit, Delete or re-order fields).
7
- * Version: 6.0.0
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
@@ -20,7 +20,7 @@ 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', '6.0.0' );
24
  }
25
  if ( ! defined( 'WOOCCM_PLUGIN_FILE' ) ) {
26
  define( 'WOOCCM_PLUGIN_FILE', __FILE__ );
4
  * Plugin Name: Checkout Fields Manager for WooCommerce
5
  * Plugin URI: https://quadlayers.com/portfolio/woocommerce-checkout-manager/
6
  * Description: Manage and customize WooCommerce Checkout fields (Add, Edit, Delete or re-order fields).
7
+ * Version: 6.0.1
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
20
  define( 'WOOCCM_PLUGIN_NAME', 'Checkout Fields Manager for WooCommerce' );
21
  }
22
  if ( ! defined( 'WOOCCM_PLUGIN_VERSION' ) ) {
23
+ define( 'WOOCCM_PLUGIN_VERSION', '6.0.1' );
24
  }
25
  if ( ! defined( 'WOOCCM_PLUGIN_FILE' ) ) {
26
  define( 'WOOCCM_PLUGIN_FILE', __FILE__ );