marcbkk
Forum Replies Created
-
Here is a link to a screenshot of how it looks now before putting in your new code changes.
https://www.dropbox.com/s/w3xr1v3w97rznpq/file%20oct%2007%2C%202%2002%2004%20am.png?dl=0
Thanks. I will give it try and report back.
Basically it works fine as it is now. It just doesn’t show the star as it being a required field. So if I remember correctly we are just trying to add the star to let people know it’s required.
Sure, thanks. If you still want to try and fix that code would be great. If it’s a big bother don’t worry about it though. Thanks.
Ok, how is this?
I also edited your error message slightly to read:
“Your email addresses do not match. Please reconfirm your email addresses.”
Thanks. This is what I have now including the new code you provided and the code I took and edited from the above link your provided:
function pw_edd_add_email_confirmation() {
?>
<p>
<label class=”edd-label” for=”edd-email-confirm”><?php _e(‘Confirm Your Email Address’, ‘edd’); ?></label>
<input class=”edd-input required” type=”email” name=”edd_email_confirm” placeholder=”<?php _e(‘Confirm email address’, ‘edd’); ?>” id=”edd-emai-confirml” value=””/>
</p>
<?php
}
add_action(‘edd_purchase_form_after_email’, ‘pw_edd_add_email_confirmation’);function pw_edd_process_email_confirmation($valid_data, $data) {
if( !isset($data[‘edd_email_confirm’] ) || !is_email( $data[‘edd_email_confirm’] ) ) {
edd_set_error( ’email_confirmation_required’, __( ‘Please confirm your email’, ‘edd’ ) );
}
if( trim( $data[‘edd_email_confirm’] ) != trim( $data[‘edd_email’] ) ) {
edd_set_error( ’email_confirmation_required’, __( ‘Your email addresses do not match’, ‘edd’ ) );
}
}
add_action(‘edd_checkout_error_checks’, ‘pw_edd_process_email_confirmation’, 10, 2);function pw_edd_purchase_form_required_fields( $required_fields ) {
$required_fields[‘edd_email_confirm’] = array(
‘error_id’ => ’email_confirmation_required’,
‘error_message’ => __( ‘Please confirm your email address.’, ‘edd’ )
);return $required_fields;
}
add_filter( ‘edd_purchase_form_required_fields’, ‘pw_edd_purchase_form_required_fields’ );—
I am not sure if the field and error ID I put in to modify the part of the code that came from the above link are correct, but they would seem correct.
Anyway, I just tested it on the site, nothing has changed, it is still not a starred (required) field, but I tried to do a checkout without confirming the email address and I got an error messages which says: “Error: Your email addresses do not match”.
That error message is taken from the first part of the code you provided and which is fine because it proves that your code is already working to make it a required field.
So for now I am going to take out the part of the code that I added using the above link because it doesn’t seem to be doing anything more.
The only thing missing is the star to let customers know it is a required field though. Perhaps there is a way to add something to your original code to add the star.
Thanks. I am afraid that doesn’t really help. I will just use the code you already amended which doesn’t add the star next to the field description and which doesn’t make it a required field.
Thanks. I added this. Obviously not right:
<label class=”edd-label” for=”edd-email-confirm”><?php _e(‘Confirm Your Email Address’, ‘edd’); ?></label> `<span class=”required-indicator”>*</span>
<input class=”edd-input required” type=”email” name=”edd_email_confirm” placeholder=”<?php _e(‘Confirm email address’, ‘edd’); ?>” id=”edd-emai-confirml” class= “edd-emai-confirml required” value=””/>Thanks. That works great now. Is there a way to add a star to it and to make it a required field though?
Not modified. Just copied and pasted the code into the themes functions.php file at the end of the very end of all the code in the file.
Here is a screen shot from the site I am helping my friend to develop:
Here is a screen shot from the site I am helping my friend to develop:
[url=https://postimage.org/][img]https://s11.postimg.org/py74umlz7/Screen.jpg[/img][/url]
[url=https://postimage.org/]free picture upload[/url]Thanks. Got it working now. But the code isn’t quite right. It places the text “Confirm Your Email Address” below the text box when it should be above like the texts for all the other texts boxes above and below it. Also, it should be a required text box field and it isn’t. Thanks.
Thanks. I tried adding that code snippet for the email verification field to the very end of my functions.php file as indicated in that link you provided. I added it here:
wp-content/plugins/easy-digital-downloads/includes/checkout/functions.php
Didn’t work though. Caused a parse error and crashed my site. Did I do something wrong?
Thanks. It seems an update and a number of new features should be implemented on some of the pipular extensions like the Stripe and Dropbox extensions from what has been discussed here recently.
Also, on the checkout page, the customer should be asked to enter their email address twice for their purchase receipt to avoid any mistakes on email address input and email delivery failure on the receipt.
How long realistically until some of these changes are put out in an updated release? 3 months, 6 months, longer, never perhaps?
Cheers…