WooCommerce Checkout Manager - Version 3.6.7

Version Description

Add Error Fix. Add WooCommerce Order/Customer CSV Export support Able to Change additional information header

Download this release

Release Info

Developer Emark
Plugin Icon 128x128 WooCommerce Checkout Manager
Version 3.6.7
Comparing to
See all releases

Code changes from version 3.6.6 to 3.6.7

Files changed (2) hide show
  1. readme.txt +11 -5
  2. woocommerce-checkout-manager.php +70 -14
readme.txt CHANGED
@@ -4,14 +4,14 @@ Donate link: http://www.trottyzone.com/donation/
4
  Tags: woocommerce, checkout settings, remove fields, shipping, order, fields, checkout page, checkout field, checkout manager, required remove, woocommerce checkout manager, checkout, checkout field editor, field editor, woocommerce custom checkout options , custom checkout, checkout option, field, payment, sell, buy, pay, tax, notice, re-order, order, new field, save field, manager, options, field editor
5
  Requires at least: 3.0
6
  Tested up to: 4.2
7
- Stable tag: 3.6.6
8
  License: GPLv2 or later
9
 
10
  Manages WooCommerce Checkout
11
 
12
  == Description ==
13
 
14
- This is a WooCommerce extension plugin that targets the checkout processes in which goods are bought. This plugin gives you a vast amount of capabilities to manage your products on checkout such as removing fields that you do not need, removing the required attribute rendering the field optional to customer or even perhaps adding more fields to the checkout page. This plugin certainly can.
15
 
16
  = FEATURES =
17
 
@@ -29,12 +29,13 @@ This is a WooCommerce extension plugin that targets the checkout processes in wh
29
 
30
  * Added fields will appear on Order Summary and Receipt under “Additional information.”
31
 
32
- * Compatible with [WPML](http://wpml.org/) and [WooCommerce Print Invoice & Delivery Note](http://wordpress.org/plugins/woocommerce-delivery-notes/)
33
 
34
  = PRO VERSION =
35
  [WooCommerce Checkout Manager Pro](http://www.trottyzone.com/product/woocommerce-checkout-manager-pro/) offers these cool nifty extra features:
36
 
37
- * **<span style="color:red;">New!</span>** Add new fields to the **Billing Address** or/and **Shipping Address** Section. These fields can be **EDITED** on the **My Account Page**.
 
38
 
39
  = Ten ( 12 ) field types included: =
40
  1. Text Input
@@ -304,4 +305,9 @@ WPML bug fixes 4
304
 
305
  = 3.6.6 =
306
  GUI + Code clean up.
307
- Multi-lang Save issue fix.
 
 
 
 
 
4
  Tags: woocommerce, checkout settings, remove fields, shipping, order, fields, checkout page, checkout field, checkout manager, required remove, woocommerce checkout manager, checkout, checkout field editor, field editor, woocommerce custom checkout options , custom checkout, checkout option, field, payment, sell, buy, pay, tax, notice, re-order, order, new field, save field, manager, options, field editor
5
  Requires at least: 3.0
6
  Tested up to: 4.2
7
+ Stable tag: 3.6.7
8
  License: GPLv2 or later
9
 
10
  Manages WooCommerce Checkout
11
 
12
  == Description ==
13
 
14
+ This is a WooCommerce extension plugin that targets the checkout processes in which goods are bought. This plugin gives you capabilities to manage your products on checkout such as removing fields that you do not need, removing the required attribute rendering the field optional to customer or even perhaps adding more fields to the checkout page. This plugin certainly can.
15
 
16
  = FEATURES =
17
 
29
 
30
  * Added fields will appear on Order Summary and Receipt under “Additional information.”
31
 
32
+ * Compatible with [WPML](http://wpml.org/) | [WooCommerce Print Invoice & Delivery Note](http://wordpress.org/plugins/woocommerce-delivery-notes/) | [ WooCommerce Order/Customer CSV Export](http://www.woothemes.com/products/ordercustomer-csv-export/)
33
 
34
  = PRO VERSION =
35
  [WooCommerce Checkout Manager Pro](http://www.trottyzone.com/product/woocommerce-checkout-manager-pro/) offers these cool nifty extra features:
36
 
37
+ * Add new fields to the **Billing** and **Shipping** Section **separately** from Additional Section.
38
+ * These fields can be edited on your customers **account** page.
39
 
40
  = Ten ( 12 ) field types included: =
41
  1. Text Input
305
 
306
  = 3.6.6 =
307
  GUI + Code clean up.
308
+ Multi-lang Save issue fix.
309
+
310
+ = 3.6.7 =
311
+ Add Error Fix.
312
+ Add WooCommerce Order/Customer CSV Export support
313
+ Able to Change additional information header
woocommerce-checkout-manager.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /*
3
  Plugin Name: WooCommerce Checkout Manager
4
- Plugin URI: http://www.trottyzone.com/product/woocommerce-checkout-manager-pro
5
  Description: Manages WooCommerce Checkout fields
6
- Version: 3.6.6
7
  Author: Ephrain Marchan
8
- Author URI: http://www.trottyzone.com
9
  License: GPLv2 or later
10
  */
11
  /*
@@ -30,6 +30,8 @@ load_plugin_textdomain('woocommerce-checkout-manager', false, dirname(plugin_bas
30
  register_activation_hook( __FILE__, 'wccs_install' );
31
  add_filter( 'wp_feed_cache_transient_lifetime', create_function('$a', 'return 1800;') );
32
  add_filter( 'wcdn_order_info_fields', 'wccm_woocommerce_delivery_notes_compat', 10, 2 );
 
 
33
  add_action( 'admin_enqueue_scripts', 'wccs_scripts' );
34
  add_action('woocommerce_after_checkout_billing_form', 'wccs_add_title');
35
  add_action('woocommerce_after_checkout_billing_form', 'wccs_custom_checkout_field');
@@ -42,7 +44,11 @@ add_action('wp_head','display_front_wccs');
42
 
43
  function wccs_install() {
44
 
45
- $defaults = array( 'buttons' => array(
 
 
 
 
46
  array(
47
  'label' => __( 'Example Label', 'woocommerce-checkout-manager' ),
48
  'placeholder' => __( 'Example placeholder', 'woocommerce-checkout-manager' ),
@@ -51,7 +57,7 @@ function wccs_install() {
51
  'option_b' => __('option 2', 'woocommerce-checkout-manager')
52
  )
53
  ),
54
- 'checkness' => array(
55
  'checkbox1' => true,
56
  'checkbox12' => true
57
  )
@@ -426,6 +432,7 @@ $options = get_option( 'wccs_settings' );
426
  </tr>
427
  </tbody>
428
  <div class="wooccm_title"><?php _e('Shipping Section', 'woocommerce-checkout-manager'); ?></div>
 
429
  </table>
430
 
431
  <div style="padding:5px 10px;font-weight:700;color:green;" class="clear_dwccm">
@@ -458,10 +465,11 @@ $options = get_option( 'wccs_settings' );
458
  </div>
459
 
460
  <div class="wooccm_title" ><?php _e('Add New Field Section', 'woocommerce-checkout-manager'); ?></div>
 
461
  <table class="widefat" border="1" >
462
  <thead>
463
  <tr>
464
- <th><?php _e('Enable Title - Additional information', 'atc-menu'); ?></th>
465
  <th><input style="float:left;" name="wccs_settings[checkness][checkbox12]" type="checkbox" value="true" <?php echo (isset($options['checkness']['checkbox12'])) ? "checked='checked'": ""; ?> /></th>
466
  <th><?php _e('Checkout Page', 'atc-menu'); ?></th>
467
  <th><input style="float:left;" name="wccs_settings[checkness][checkbox1]" type="checkbox" value="true" <?php echo (isset($options['checkness']['checkbox1'])) ? "checked='checked'": ""; ?> /></th>
@@ -630,10 +638,10 @@ if ( 1 == ($options['checkness']['wccs_opt_8'] ) ) {
630
  unset($fields['billing']['billing_country']);
631
  }
632
  if ( 1 == ($options['checkness']['wccs_opt_9'] ) ) {
633
- unset($fields9['billing']['billing_state']);
634
  }
635
  if ( 1 == ($options['checkness']['wccs_opt_10'] ) ) {
636
- unset($fields10['billing']['billing_phone']);
637
  }
638
  if ( ! empty( $options['replace']['label2'] ) ) {
639
  $fields['billing']['billing_country']['label'] = wpml_string_wccm($options['replace']['label2']);
@@ -645,7 +653,7 @@ if ( ! empty( $options['replace']['label3'] ) ) {
645
  $fields['billing']['billing_phone']['label'] = wpml_string_wccm($options['replace']['label3']);
646
  }
647
  if ( 1 == ($options['checkness']['wccs_opt_11'] ) ) {
648
- unset($fields11['billing']['billing_email']);
649
  }
650
  if ( ! empty( $options['replace']['placeholder4'] ) ) {
651
  $fields['billing']['billing_email']['placeholder'] = wpml_string_wccm($options['replace']['placeholder4']);
@@ -654,7 +662,7 @@ if ( ! empty( $options['replace']['label4'] ) ) {
654
  $fields['billing']['billing_email']['label'] = wpml_string_wccm($options['replace']['label4']);
655
  }
656
  if ( 1 == ($options['checkness']['wccs_opt_12'] ) ) {
657
- unset($fields12['order']['order_comments']);
658
  }
659
  if ( ! empty( $options['replace']['placeholder11'] ) ) {
660
  $fields['order']['order_comments']['placeholder'] = wpml_string_wccm($options['replace']['placeholder11']);
@@ -760,7 +768,7 @@ add_filter( 'woocommerce_shipping_fields', 'wccs_shipping_required_fields', 10,
760
  function wccs_add_title() {
761
  $options = get_option( 'wccs_settings' );
762
  if (true == ($options['checkness']['checkbox12']) )
763
- echo '<div class="add_info_wccs"><br><h3>' . __( 'Additional information', 'woocommerce-checkout-manager' ) . '</h3></div>';
764
  }
765
 
766
 
@@ -854,7 +862,7 @@ $options = get_option( 'wccs_settings' );
854
  function wccs_custom_style_checkout_email() {
855
  $options = get_option( 'wccs_settings' );
856
  if (true == ($options['checkness']['checkbox1']) )
857
- echo '<h2>' . __( 'Additional information', 'woocommerce-checkout-manager' ) . '</h2>';
858
  }
859
 
860
 
@@ -865,7 +873,7 @@ $options = get_option( 'wccs_settings' );
865
  if ( count( $options['buttons'] ) > 0 ) :
866
  foreach ( $options['buttons'] as $btn ) :
867
  if ( (!$_POST[ ''.$btn['cow'].'' ] ) && (true == ($btn['checkbox']) ) )
868
- $woocommerce->add_error( '<strong>'.$btn['label'].'</strong> '. __('is a required field', 'woocommerce-checkout-manager' ) . ' ');
869
  endforeach;
870
  endif;
871
  }
@@ -916,7 +924,7 @@ function wccs_custom_checkout_details( $order_id ) {
916
  $options = get_option( 'wccs_settings' );
917
 
918
  if (true == ($options['checkness']['checkbox1']) ) {
919
- echo '<h2>' . __( 'Additional information', 'woocommerce-checkout-manager' ) . '</h2>';
920
  }
921
 
922
  if ( count( $options['buttons'] ) > 0 ) :
@@ -942,6 +950,54 @@ echo '<style type="text/css">
942
  </style>';
943
  }
944
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
945
  // =============== Make compatible with WooCommerce Delivery Notes ===========
946
  function wccm_woocommerce_delivery_notes_compat( $fields, $order ) {
947
  $options = get_option( 'wccs_settings' );
1
  <?php
2
  /*
3
  Plugin Name: WooCommerce Checkout Manager
4
+ Plugin URI: http://www.trottyzone.com/product/woocommerce-checkout-manager-pro/
5
  Description: Manages WooCommerce Checkout fields
6
+ Version: 3.6.7
7
  Author: Ephrain Marchan
8
+ Author URI: http://www.trottyzone.com/product/woocommerce-checkout-manager-pro/
9
  License: GPLv2 or later
10
  */
11
  /*
30
  register_activation_hook( __FILE__, 'wccs_install' );
31
  add_filter( 'wp_feed_cache_transient_lifetime', create_function('$a', 'return 1800;') );
32
  add_filter( 'wcdn_order_info_fields', 'wccm_woocommerce_delivery_notes_compat', 10, 2 );
33
+ add_filter( 'wc_customer_order_csv_export_order_row', 'wooccm_csv_export_modify_row_data', 10, 3 );
34
+ add_filter( 'wc_customer_order_csv_export_order_headers', 'woccm_csv_export_modify_column_headers' );
35
  add_action( 'admin_enqueue_scripts', 'wccs_scripts' );
36
  add_action('woocommerce_after_checkout_billing_form', 'wccs_add_title');
37
  add_action('woocommerce_after_checkout_billing_form', 'wccs_custom_checkout_field');
44
 
45
  function wccs_install() {
46
 
47
+ $defaults = array( 'replace' => array(
48
+ 'add_information' => __( 'Additional Information', 'woocommerce-checkout-manager' )
49
+ ),
50
+
51
+ 'buttons' => array(
52
  array(
53
  'label' => __( 'Example Label', 'woocommerce-checkout-manager' ),
54
  'placeholder' => __( 'Example placeholder', 'woocommerce-checkout-manager' ),
57
  'option_b' => __('option 2', 'woocommerce-checkout-manager')
58
  )
59
  ),
60
+ 'checkness' => array(
61
  'checkbox1' => true,
62
  'checkbox12' => true
63
  )
432
  </tr>
433
  </tbody>
434
  <div class="wooccm_title"><?php _e('Shipping Section', 'woocommerce-checkout-manager'); ?></div>
435
+ <?php submit_button( __( 'Save Changes', 'woocommerce-checkout-manager' ) ); ?>
436
  </table>
437
 
438
  <div style="padding:5px 10px;font-weight:700;color:green;" class="clear_dwccm">
465
  </div>
466
 
467
  <div class="wooccm_title" ><?php _e('Add New Field Section', 'woocommerce-checkout-manager'); ?></div>
468
+ <?php submit_button( __( 'Save Changes', 'woocommerce-checkout-manager' ) ); ?>
469
  <table class="widefat" border="1" >
470
  <thead>
471
  <tr>
472
+ <th>- <?php _e('Additional Fields Header', 'woocommerce-checkout-manager'); ?><input type="text" name="wccs_settings[replace][add_information]" value="<?php echo esc_attr( $options['replace']['add_information'] ); ?>" /></th>
473
  <th><input style="float:left;" name="wccs_settings[checkness][checkbox12]" type="checkbox" value="true" <?php echo (isset($options['checkness']['checkbox12'])) ? "checked='checked'": ""; ?> /></th>
474
  <th><?php _e('Checkout Page', 'atc-menu'); ?></th>
475
  <th><input style="float:left;" name="wccs_settings[checkness][checkbox1]" type="checkbox" value="true" <?php echo (isset($options['checkness']['checkbox1'])) ? "checked='checked'": ""; ?> /></th>
638
  unset($fields['billing']['billing_country']);
639
  }
640
  if ( 1 == ($options['checkness']['wccs_opt_9'] ) ) {
641
+ unset($fields['billing']['billing_state']);
642
  }
643
  if ( 1 == ($options['checkness']['wccs_opt_10'] ) ) {
644
+ unset($fields['billing']['billing_phone']);
645
  }
646
  if ( ! empty( $options['replace']['label2'] ) ) {
647
  $fields['billing']['billing_country']['label'] = wpml_string_wccm($options['replace']['label2']);
653
  $fields['billing']['billing_phone']['label'] = wpml_string_wccm($options['replace']['label3']);
654
  }
655
  if ( 1 == ($options['checkness']['wccs_opt_11'] ) ) {
656
+ unset($fields['billing']['billing_email']);
657
  }
658
  if ( ! empty( $options['replace']['placeholder4'] ) ) {
659
  $fields['billing']['billing_email']['placeholder'] = wpml_string_wccm($options['replace']['placeholder4']);
662
  $fields['billing']['billing_email']['label'] = wpml_string_wccm($options['replace']['label4']);
663
  }
664
  if ( 1 == ($options['checkness']['wccs_opt_12'] ) ) {
665
+ unset($fields['order']['order_comments']);
666
  }
667
  if ( ! empty( $options['replace']['placeholder11'] ) ) {
668
  $fields['order']['order_comments']['placeholder'] = wpml_string_wccm($options['replace']['placeholder11']);
768
  function wccs_add_title() {
769
  $options = get_option( 'wccs_settings' );
770
  if (true == ($options['checkness']['checkbox12']) )
771
+ echo '<div class="add_info_wccs"><br><h3>' .esc_attr( $options['replace']['add_information'] ) . '</h3></div>';
772
  }
773
 
774
 
862
  function wccs_custom_style_checkout_email() {
863
  $options = get_option( 'wccs_settings' );
864
  if (true == ($options['checkness']['checkbox1']) )
865
+ echo '<h2>'.esc_attr( $options['replace']['add_information'] ). '</h2>';
866
  }
867
 
868
 
873
  if ( count( $options['buttons'] ) > 0 ) :
874
  foreach ( $options['buttons'] as $btn ) :
875
  if ( (!$_POST[ ''.$btn['cow'].'' ] ) && (true == ($btn['checkbox']) ) )
876
+ wc_add_notice( '<strong>'.$btn['label'].'</strong> '. __('is a required field', 'woocommerce-checkout-manager' ) . ' ', 'error');
877
  endforeach;
878
  endif;
879
  }
924
  $options = get_option( 'wccs_settings' );
925
 
926
  if (true == ($options['checkness']['checkbox1']) ) {
927
+ echo '<h2>'.esc_attr( $options['replace']['add_information'] ). '</h2>';
928
  }
929
 
930
  if ( count( $options['buttons'] ) > 0 ) :
950
  </style>';
951
  }
952
 
953
+
954
+ // add custom column headers
955
+ function woccm_csv_export_modify_column_headers( $column_headers ) {
956
+
957
+ $new_headers = array();
958
+ $options = get_option( 'wccs_settings' );
959
+ foreach ( $options['buttons'] as $btn ) :
960
+ $new_headers[''.$btn['cow'].''] = ''.wpml_string_wccm($btn['label']).'';
961
+ endforeach;
962
+
963
+ return array_merge( $column_headers, $new_headers );
964
+ }
965
+
966
+
967
+
968
+ // set the data for each for custom columns
969
+ function wooccm_csv_export_modify_row_data( $order_data, $order, $csv_generator ) {
970
+
971
+ $custom_data = array();
972
+ $options = get_option( 'wccs_settings' );
973
+
974
+ foreach ( $options['buttons'] as $btn ) :
975
+
976
+ if( get_post_meta( $order->id, ''.$btn['cow'].'', true ) ) {
977
+ $custom_data[''.$btn['cow'].''] = get_post_meta( $order->id, ''.$btn['cow'].'', true );
978
+ }
979
+
980
+ endforeach;
981
+
982
+
983
+ // defaults set back
984
+ $new_order_data = array();
985
+
986
+ if ( isset( $csv_generator->order_format ) && ( 'default_one_row_per_item' == $csv_generator->order_format || 'legacy_one_row_per_item' == $csv_generator->order_format ) ) {
987
+
988
+ foreach ( $order_data as $data ) {
989
+ $new_order_data[] = array_merge( (array) $data, $custom_data );
990
+ }
991
+
992
+ } else {
993
+
994
+ $new_order_data = array_merge( $order_data, $custom_data );
995
+ }
996
+
997
+ return $new_order_data;
998
+ }
999
+
1000
+
1001
  // =============== Make compatible with WooCommerce Delivery Notes ===========
1002
  function wccm_woocommerce_delivery_notes_compat( $fields, $order ) {
1003
  $options = get_option( 'wccs_settings' );