hlashbrooke / woocommerce-email-validation Goto Github PK
View Code? Open in Web Editor NEWWooCommerce extension that adds a 'confirm email address' field to the checkout page
Home Page: http://hugh.blog
License: GNU General Public License v3.0
WooCommerce extension that adds a 'confirm email address' field to the checkout page
Home Page: http://hugh.blog
License: GNU General Public License v3.0
The add_checkout_field should look like the follows:
public function add_checkout_field( $fields = array() ) {
$billing_email2 = array(
'label' => __( 'Confirm Email Address', 'wc_emailvalidation' ),
'placeholder' => _x( 'Email Address', 'placeholder', 'wc_emailvalidation' ),
'required' => true,
'class' => apply_filters( 'woocommerce_confirm_email_field_class', array( 'form-row-first' ) ),
'clear' => true,
'validate' => array( 'email' ),
);
$billing_email_index = array_search('billing_email', array_keys($fields['billing']));
if( $billing_email_index ){
$fields['billing'] = array_slice($fields['billing'],0,$billing_email_index + 1,true) +
array( 'billing_email-2' => $billing_email2 ) +
array_slice($fields['billing'],$billing_email_index + 1,null,true);
} else {
$fields['billing']['billing_email-2'] = $billing_email_confirm;
}
return $fields;
}
Since the Amazon Payments plugin for WooCommerce is using their own forms, I need a possibility to prevent the mail validation.
Until now I just unset the email-2 field in the WC checkout fields, when a customer is logged in via Amazon.
That does not seem to work anymore, since my customers have problems to checkout because the validation function is called anyway.
Now I tried to remove the filter for the validation function, but it won't work.
remove_filter('woocommerce_process_checkout_field_billing_email-2', array('WooCommerce_Email_Validation', 'validate_email_address'), 10);
Do you have a hint how I can solve my problem?
Good day I wish, I want to ask you do not plan to add the function verification email in real time. For example as a demonstration here: http://email-checker.net/check
How can I upload files?
Validation now always returns an error in woocommerce 3.0
I'm not 100% sure this is a good idea as it adds a layer of inconvenience to the user, but it has been requested by more than one person now (here's the latest request). I understand the desire for this kind of thing, but I'm not sure it's good to add this kind of potential inconvenience to the user.
If I did add this feature then I would add an option for the site owner to activate it or not, so that it doesn't immediately affect users. It should be easy enough to achieve with jQuery's .bind("cut copy paste")
function, but I'd need to test this out properly first.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.