For Returning Customer Hide or Get Email for added “Repeat Email Address” on WooCommerce Checkout Page Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Adding a datepicker to Woocommerce Checkout PageWoocommerce Checkout Page CustomizationWoocommerce order formatted billing address reorder and custom billing fieldcustomizing woocommerce address fieldsHow to add short description in WooCommerce checkout pageAdd Tip input by customer to WooCommerce checkout pageSave billing address to custom checkout field if empty in woocommerceSend Woocommerce Order to email address listed on product pageCheckout fields to have 2 columns in Woocommerce cart pageEnable custom checkout email field validation in Woocommerce

When a candle burns, why does the top of wick glow if bottom of flame is hottest?

How does the math work when buying airline miles?

Crossing US/Canada Border for less than 24 hours

Drawing without replacement: why is the order of draw irrelevant?

Is there hard evidence that the grant peer review system performs significantly better than random?

How were pictures turned from film to a big picture in a picture frame before digital scanning?

Project Euler #1 in C++

What's the meaning of "fortified infraction restraint"?

Take 2! Is this homebrew Lady of Pain warlock patron balanced?

What is the topology associated with the algebras for the ultrafilter monad?

Why is Nikon 1.4g better when Nikon 1.8g is sharper?

Can an alien society believe that their star system is the universe?

Illegal assignment from sObject to Id

If Windows 7 doesn't support WSL, then what does Linux subsystem option mean?

Most bit efficient text communication method?

Performance gap between vector<bool> and array

Why do we bend a book to keep it straight?

Do wooden building fires get hotter than 600°C?

Significance of Cersei's obsession with elephants?

Has negative voting ever been officially implemented in elections, or seriously proposed, or even studied?

SF book about people trapped in a series of worlds they imagine

AppleTVs create a chatty alternate WiFi network

How to react to hostile behavior from a senior developer?

Can a new player join a group only when a new campaign starts?



For Returning Customer Hide or Get Email for added “Repeat Email Address” on WooCommerce Checkout Page



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Adding a datepicker to Woocommerce Checkout PageWoocommerce Checkout Page CustomizationWoocommerce order formatted billing address reorder and custom billing fieldcustomizing woocommerce address fieldsHow to add short description in WooCommerce checkout pageAdd Tip input by customer to WooCommerce checkout pageSave billing address to custom checkout field if empty in woocommerceSend Woocommerce Order to email address listed on product pageCheckout fields to have 2 columns in Woocommerce cart pageEnable custom checkout email field validation in Woocommerce



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I've added a Repeat Email Address field on the WooCommerce checkout page with the following add function:



// EMAIL Confirmation on CHECKOUT PAGE

add_filter( 'woocommerce_checkout_fields' , 'email_verification_field_checkout' );

function email_verification_field_checkout( $fields )

$fields['billing']['billing_email']['class'] = array('form-row-first');
$fields['billing']['billing_email_verification'] = array(
'label' => __('Repeat Email Adress', 'woocommerce'),
'required' => true,
'class' => array('form-row-last'),
'clear' => true,
'priority' => 999,
);

return $fields;


// CHECK IF THE TWO EMAILS MATCH !!!
add_action('woocommerce_checkout_process', 'mycheck_email_addresses');

function mycheck_email_addresses()
$email1 = $_POST['billing_email'];
$email2 = $_POST['billing_email_verification'];
if ( $email2 !== $email1 )
wc_add_notice( __( 'Your email addresses don't match!', 'woocommerce' ), 'error' );




Returning Customers can login on top of the page.
WooCommerce then gets the email address for the filed "billing_email" adress.



1) Is there a way to add a function to do the same for the added "billing_email_verification" field?



2) I tried an add function for the case that a Returning Customer logs in on top of the checkout page: In this case I would love to hide the "Repeat Email Address" field for better customer experience. But unfortunately that didn't work. I'm just starting out to understand filters and hooks and would appreciate a helping hand :)



add_filter( 'woocommerce_checkout_fields' , 'my_override_checkout_fields' );
function my_override_checkout_fields( $fields )
if( is_user_logged_in() )
unset($fields['billing']);
$fields['billing_email_verification'] = array();

return $fields;










share|improve this question
























  • docs.woocommerce.com/document/…

    – mujuonly
    Mar 8 at 10:45

















1















I've added a Repeat Email Address field on the WooCommerce checkout page with the following add function:



// EMAIL Confirmation on CHECKOUT PAGE

add_filter( 'woocommerce_checkout_fields' , 'email_verification_field_checkout' );

function email_verification_field_checkout( $fields )

$fields['billing']['billing_email']['class'] = array('form-row-first');
$fields['billing']['billing_email_verification'] = array(
'label' => __('Repeat Email Adress', 'woocommerce'),
'required' => true,
'class' => array('form-row-last'),
'clear' => true,
'priority' => 999,
);

return $fields;


// CHECK IF THE TWO EMAILS MATCH !!!
add_action('woocommerce_checkout_process', 'mycheck_email_addresses');

function mycheck_email_addresses()
$email1 = $_POST['billing_email'];
$email2 = $_POST['billing_email_verification'];
if ( $email2 !== $email1 )
wc_add_notice( __( 'Your email addresses don't match!', 'woocommerce' ), 'error' );




Returning Customers can login on top of the page.
WooCommerce then gets the email address for the filed "billing_email" adress.



1) Is there a way to add a function to do the same for the added "billing_email_verification" field?



2) I tried an add function for the case that a Returning Customer logs in on top of the checkout page: In this case I would love to hide the "Repeat Email Address" field for better customer experience. But unfortunately that didn't work. I'm just starting out to understand filters and hooks and would appreciate a helping hand :)



add_filter( 'woocommerce_checkout_fields' , 'my_override_checkout_fields' );
function my_override_checkout_fields( $fields )
if( is_user_logged_in() )
unset($fields['billing']);
$fields['billing_email_verification'] = array();

return $fields;










share|improve this question
























  • docs.woocommerce.com/document/…

    – mujuonly
    Mar 8 at 10:45













1












1








1








I've added a Repeat Email Address field on the WooCommerce checkout page with the following add function:



// EMAIL Confirmation on CHECKOUT PAGE

add_filter( 'woocommerce_checkout_fields' , 'email_verification_field_checkout' );

function email_verification_field_checkout( $fields )

$fields['billing']['billing_email']['class'] = array('form-row-first');
$fields['billing']['billing_email_verification'] = array(
'label' => __('Repeat Email Adress', 'woocommerce'),
'required' => true,
'class' => array('form-row-last'),
'clear' => true,
'priority' => 999,
);

return $fields;


// CHECK IF THE TWO EMAILS MATCH !!!
add_action('woocommerce_checkout_process', 'mycheck_email_addresses');

function mycheck_email_addresses()
$email1 = $_POST['billing_email'];
$email2 = $_POST['billing_email_verification'];
if ( $email2 !== $email1 )
wc_add_notice( __( 'Your email addresses don't match!', 'woocommerce' ), 'error' );




Returning Customers can login on top of the page.
WooCommerce then gets the email address for the filed "billing_email" adress.



1) Is there a way to add a function to do the same for the added "billing_email_verification" field?



2) I tried an add function for the case that a Returning Customer logs in on top of the checkout page: In this case I would love to hide the "Repeat Email Address" field for better customer experience. But unfortunately that didn't work. I'm just starting out to understand filters and hooks and would appreciate a helping hand :)



add_filter( 'woocommerce_checkout_fields' , 'my_override_checkout_fields' );
function my_override_checkout_fields( $fields )
if( is_user_logged_in() )
unset($fields['billing']);
$fields['billing_email_verification'] = array();

return $fields;










share|improve this question
















I've added a Repeat Email Address field on the WooCommerce checkout page with the following add function:



// EMAIL Confirmation on CHECKOUT PAGE

add_filter( 'woocommerce_checkout_fields' , 'email_verification_field_checkout' );

function email_verification_field_checkout( $fields )

$fields['billing']['billing_email']['class'] = array('form-row-first');
$fields['billing']['billing_email_verification'] = array(
'label' => __('Repeat Email Adress', 'woocommerce'),
'required' => true,
'class' => array('form-row-last'),
'clear' => true,
'priority' => 999,
);

return $fields;


// CHECK IF THE TWO EMAILS MATCH !!!
add_action('woocommerce_checkout_process', 'mycheck_email_addresses');

function mycheck_email_addresses()
$email1 = $_POST['billing_email'];
$email2 = $_POST['billing_email_verification'];
if ( $email2 !== $email1 )
wc_add_notice( __( 'Your email addresses don't match!', 'woocommerce' ), 'error' );




Returning Customers can login on top of the page.
WooCommerce then gets the email address for the filed "billing_email" adress.



1) Is there a way to add a function to do the same for the added "billing_email_verification" field?



2) I tried an add function for the case that a Returning Customer logs in on top of the checkout page: In this case I would love to hide the "Repeat Email Address" field for better customer experience. But unfortunately that didn't work. I'm just starting out to understand filters and hooks and would appreciate a helping hand :)



add_filter( 'woocommerce_checkout_fields' , 'my_override_checkout_fields' );
function my_override_checkout_fields( $fields )
if( is_user_logged_in() )
unset($fields['billing']);
$fields['billing_email_verification'] = array();

return $fields;







php wordpress woocommerce






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 11 at 16:26







mika2019

















asked Mar 8 at 9:37









mika2019mika2019

627




627












  • docs.woocommerce.com/document/…

    – mujuonly
    Mar 8 at 10:45

















  • docs.woocommerce.com/document/…

    – mujuonly
    Mar 8 at 10:45
















docs.woocommerce.com/document/…

– mujuonly
Mar 8 at 10:45





docs.woocommerce.com/document/…

– mujuonly
Mar 8 at 10:45












1 Answer
1






active

oldest

votes


















0














I've found the mistake in the solution for case 2)
Here is the correct filter for case 2)



add_filter( 'woocommerce_checkout_fields' , 'my_override_checkout_fields' );
function my_override_checkout_fields( $fields )
if( is_user_logged_in() )
unset($fields['billing']['billing_email_verification']);

return $fields;



Anyhow, I would love to learn how I can approach case 1) something with get_value
Does someone know how to do this?






share|improve this answer























  • Unfortunately, I'm getting an error message, that the two email addresses don't match (see code on top of the page) so, I have to set/get_value the billing_email_verification = billing_email... how do I do this?

    – mika2019
    Mar 11 at 16:32











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55060400%2ffor-returning-customer-hide-or-get-email-for-added-repeat-email-address-on-woo%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I've found the mistake in the solution for case 2)
Here is the correct filter for case 2)



add_filter( 'woocommerce_checkout_fields' , 'my_override_checkout_fields' );
function my_override_checkout_fields( $fields )
if( is_user_logged_in() )
unset($fields['billing']['billing_email_verification']);

return $fields;



Anyhow, I would love to learn how I can approach case 1) something with get_value
Does someone know how to do this?






share|improve this answer























  • Unfortunately, I'm getting an error message, that the two email addresses don't match (see code on top of the page) so, I have to set/get_value the billing_email_verification = billing_email... how do I do this?

    – mika2019
    Mar 11 at 16:32















0














I've found the mistake in the solution for case 2)
Here is the correct filter for case 2)



add_filter( 'woocommerce_checkout_fields' , 'my_override_checkout_fields' );
function my_override_checkout_fields( $fields )
if( is_user_logged_in() )
unset($fields['billing']['billing_email_verification']);

return $fields;



Anyhow, I would love to learn how I can approach case 1) something with get_value
Does someone know how to do this?






share|improve this answer























  • Unfortunately, I'm getting an error message, that the two email addresses don't match (see code on top of the page) so, I have to set/get_value the billing_email_verification = billing_email... how do I do this?

    – mika2019
    Mar 11 at 16:32













0












0








0







I've found the mistake in the solution for case 2)
Here is the correct filter for case 2)



add_filter( 'woocommerce_checkout_fields' , 'my_override_checkout_fields' );
function my_override_checkout_fields( $fields )
if( is_user_logged_in() )
unset($fields['billing']['billing_email_verification']);

return $fields;



Anyhow, I would love to learn how I can approach case 1) something with get_value
Does someone know how to do this?






share|improve this answer













I've found the mistake in the solution for case 2)
Here is the correct filter for case 2)



add_filter( 'woocommerce_checkout_fields' , 'my_override_checkout_fields' );
function my_override_checkout_fields( $fields )
if( is_user_logged_in() )
unset($fields['billing']['billing_email_verification']);

return $fields;



Anyhow, I would love to learn how I can approach case 1) something with get_value
Does someone know how to do this?







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 11 at 15:57









mika2019mika2019

627




627












  • Unfortunately, I'm getting an error message, that the two email addresses don't match (see code on top of the page) so, I have to set/get_value the billing_email_verification = billing_email... how do I do this?

    – mika2019
    Mar 11 at 16:32

















  • Unfortunately, I'm getting an error message, that the two email addresses don't match (see code on top of the page) so, I have to set/get_value the billing_email_verification = billing_email... how do I do this?

    – mika2019
    Mar 11 at 16:32
















Unfortunately, I'm getting an error message, that the two email addresses don't match (see code on top of the page) so, I have to set/get_value the billing_email_verification = billing_email... how do I do this?

– mika2019
Mar 11 at 16:32





Unfortunately, I'm getting an error message, that the two email addresses don't match (see code on top of the page) so, I have to set/get_value the billing_email_verification = billing_email... how do I do this?

– mika2019
Mar 11 at 16:32



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55060400%2ffor-returning-customer-hide-or-get-email-for-added-repeat-email-address-on-woo%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

Алба-Юлія

Захаров Федір Захарович