For Returning Customer Hide or Get Email for added “Repeat Email Address” on WooCommerce Checkout Page The 2019 Stack Overflow Developer Survey Results Are InAdding 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

What does ひと匙 mean in this manga and has it been used colloquially?

Is this app Icon Browser Safe/Legit?

What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?

When should I buy a clipper card after flying to OAK?

Feature engineering suggestion required

Why do UK politicians seemingly ignore opinion polls on Brexit?

Time travel alters history but people keep saying nothing's changed

One word riddle: Vowel in the middle

How technical should a Scrum Master be to effectively remove impediments?

What tool would a Roman-age civilization have for the breaking of silver and other metals into dust?

Does the shape of a die affect the probability of a number being rolled?

Shouldn't "much" here be used instead of "more"?

Pokemon Turn Based battle (Python)

What to do when moving next to a bird sanctuary with a loosely-domesticated cat?

Are there any other methods to apply to solving simultaneous equations?

Why isn't the circumferential light around the M87 black hole's event horizon symmetric?

Is "plugging out" electronic devices an American expression?

Did Scotland spend $250,000 for the slogan "Welcome to Scotland"?

Resizing object distorts it (Illustrator CC 2018)

What do hard-Brexiteers want with respect to the Irish border?

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

Return to UK after having been refused entry years ago

Multiply Two Integer Polynomials

How to deal with fear of taking dependencies



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



The 2019 Stack Overflow Developer Survey Results Are InAdding 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

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved