Version Description
- Changed: Hide translation notice in error log
- Changed: Removed excess characters from required field notice
- Changed: Cleaned up the code across the Plugin
Download this release
Release Info
| Developer | visser |
| Plugin | |
| Version | 4.2.3 |
| Comparing to | |
| See all releases | |
Code changes from version 4.2.2 to 4.2.3
- includes/admin.php +7 -7
- includes/checkout.php +5 -2
- includes/classes/field_filters.php +9 -8
- includes/classes/main.php +8 -2
- includes/install.php +10 -10
- includes/templates/functions/required/add_required.php +44 -10
- includes/templates/functions/required/billing_required.php +50 -16
- readme.txt +6 -1
- woocommerce-checkout-manager.php +2 -2
includes/admin.php
CHANGED
|
@@ -113,8 +113,8 @@ function wooccm_admin_plugin_actions( $links ) {
|
|
| 113 |
$support_url = 'https://wordpress.org/support/plugin/woocommerce-checkout-manager/';
|
| 114 |
|
| 115 |
$plugin_links = array(
|
| 116 |
-
'<a href="' . $page_url . '">'.__('Settings', 'woocommerce-checkout-manager' ).'</a>',
|
| 117 |
-
'<a href="' . $support_url . '">'.__('Support', 'woocommerce-checkout-manager' ).'</a>',
|
| 118 |
);
|
| 119 |
return array_merge( $plugin_links, $links );
|
| 120 |
|
|
@@ -382,7 +382,7 @@ function wooccm_register_settings() {
|
|
| 382 |
function wooccm_options_page() {
|
| 383 |
|
| 384 |
if ( !current_user_can('manage_options') )
|
| 385 |
-
wp_die( __('You do not have sufficient permissions to access this page.', 'woocommerce-checkout-manager') );
|
| 386 |
|
| 387 |
$htmlshippingabbr = array( 'country', 'first_name', 'last_name', 'company', 'address_1', 'address_2', 'city', 'state', 'postcode' );
|
| 388 |
$htmlbillingabbr = array( 'country', 'first_name', 'last_name', 'company', 'address_1', 'address_2', 'city', 'state', 'postcode', 'email', 'phone' );
|
|
@@ -431,7 +431,7 @@ function wooccm_options_page() {
|
|
| 431 |
$ship = 0;
|
| 432 |
foreach( $shipping as $name => $value ) {
|
| 433 |
|
| 434 |
-
$defaults2['shipping_buttons'][$ship]['label'] = __( $value, 'woocommerce-checkout-manager' );
|
| 435 |
$defaults2['shipping_buttons'][$ship]['cow'] = $name;
|
| 436 |
$defaults2['shipping_buttons'][$ship]['checkbox'] = 'true';
|
| 437 |
$defaults2['shipping_buttons'][$ship]['order'] = $ship + 1;
|
|
@@ -499,7 +499,7 @@ function wooccm_options_page() {
|
|
| 499 |
|
| 500 |
foreach( $billing as $name => $value ) {
|
| 501 |
|
| 502 |
-
$defaults3['billing_buttons'][$bill]['label'] = __( $value, 'woocommerce-checkout-manager' );
|
| 503 |
$defaults3['billing_buttons'][$bill]['cow'] = $name;
|
| 504 |
$defaults3['billing_buttons'][$bill]['checkbox'] = 'true';
|
| 505 |
$defaults3['billing_buttons'][$bill]['order'] = $bill + 1;
|
|
@@ -1023,7 +1023,7 @@ function wooccm_admin_notices() {
|
|
| 1023 |
$support_url = 'https://wordpress.org/support/plugin/woocommerce-checkout-manager#postform';
|
| 1024 |
$dismiss_url = add_query_arg( array( 'action' => 'wooccm_dismiss_beta_notice', '_wpnonce' => wp_create_nonce( 'wooccm_dismiss_beta_notice' ) ) );
|
| 1025 |
|
| 1026 |
-
$message = '<span style="float:right;"><a href="' . $dismiss_url . '">' . __( 'Dismiss', 'woocommerce-checkout-manager' ) . '</a></span>';
|
| 1027 |
$message .= __( '<strong>WooCommerce Checkout Manager Notice:</strong> We urgently need developers, integrators and interested store owners to test early Plugin releases and provide feedback to help stabilise the 4.0+ series. Can you help?', 'woocommerce-checkout-manager' );
|
| 1028 |
$message .= '
|
| 1029 |
<p class="submit">
|
|
@@ -1046,7 +1046,7 @@ function wooccm_admin_updater_notice() {
|
|
| 1046 |
<form method="post" name="clickhere" action="">
|
| 1047 |
<div id="message" class="updated settings-error click-here-wooccm">
|
| 1048 |
<p>
|
| 1049 |
-
<span style="float:right;"><a href="<?php echo $dismiss_url; ?>"><?php _e( 'Dismiss', 'woocommerce-checkout-manager' ); ?></a></span>
|
| 1050 |
<?php _e( '<strong>WooCommerce Checkout Manager Data Update Required</strong> – We just need to update the settings for WooCommerce Checkout Manager to the latest version.', 'woocommerce-checkout-manager' ); ?>
|
| 1051 |
</p>
|
| 1052 |
<?php
|
| 113 |
$support_url = 'https://wordpress.org/support/plugin/woocommerce-checkout-manager/';
|
| 114 |
|
| 115 |
$plugin_links = array(
|
| 116 |
+
'<a href="' . $page_url . '">' . __( 'Settings', 'woocommerce-checkout-manager' ) . '</a>',
|
| 117 |
+
'<a href="' . $support_url . '">' . __( 'Support', 'woocommerce-checkout-manager' ) . '</a>',
|
| 118 |
);
|
| 119 |
return array_merge( $plugin_links, $links );
|
| 120 |
|
| 382 |
function wooccm_options_page() {
|
| 383 |
|
| 384 |
if ( !current_user_can('manage_options') )
|
| 385 |
+
wp_die( __( 'You do not have sufficient permissions to access this page.', 'woocommerce-checkout-manager' ) );
|
| 386 |
|
| 387 |
$htmlshippingabbr = array( 'country', 'first_name', 'last_name', 'company', 'address_1', 'address_2', 'city', 'state', 'postcode' );
|
| 388 |
$htmlbillingabbr = array( 'country', 'first_name', 'last_name', 'company', 'address_1', 'address_2', 'city', 'state', 'postcode', 'email', 'phone' );
|
| 431 |
$ship = 0;
|
| 432 |
foreach( $shipping as $name => $value ) {
|
| 433 |
|
| 434 |
+
$defaults2['shipping_buttons'][$ship]['label'] = ( !empty( $value ) ? __( $value, 'woocommerce-checkout-manager' ) : false );
|
| 435 |
$defaults2['shipping_buttons'][$ship]['cow'] = $name;
|
| 436 |
$defaults2['shipping_buttons'][$ship]['checkbox'] = 'true';
|
| 437 |
$defaults2['shipping_buttons'][$ship]['order'] = $ship + 1;
|
| 499 |
|
| 500 |
foreach( $billing as $name => $value ) {
|
| 501 |
|
| 502 |
+
$defaults3['billing_buttons'][$bill]['label'] = ( !empty( $value ) ? __( $value, 'woocommerce-checkout-manager' ) : false );
|
| 503 |
$defaults3['billing_buttons'][$bill]['cow'] = $name;
|
| 504 |
$defaults3['billing_buttons'][$bill]['checkbox'] = 'true';
|
| 505 |
$defaults3['billing_buttons'][$bill]['order'] = $bill + 1;
|
| 1023 |
$support_url = 'https://wordpress.org/support/plugin/woocommerce-checkout-manager#postform';
|
| 1024 |
$dismiss_url = add_query_arg( array( 'action' => 'wooccm_dismiss_beta_notice', '_wpnonce' => wp_create_nonce( 'wooccm_dismiss_beta_notice' ) ) );
|
| 1025 |
|
| 1026 |
+
$message = '<span style="float:right;"><a href="' . $dismiss_url . '" class="woocommerce-message-close notice-dismiss">' . __( 'Dismiss', 'woocommerce-checkout-manager' ) . '</a></span>';
|
| 1027 |
$message .= __( '<strong>WooCommerce Checkout Manager Notice:</strong> We urgently need developers, integrators and interested store owners to test early Plugin releases and provide feedback to help stabilise the 4.0+ series. Can you help?', 'woocommerce-checkout-manager' );
|
| 1028 |
$message .= '
|
| 1029 |
<p class="submit">
|
| 1046 |
<form method="post" name="clickhere" action="">
|
| 1047 |
<div id="message" class="updated settings-error click-here-wooccm">
|
| 1048 |
<p>
|
| 1049 |
+
<span style="float:right;"><a href="<?php echo $dismiss_url; ?>" class="woocommerce-message-close notice-dismiss"><?php _e( 'Dismiss', 'woocommerce-checkout-manager' ); ?></a></span>
|
| 1050 |
<?php _e( '<strong>WooCommerce Checkout Manager Data Update Required</strong> – We just need to update the settings for WooCommerce Checkout Manager to the latest version.', 'woocommerce-checkout-manager' ); ?>
|
| 1051 |
</p>
|
| 1052 |
<?php
|
includes/checkout.php
CHANGED
|
@@ -454,8 +454,11 @@ function wooccm_custom_checkout_field_process() {
|
|
| 454 |
$btn['type'] !== 'wooccmupload' &&
|
| 455 |
$btn['type'] !== 'heading'
|
| 456 |
) {
|
| 457 |
-
if(
|
| 458 |
-
|
|
|
|
|
|
|
|
|
|
| 459 |
wc_add_notice( $message, 'error' );
|
| 460 |
}
|
| 461 |
}
|
| 454 |
$btn['type'] !== 'wooccmupload' &&
|
| 455 |
$btn['type'] !== 'heading'
|
| 456 |
) {
|
| 457 |
+
if(
|
| 458 |
+
( sanitize_text_field( $_POST[$btn['cow']] ) == $btn['check_2'] ) &&
|
| 459 |
+
( !empty ($btn['checkbox'] )
|
| 460 |
+
) ) {
|
| 461 |
+
$message = sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . wooccm_wpml_string( $btn['label'] ) . '</strong>' );
|
| 462 |
wc_add_notice( $message, 'error' );
|
| 463 |
}
|
| 464 |
}
|
includes/classes/field_filters.php
CHANGED
|
@@ -319,10 +319,11 @@ function wooccm_checkout_field_select_handler( $field = '', $key, $args, $value
|
|
| 319 |
|
| 320 |
$options = '';
|
| 321 |
|
| 322 |
-
if( !empty( $args['options'] ) )
|
| 323 |
-
$options .= ($args['default']
|
| 324 |
-
foreach
|
| 325 |
$options .= '<option '. selected( $value, $option_key, false ) . '>' . wooccm_wpml_string( esc_attr( $option_text ) ) .'</option>';
|
|
|
|
| 326 |
|
| 327 |
$field = '<p class="form-row ' . esc_attr( implode( ' ', $args['class'] ) ) .'" id="' . esc_attr( $key ) . '_field">';
|
| 328 |
|
|
@@ -330,7 +331,7 @@ function wooccm_checkout_field_select_handler( $field = '', $key, $args, $value
|
|
| 330 |
$field .= '<label for="' . esc_attr( $key ) . '" class="' . implode( ' ', $args['label_class'] ) .'">' . $args['label']. $required . '</label>';
|
| 331 |
|
| 332 |
$field .= '
|
| 333 |
-
<select class="' . esc_attr( $args['fancy'] ) .'" data-placeholder="' . __( $args['default'], '
|
| 334 |
' . $options . '
|
| 335 |
</select>
|
| 336 |
</p>' . $after;
|
|
@@ -479,7 +480,7 @@ function wooccm_checkout_field_state_handler( $field = '', $key, $args, $value )
|
|
| 479 |
<option value="">' . __( 'Select a state…', 'woocommerce-checkout-manager' ) . '</option>';
|
| 480 |
|
| 481 |
foreach( $states as $ckey => $cvalue ) {
|
| 482 |
-
$field .= '<option value="' . esc_attr( $ckey ) . '" '.selected( $value, $ckey, false ) .'>'.__( $cvalue, 'woocommerce-checkout-manager' ) .'</option>';
|
| 483 |
}
|
| 484 |
|
| 485 |
$field .= '</select>';
|
|
@@ -594,10 +595,10 @@ function wooccm_checkout_field_country_handler( $field = '', $key, $args, $value
|
|
| 594 |
$field = '<p class="form-row ' . esc_attr( implode( ' ', $args['class'] ) ) .'" id="' . esc_attr( $args['id'] ) . '_field">'
|
| 595 |
. '<label for="' . esc_attr( $args['id'] ) . '" class="' . esc_attr( implode( ' ', $args['label_class'] ) ) .'">' . $args['label'] . $required . '</label>'
|
| 596 |
. '<select name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" class="country_to_state country_select ' . esc_attr( implode( ' ', $args['input_class'] ) ) .'" ' . implode( ' ', $custom_attributes ) . '>'
|
| 597 |
-
. '<option value="">'.__( 'Select a country…', 'woocommerce-checkout-manager' ) .'</option>';
|
| 598 |
|
| 599 |
foreach( $countries as $ckey => $cvalue ) {
|
| 600 |
-
$field .= '<option value="' . esc_attr( $ckey ) . '" '.selected( $value, $ckey, false ) .'>'.__( $cvalue, 'woocommerce-checkout-manager' ) .'</option>';
|
| 601 |
}
|
| 602 |
|
| 603 |
$field .= '</select>';
|
|
@@ -661,7 +662,7 @@ function wooccm_checkout_field_multiselect_handler( $field = '', $key, $args, $v
|
|
| 661 |
if ( $args['label'] )
|
| 662 |
$field .= '<label for="' . esc_attr( $key ) . '" class="' . implode( ' ', $args['label_class'] ) .'">' . $args['label']. $required . '</label>';
|
| 663 |
|
| 664 |
-
$field .= '<select data-placeholder="' . __( 'Select some options', '
|
| 665 |
' . $options . '
|
| 666 |
</select>
|
| 667 |
</p>' . $after;
|
| 319 |
|
| 320 |
$options = '';
|
| 321 |
|
| 322 |
+
if( !empty( $args['options'] ) ) {
|
| 323 |
+
$options .= ( $args['default'] ? '<option value="">' . $args['default'] .'</option>' : '' );
|
| 324 |
+
foreach( explode( '||', $args['options'] ) as $option_key => $option_text )
|
| 325 |
$options .= '<option '. selected( $value, $option_key, false ) . '>' . wooccm_wpml_string( esc_attr( $option_text ) ) .'</option>';
|
| 326 |
+
}
|
| 327 |
|
| 328 |
$field = '<p class="form-row ' . esc_attr( implode( ' ', $args['class'] ) ) .'" id="' . esc_attr( $key ) . '_field">';
|
| 329 |
|
| 331 |
$field .= '<label for="' . esc_attr( $key ) . '" class="' . implode( ' ', $args['label_class'] ) .'">' . $args['label']. $required . '</label>';
|
| 332 |
|
| 333 |
$field .= '
|
| 334 |
+
<select class="' . esc_attr( $args['fancy'] ) .'" data-placeholder="' . ( !empty( $args['default'] ) ? __( $args['default'], 'woocommerce-checkout-manager' ) : '' ) . '" name="' . esc_attr( $key ) . '" id="' . esc_attr( $key ) . '" >
|
| 335 |
' . $options . '
|
| 336 |
</select>
|
| 337 |
</p>' . $after;
|
| 480 |
<option value="">' . __( 'Select a state…', 'woocommerce-checkout-manager' ) . '</option>';
|
| 481 |
|
| 482 |
foreach( $states as $ckey => $cvalue ) {
|
| 483 |
+
$field .= '<option value="' . esc_attr( $ckey ) . '" '.selected( $value, $ckey, false ) .'>' . ( !empty( $cvalue ) ? __( $cvalue, 'woocommerce-checkout-manager' ) : '' ) .'</option>';
|
| 484 |
}
|
| 485 |
|
| 486 |
$field .= '</select>';
|
| 595 |
$field = '<p class="form-row ' . esc_attr( implode( ' ', $args['class'] ) ) .'" id="' . esc_attr( $args['id'] ) . '_field">'
|
| 596 |
. '<label for="' . esc_attr( $args['id'] ) . '" class="' . esc_attr( implode( ' ', $args['label_class'] ) ) .'">' . $args['label'] . $required . '</label>'
|
| 597 |
. '<select name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" class="country_to_state country_select ' . esc_attr( implode( ' ', $args['input_class'] ) ) .'" ' . implode( ' ', $custom_attributes ) . '>'
|
| 598 |
+
. '<option value="">' . __( 'Select a country…', 'woocommerce-checkout-manager' ) . '</option>';
|
| 599 |
|
| 600 |
foreach( $countries as $ckey => $cvalue ) {
|
| 601 |
+
$field .= '<option value="' . esc_attr( $ckey ) . '" '.selected( $value, $ckey, false ) .'>' . ( !empty( $cvalue ) ? __( $cvalue, 'woocommerce-checkout-manager' ) : '' ) . '</option>';
|
| 602 |
}
|
| 603 |
|
| 604 |
$field .= '</select>';
|
| 662 |
if ( $args['label'] )
|
| 663 |
$field .= '<label for="' . esc_attr( $key ) . '" class="' . implode( ' ', $args['label_class'] ) .'">' . $args['label']. $required . '</label>';
|
| 664 |
|
| 665 |
+
$field .= '<select data-placeholder="' . __( 'Select some options', 'woocommerce-checkout-manager' ) . '" multiple="multiple" name="' . esc_attr( $key ) . '[]" id="' . esc_attr( $key ) . '" class="checkout_chosen_select select">
|
| 666 |
' . $options . '
|
| 667 |
</select>
|
| 668 |
</p>' . $after;
|
includes/classes/main.php
CHANGED
|
@@ -83,8 +83,14 @@ if( wooccm_validator_changename() ) {
|
|
| 83 |
|
| 84 |
<dl class="customer_details">
|
| 85 |
<?php
|
| 86 |
-
if( $order->billing_email )
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
?>
|
| 89 |
</dl>
|
| 90 |
|
| 83 |
|
| 84 |
<dl class="customer_details">
|
| 85 |
<?php
|
| 86 |
+
if( $order->billing_email ) {
|
| 87 |
+
echo '<dt>' . __( 'E-mail:', 'woocommerce-checkout-manager' ) . '</dt>';
|
| 88 |
+
echo '<dd>' . $order->billing_email . '</dd>';
|
| 89 |
+
}
|
| 90 |
+
if( $order->billing_phone ) {
|
| 91 |
+
echo '<dt>' . __( 'Telephone:', 'woocommerce-checkout-manager' ) . '</dt>';
|
| 92 |
+
echo '<dd>' . $order->billing_phone . '</dd>';
|
| 93 |
+
}
|
| 94 |
?>
|
| 95 |
</dl>
|
| 96 |
|
includes/install.php
CHANGED
|
@@ -47,7 +47,7 @@ function wooccm_install() {
|
|
| 47 |
$ship = 0;
|
| 48 |
foreach( $shipping as $name => $value ) {
|
| 49 |
|
| 50 |
-
$options2['shipping_buttons'][$ship]['label'] = __( $value, 'woocommerce-checkout-manager' );
|
| 51 |
$options2['shipping_buttons'][$ship]['cow'] = $name;
|
| 52 |
$options2['shipping_buttons'][$ship]['checkbox'] = 'true';
|
| 53 |
$options2['shipping_buttons'][$ship]['order'] = $ship + 1;
|
|
@@ -72,17 +72,17 @@ function wooccm_install() {
|
|
| 72 |
|
| 73 |
if ( $name == 'address_1') {
|
| 74 |
$options2['shipping_buttons'][$ship]['position'] = 'form-row-wide';
|
| 75 |
-
$options2['shipping_buttons'][$ship]['placeholder'] = __('Street address', 'woocommerce-checkout-manager');
|
| 76 |
}
|
| 77 |
|
| 78 |
if ( $name == 'address_2') {
|
| 79 |
$options2['shipping_buttons'][$ship]['position'] = 'form-row-wide';
|
| 80 |
-
$options2['shipping_buttons'][$ship]['placeholder'] = __('Apartment, suite, unit etc. (optional)', 'woocommerce-checkout-manager');
|
| 81 |
}
|
| 82 |
|
| 83 |
if ( $name == 'city') {
|
| 84 |
$options2['shipping_buttons'][$ship]['position'] = 'form-row-wide';
|
| 85 |
-
$options2['shipping_buttons'][$ship]['placeholder'] = __('Town / City', 'woocommerce-checkout-manager');
|
| 86 |
}
|
| 87 |
|
| 88 |
if ( $name == 'state') {
|
|
@@ -91,7 +91,7 @@ function wooccm_install() {
|
|
| 91 |
|
| 92 |
if ( $name == 'postcode') {
|
| 93 |
$options2['shipping_buttons'][$ship]['position'] = 'form-row-last';
|
| 94 |
-
$options2['shipping_buttons'][$ship]['placeholder'] = __('Postcode / Zip', 'woocommerce-checkout-manager');
|
| 95 |
$options2['shipping_buttons'][$ship]['clear_row'] = true;
|
| 96 |
}
|
| 97 |
|
|
@@ -116,7 +116,7 @@ function wooccm_install() {
|
|
| 116 |
$bill = 0;
|
| 117 |
foreach( $billing as $name => $value ) {
|
| 118 |
|
| 119 |
-
$options3['billing_buttons'][$bill]['label'] = __( $value, 'woocommerce-checkout-manager' );
|
| 120 |
$options3['billing_buttons'][$bill]['cow'] = $name;
|
| 121 |
$options3['billing_buttons'][$bill]['checkbox'] = 'true';
|
| 122 |
$options3['billing_buttons'][$bill]['order'] = $bill + 1;
|
|
@@ -141,17 +141,17 @@ function wooccm_install() {
|
|
| 141 |
|
| 142 |
if ( $name == 'address_1') {
|
| 143 |
$options3['billing_buttons'][$bill]['position'] = 'form-row-wide';
|
| 144 |
-
$options3['billing_buttons'][$bill]['placeholder'] = __('Street address', 'woocommerce-checkout-manager');
|
| 145 |
}
|
| 146 |
|
| 147 |
if ( $name == 'address_2') {
|
| 148 |
$options3['billing_buttons'][$bill]['position'] = 'form-row-wide';
|
| 149 |
-
$options3['billing_buttons'][$bill]['placeholder'] = __('Apartment, suite, unit etc. (optional)', 'woocommerce-checkout-manager');
|
| 150 |
}
|
| 151 |
|
| 152 |
if ( $name == 'city') {
|
| 153 |
$options3['billing_buttons'][$bill]['position'] = 'form-row-wide';
|
| 154 |
-
$options3['billing_buttons'][$bill]['placeholder'] = __('Town / City', 'woocommerce-checkout-manager');
|
| 155 |
}
|
| 156 |
|
| 157 |
if ( $name == 'state') {
|
|
@@ -160,7 +160,7 @@ function wooccm_install() {
|
|
| 160 |
|
| 161 |
if ( $name == 'postcode') {
|
| 162 |
$options3['billing_buttons'][$bill]['position'] = 'form-row-last';
|
| 163 |
-
$options3['billing_buttons'][$bill]['placeholder'] = __('Postcode / Zip', 'woocommerce-checkout-manager');
|
| 164 |
$options3['billing_buttons'][$bill]['clear_row'] = true;
|
| 165 |
}
|
| 166 |
|
| 47 |
$ship = 0;
|
| 48 |
foreach( $shipping as $name => $value ) {
|
| 49 |
|
| 50 |
+
$options2['shipping_buttons'][$ship]['label'] = ( !empty( $value ) ? __( $value, 'woocommerce-checkout-manager' ) : false );
|
| 51 |
$options2['shipping_buttons'][$ship]['cow'] = $name;
|
| 52 |
$options2['shipping_buttons'][$ship]['checkbox'] = 'true';
|
| 53 |
$options2['shipping_buttons'][$ship]['order'] = $ship + 1;
|
| 72 |
|
| 73 |
if ( $name == 'address_1') {
|
| 74 |
$options2['shipping_buttons'][$ship]['position'] = 'form-row-wide';
|
| 75 |
+
$options2['shipping_buttons'][$ship]['placeholder'] = __( 'Street address', 'woocommerce-checkout-manager' );
|
| 76 |
}
|
| 77 |
|
| 78 |
if ( $name == 'address_2') {
|
| 79 |
$options2['shipping_buttons'][$ship]['position'] = 'form-row-wide';
|
| 80 |
+
$options2['shipping_buttons'][$ship]['placeholder'] = __( 'Apartment, suite, unit etc. (optional)', 'woocommerce-checkout-manager' );
|
| 81 |
}
|
| 82 |
|
| 83 |
if ( $name == 'city') {
|
| 84 |
$options2['shipping_buttons'][$ship]['position'] = 'form-row-wide';
|
| 85 |
+
$options2['shipping_buttons'][$ship]['placeholder'] = __( 'Town / City', 'woocommerce-checkout-manager' );
|
| 86 |
}
|
| 87 |
|
| 88 |
if ( $name == 'state') {
|
| 91 |
|
| 92 |
if ( $name == 'postcode') {
|
| 93 |
$options2['shipping_buttons'][$ship]['position'] = 'form-row-last';
|
| 94 |
+
$options2['shipping_buttons'][$ship]['placeholder'] = __( 'Postcode / Zip', 'woocommerce-checkout-manager' );
|
| 95 |
$options2['shipping_buttons'][$ship]['clear_row'] = true;
|
| 96 |
}
|
| 97 |
|
| 116 |
$bill = 0;
|
| 117 |
foreach( $billing as $name => $value ) {
|
| 118 |
|
| 119 |
+
$options3['billing_buttons'][$bill]['label'] = ( !empty( $value ) ? __( $value, 'woocommerce-checkout-manager' ) : false );
|
| 120 |
$options3['billing_buttons'][$bill]['cow'] = $name;
|
| 121 |
$options3['billing_buttons'][$bill]['checkbox'] = 'true';
|
| 122 |
$options3['billing_buttons'][$bill]['order'] = $bill + 1;
|
| 141 |
|
| 142 |
if ( $name == 'address_1') {
|
| 143 |
$options3['billing_buttons'][$bill]['position'] = 'form-row-wide';
|
| 144 |
+
$options3['billing_buttons'][$bill]['placeholder'] = __( 'Street address', 'woocommerce-checkout-manager' );
|
| 145 |
}
|
| 146 |
|
| 147 |
if ( $name == 'address_2') {
|
| 148 |
$options3['billing_buttons'][$bill]['position'] = 'form-row-wide';
|
| 149 |
+
$options3['billing_buttons'][$bill]['placeholder'] = __( 'Apartment, suite, unit etc. (optional)', 'woocommerce-checkout-manager' );
|
| 150 |
}
|
| 151 |
|
| 152 |
if ( $name == 'city') {
|
| 153 |
$options3['billing_buttons'][$bill]['position'] = 'form-row-wide';
|
| 154 |
+
$options3['billing_buttons'][$bill]['placeholder'] = __( 'Town / City', 'woocommerce-checkout-manager' );
|
| 155 |
}
|
| 156 |
|
| 157 |
if ( $name == 'state') {
|
| 160 |
|
| 161 |
if ( $name == 'postcode') {
|
| 162 |
$options3['billing_buttons'][$bill]['position'] = 'form-row-last';
|
| 163 |
+
$options3['billing_buttons'][$bill]['placeholder'] = __( 'Postcode / Zip', 'woocommerce-checkout-manager' );
|
| 164 |
$options3['billing_buttons'][$bill]['clear_row'] = true;
|
| 165 |
}
|
| 166 |
|
includes/templates/functions/required/add_required.php
CHANGED
|
@@ -28,10 +28,20 @@ function wooccm_custom_checkout_process() {
|
|
| 28 |
// hide field
|
| 29 |
|
| 30 |
// show field without more
|
| 31 |
-
if(
|
|
|
|
|
|
|
|
|
|
| 32 |
$show_field_array = explode('||',$show_field_single);
|
| 33 |
-
if(
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
if( empty( $_POST[$btn['cow']] ) ) {
|
| 36 |
$message = sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . wooccm_wpml_string( $btn['label'] ) . '</strong>' );
|
| 37 |
wc_add_notice( $message, 'error' );
|
|
@@ -51,10 +61,20 @@ function wooccm_custom_checkout_process() {
|
|
| 51 |
// without more
|
| 52 |
|
| 53 |
// show field without more
|
| 54 |
-
if(
|
|
|
|
|
|
|
|
|
|
| 55 |
$show_field_array_cat = explode('||',$show_field_single_cat);
|
| 56 |
-
if(
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
if( empty( $_POST[$btn['cow']] ) ) {
|
| 59 |
$message = sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . wooccm_wpml_string( $btn['label'] ) . '</strong>' );
|
| 60 |
wc_add_notice( $message, 'error' );
|
|
@@ -75,10 +95,17 @@ function wooccm_custom_checkout_process() {
|
|
| 75 |
// hide field
|
| 76 |
|
| 77 |
// show field with more
|
| 78 |
-
if(
|
|
|
|
|
|
|
|
|
|
| 79 |
$show_field_array = explode( '||', $show_field_single );
|
| 80 |
if( array_intersect( $productsarraycm, $show_field_array ) ) {
|
| 81 |
-
if(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
if( empty( $_POST[$btn['cow']] ) ) {
|
| 83 |
$message = sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . wooccm_wpml_string( $btn['label'] ) . '</strong>' );
|
| 84 |
wc_add_notice( $message, 'error' );
|
|
@@ -93,10 +120,17 @@ function wooccm_custom_checkout_process() {
|
|
| 93 |
// with more
|
| 94 |
|
| 95 |
// show field with more
|
| 96 |
-
if(
|
|
|
|
|
|
|
|
|
|
| 97 |
$show_field_array_cat = explode( '||' , $show_field_single_cat );
|
| 98 |
if( array_intersect( $categoryarraycm, $show_field_array_cat ) ) {
|
| 99 |
-
if(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
if( empty( $_POST[$btn['cow']] ) ) {
|
| 101 |
$message = sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . wooccm_wpml_string( $btn['label'] ) . '</strong>' );
|
| 102 |
wc_add_notice( $message, 'error' );
|
| 28 |
// hide field
|
| 29 |
|
| 30 |
// show field without more
|
| 31 |
+
if(
|
| 32 |
+
!empty( $btn['single_px'] ) &&
|
| 33 |
+
empty( $btn['more_content'] )
|
| 34 |
+
) {
|
| 35 |
$show_field_array = explode('||',$show_field_single);
|
| 36 |
+
if(
|
| 37 |
+
in_array( $values['product_id'], $show_field_array ) &&
|
| 38 |
+
( count( $woocommerce->cart->cart_contents ) < 2 )
|
| 39 |
+
) {
|
| 40 |
+
if(
|
| 41 |
+
!empty( $btn['checkbox'] ) &&
|
| 42 |
+
!empty( $btn['label'] ) &&
|
| 43 |
+
( $btn['type'] !== 'changename' )
|
| 44 |
+
) {
|
| 45 |
if( empty( $_POST[$btn['cow']] ) ) {
|
| 46 |
$message = sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . wooccm_wpml_string( $btn['label'] ) . '</strong>' );
|
| 47 |
wc_add_notice( $message, 'error' );
|
| 61 |
// without more
|
| 62 |
|
| 63 |
// show field without more
|
| 64 |
+
if(
|
| 65 |
+
!empty( $btn['single_px_cat'] ) &&
|
| 66 |
+
empty( $btn['more_content'] )
|
| 67 |
+
) {
|
| 68 |
$show_field_array_cat = explode('||',$show_field_single_cat);
|
| 69 |
+
if(
|
| 70 |
+
in_array( $term->slug, $show_field_array_cat ) &&
|
| 71 |
+
( count( $woocommerce->cart->cart_contents ) < 2 )
|
| 72 |
+
) {
|
| 73 |
+
if(
|
| 74 |
+
!empty( $btn['checkbox'] ) &&
|
| 75 |
+
!empty( $btn['label'] ) &&
|
| 76 |
+
( $btn['type'] !== 'changename' )
|
| 77 |
+
) {
|
| 78 |
if( empty( $_POST[$btn['cow']] ) ) {
|
| 79 |
$message = sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . wooccm_wpml_string( $btn['label'] ) . '</strong>' );
|
| 80 |
wc_add_notice( $message, 'error' );
|
| 95 |
// hide field
|
| 96 |
|
| 97 |
// show field with more
|
| 98 |
+
if(
|
| 99 |
+
!empty( $btn['single_px'] ) &&
|
| 100 |
+
!empty( $btn['more_content'] )
|
| 101 |
+
) {
|
| 102 |
$show_field_array = explode( '||', $show_field_single );
|
| 103 |
if( array_intersect( $productsarraycm, $show_field_array ) ) {
|
| 104 |
+
if(
|
| 105 |
+
!empty( $btn['checkbox'] ) &&
|
| 106 |
+
!empty( $btn['label'] ) &&
|
| 107 |
+
( $btn['type'] !== 'changename' )
|
| 108 |
+
) {
|
| 109 |
if( empty( $_POST[$btn['cow']] ) ) {
|
| 110 |
$message = sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . wooccm_wpml_string( $btn['label'] ) . '</strong>' );
|
| 111 |
wc_add_notice( $message, 'error' );
|
| 120 |
// with more
|
| 121 |
|
| 122 |
// show field with more
|
| 123 |
+
if(
|
| 124 |
+
!empty( $btn['single_px_cat'] ) &&
|
| 125 |
+
!empty( $btn['more_content'] )
|
| 126 |
+
) {
|
| 127 |
$show_field_array_cat = explode( '||' , $show_field_single_cat );
|
| 128 |
if( array_intersect( $categoryarraycm, $show_field_array_cat ) ) {
|
| 129 |
+
if(
|
| 130 |
+
!empty( $btn['checkbox'] ) &&
|
| 131 |
+
!empty( $btn['label'] ) &&
|
| 132 |
+
( $btn['type'] !== 'changename' )
|
| 133 |
+
) {
|
| 134 |
if( empty( $_POST[$btn['cow']] ) ) {
|
| 135 |
$message = sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . wooccm_wpml_string( $btn['label'] ) . '</strong>' );
|
| 136 |
wc_add_notice( $message, 'error' );
|
includes/templates/functions/required/billing_required.php
CHANGED
|
@@ -29,7 +29,7 @@ function wooccm_billing_custom_checkout_process() {
|
|
| 29 |
$btn['type'] !== 'heading'
|
| 30 |
) {
|
| 31 |
if( empty( $_POST[sprintf( 'billing_%s', $btn['cow'] )] ) ) {
|
| 32 |
-
$message = sprintf( __( '%s is a required field.
|
| 33 |
wc_add_notice( $message, 'error' );
|
| 34 |
}
|
| 35 |
}
|
|
@@ -45,8 +45,11 @@ function wooccm_billing_custom_checkout_process() {
|
|
| 45 |
$btn['type'] !== 'changename' &&
|
| 46 |
$btn['type'] !== 'heading'
|
| 47 |
) {
|
| 48 |
-
if(
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
| 50 |
wc_add_notice( $message, 'error');
|
| 51 |
}
|
| 52 |
}
|
|
@@ -65,12 +68,22 @@ function wooccm_billing_custom_checkout_process() {
|
|
| 65 |
// hide field
|
| 66 |
|
| 67 |
// show field without more
|
| 68 |
-
if(
|
|
|
|
|
|
|
|
|
|
| 69 |
$show_field_array = explode( '||', $show_field_single );
|
| 70 |
-
if(
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
if( empty( $_POST[sprintf( 'billing_%s', $btn['cow'] )] ) ) {
|
| 73 |
-
$message = sprintf( __( '%s is a required field.
|
| 74 |
wc_add_notice( $message, 'error' );
|
| 75 |
}
|
| 76 |
}
|
|
@@ -88,12 +101,19 @@ function wooccm_billing_custom_checkout_process() {
|
|
| 88 |
// without more
|
| 89 |
|
| 90 |
// show field without more
|
| 91 |
-
if(
|
|
|
|
|
|
|
|
|
|
| 92 |
$show_field_array_cat = explode( '||' , $show_field_single_cat );
|
| 93 |
if( in_array( $term->slug, $show_field_array_cat ) && ( count( $woocommerce->cart->cart_contents ) < 2 ) ) {
|
| 94 |
-
if(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
if( empty( $_POST[sprintf( 'billing_%s', $btn['cow'] )] ) ) {
|
| 96 |
-
$message = sprintf( __( '%s is a required field.
|
| 97 |
wc_add_notice( $message, 'error' );
|
| 98 |
}
|
| 99 |
}
|
|
@@ -112,12 +132,19 @@ function wooccm_billing_custom_checkout_process() {
|
|
| 112 |
// hide field
|
| 113 |
|
| 114 |
// show field with more
|
| 115 |
-
if(
|
|
|
|
|
|
|
|
|
|
| 116 |
$show_field_array = explode( '||', $show_field_single );
|
| 117 |
if( array_intersect( $productsarraycm, $show_field_array ) ) {
|
| 118 |
-
if(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
if( empty( $_POST[sprintf( 'billing_%s', $btn['cow'] )] ) ) {
|
| 120 |
-
$message = sprintf( __( '%s is a required field.
|
| 121 |
wc_add_notice( $message, 'error' );
|
| 122 |
}
|
| 123 |
}
|
|
@@ -130,12 +157,19 @@ function wooccm_billing_custom_checkout_process() {
|
|
| 130 |
// with more
|
| 131 |
|
| 132 |
// show field with more
|
| 133 |
-
if(
|
|
|
|
|
|
|
|
|
|
| 134 |
$show_field_array_cat = explode( '||', $show_field_single_cat );
|
| 135 |
if( array_intersect( $categoryarraycm, $show_field_array_cat ) ) {
|
| 136 |
-
if(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
if( empty( $_POST[sprintf( 'billing_%s', $btn['cow'] )] ) ) {
|
| 138 |
-
$message = sprintf( __( '%s is a required field.
|
| 139 |
wc_add_notice( $message, 'error' );
|
| 140 |
}
|
| 141 |
}
|
| 29 |
$btn['type'] !== 'heading'
|
| 30 |
) {
|
| 31 |
if( empty( $_POST[sprintf( 'billing_%s', $btn['cow'] )] ) ) {
|
| 32 |
+
$message = sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . wooccm_wpml_string( $btn['label'] ) . '</strong>' );
|
| 33 |
wc_add_notice( $message, 'error' );
|
| 34 |
}
|
| 35 |
}
|
| 45 |
$btn['type'] !== 'changename' &&
|
| 46 |
$btn['type'] !== 'heading'
|
| 47 |
) {
|
| 48 |
+
if(
|
| 49 |
+
( sanitize_text_field( $_POST[sprintf( 'billing_%s', $btn['cow'] )] ) == $btn['check_2'] ) &&
|
| 50 |
+
( !empty( $btn['checkbox'] ) )
|
| 51 |
+
) {
|
| 52 |
+
$message = sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . wooccm_wpml_string( $btn['label'] ) . '</strong>' );
|
| 53 |
wc_add_notice( $message, 'error');
|
| 54 |
}
|
| 55 |
}
|
| 68 |
// hide field
|
| 69 |
|
| 70 |
// show field without more
|
| 71 |
+
if(
|
| 72 |
+
!empty( $btn['single_px'] ) &&
|
| 73 |
+
empty( $btn['more_content'] )
|
| 74 |
+
) {
|
| 75 |
$show_field_array = explode( '||', $show_field_single );
|
| 76 |
+
if(
|
| 77 |
+
in_array( $values['product_id'], $show_field_array ) &&
|
| 78 |
+
( count( $woocommerce->cart->cart_contents ) < 2 )
|
| 79 |
+
) {
|
| 80 |
+
if(
|
| 81 |
+
!empty( $btn['checkbox'] ) &&
|
| 82 |
+
!empty( $btn['label'] ) &&
|
| 83 |
+
( $btn['type'] !== 'changename' )
|
| 84 |
+
) {
|
| 85 |
if( empty( $_POST[sprintf( 'billing_%s', $btn['cow'] )] ) ) {
|
| 86 |
+
$message = sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . wooccm_wpml_string( $btn['label'] ) . '</strong>' );
|
| 87 |
wc_add_notice( $message, 'error' );
|
| 88 |
}
|
| 89 |
}
|
| 101 |
// without more
|
| 102 |
|
| 103 |
// show field without more
|
| 104 |
+
if(
|
| 105 |
+
!empty( $btn['single_px_cat'] ) &&
|
| 106 |
+
empty( $btn['more_content'] )
|
| 107 |
+
) {
|
| 108 |
$show_field_array_cat = explode( '||' , $show_field_single_cat );
|
| 109 |
if( in_array( $term->slug, $show_field_array_cat ) && ( count( $woocommerce->cart->cart_contents ) < 2 ) ) {
|
| 110 |
+
if(
|
| 111 |
+
!empty( $btn['checkbox'] ) &&
|
| 112 |
+
!empty( $btn['label'] ) &&
|
| 113 |
+
( $btn['type'] !== 'changename' )
|
| 114 |
+
) {
|
| 115 |
if( empty( $_POST[sprintf( 'billing_%s', $btn['cow'] )] ) ) {
|
| 116 |
+
$message = sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . wooccm_wpml_string( $btn['label'] ) . '</strong>' );
|
| 117 |
wc_add_notice( $message, 'error' );
|
| 118 |
}
|
| 119 |
}
|
| 132 |
// hide field
|
| 133 |
|
| 134 |
// show field with more
|
| 135 |
+
if(
|
| 136 |
+
!empty( $btn['single_px'] ) &&
|
| 137 |
+
!empty( $btn['more_content'] )
|
| 138 |
+
) {
|
| 139 |
$show_field_array = explode( '||', $show_field_single );
|
| 140 |
if( array_intersect( $productsarraycm, $show_field_array ) ) {
|
| 141 |
+
if(
|
| 142 |
+
!empty( $btn['checkbox'] ) &&
|
| 143 |
+
!empty( $btn['label'] ) &&
|
| 144 |
+
( $btn['type'] !== 'changename' )
|
| 145 |
+
) {
|
| 146 |
if( empty( $_POST[sprintf( 'billing_%s', $btn['cow'] )] ) ) {
|
| 147 |
+
$message = sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . wooccm_wpml_string( $btn['label'] ) . '</strong>' );
|
| 148 |
wc_add_notice( $message, 'error' );
|
| 149 |
}
|
| 150 |
}
|
| 157 |
// with more
|
| 158 |
|
| 159 |
// show field with more
|
| 160 |
+
if(
|
| 161 |
+
!empty( $btn['single_px_cat'] ) &&
|
| 162 |
+
!empty( $btn['more_content'] )
|
| 163 |
+
) {
|
| 164 |
$show_field_array_cat = explode( '||', $show_field_single_cat );
|
| 165 |
if( array_intersect( $categoryarraycm, $show_field_array_cat ) ) {
|
| 166 |
+
if(
|
| 167 |
+
!empty( $btn['checkbox'] ) &&
|
| 168 |
+
!empty( $btn['label'] ) &&
|
| 169 |
+
( $btn['type'] !== 'changename' )
|
| 170 |
+
) {
|
| 171 |
if( empty( $_POST[sprintf( 'billing_%s', $btn['cow'] )] ) ) {
|
| 172 |
+
$message = sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . wooccm_wpml_string( $btn['label'] ) . '</strong>' );
|
| 173 |
wc_add_notice( $message, 'error' );
|
| 174 |
}
|
| 175 |
}
|
readme.txt
CHANGED
|
@@ -5,7 +5,7 @@ Donate link: https://www.visser.com.au/donations/
|
|
| 5 |
Tags: woocommerce, field manager, checkout editor, checkout field, shipping field, billing field, order field, additional field
|
| 6 |
Requires at least: 3.0
|
| 7 |
Tested up to: 4.9.6
|
| 8 |
-
Stable tag: 4.2.
|
| 9 |
License: GPLv2 or later
|
| 10 |
|
| 11 |
Manages WooCommerce Checkout, the advanced way.
|
|
@@ -135,6 +135,11 @@ Example:
|
|
| 135 |
|
| 136 |
== Changelog ==
|
| 137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
= 4.2.2 =
|
| 139 |
* Fixed: Missing Checkout fields from WooCheckout screen (thanks Laura)
|
| 140 |
* Changed: Compatibility with WooCommerce 3.4
|
| 5 |
Tags: woocommerce, field manager, checkout editor, checkout field, shipping field, billing field, order field, additional field
|
| 6 |
Requires at least: 3.0
|
| 7 |
Tested up to: 4.9.6
|
| 8 |
+
Stable tag: 4.2.3
|
| 9 |
License: GPLv2 or later
|
| 10 |
|
| 11 |
Manages WooCommerce Checkout, the advanced way.
|
| 135 |
|
| 136 |
== Changelog ==
|
| 137 |
|
| 138 |
+
= 4.2.3 =
|
| 139 |
+
* Changed: Hide translation notice in error log
|
| 140 |
+
* Changed: Removed excess characters from required field notice
|
| 141 |
+
* Changed: Cleaned up the code across the Plugin
|
| 142 |
+
|
| 143 |
= 4.2.2 =
|
| 144 |
* Fixed: Missing Checkout fields from WooCheckout screen (thanks Laura)
|
| 145 |
* Changed: Compatibility with WooCommerce 3.4
|
woocommerce-checkout-manager.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
Plugin Name: WooCommerce Checkout Manager
|
| 4 |
Plugin URI: https://wordpress.org/plugins/woocommerce-checkout-manager/
|
| 5 |
Description: Manages WooCommerce Checkout, the advanced way.
|
| 6 |
-
Version: 4.2.
|
| 7 |
Author: Visser Labs
|
| 8 |
Author URI: http://www.visser.com.au
|
| 9 |
Contributors: visser, Emark
|
|
@@ -13,7 +13,7 @@ Text Domain: woocommerce-checkout-manager
|
|
| 13 |
Domain Path: /languages/
|
| 14 |
|
| 15 |
WC requires at least: 2.3
|
| 16 |
-
WC tested up to: 3.
|
| 17 |
*/
|
| 18 |
|
| 19 |
/*
|
| 3 |
Plugin Name: WooCommerce Checkout Manager
|
| 4 |
Plugin URI: https://wordpress.org/plugins/woocommerce-checkout-manager/
|
| 5 |
Description: Manages WooCommerce Checkout, the advanced way.
|
| 6 |
+
Version: 4.2.3
|
| 7 |
Author: Visser Labs
|
| 8 |
Author URI: http://www.visser.com.au
|
| 9 |
Contributors: visser, Emark
|
| 13 |
Domain Path: /languages/
|
| 14 |
|
| 15 |
WC requires at least: 2.3
|
| 16 |
+
WC tested up to: 3.4
|
| 17 |
*/
|
| 18 |
|
| 19 |
/*
|
