Skip to content

Instantly share code, notes, and snippets.

@aatronco
Created September 5, 2018 18:49
Show Gist options
  • Select an option

  • Save aatronco/0e744e50771c986ed5a123ec82cd1e1d to your computer and use it in GitHub Desktop.

Select an option

Save aatronco/0e744e50771c986ed5a123ec82cd1e1d to your computer and use it in GitHub Desktop.
Step 1 - Create the Custom Checkout Field Called "Email Confirmation" (Or Similar in your store Language)
Step 2 - Paste this script on your Checkout Block
<script>
var email_confirmation_name = "Email Confirmation" // Replace Email Confirmation with the name of your field
var email_confirmation_id = email_confirmation_name.toLowerCase().replace(" ","_")
$("#checkout").submit(function(evt){
if($("#order_customer_email").val() != $("#order_contact_"+email_confirmation_name).val(){
evt.preventDefault();
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment