This topic has 8 replies, 3 voices, and was last updated 9 years, 6 months ago ago by Jack Richardson
Hi,
how can I do to default check on create an account?
I should add a custom field to the Privacy Policy before the terms and conditions, how can I do?
Thanks for your help,
A
Hello,
Sorry, but your query is unclear.
Please clarify with more details and show screenshots what you want to achieve.
Thank you.
Regards,
Eva Kemp.
The attached screenshot, I have marked points 1 and 2
http://imageshack.com/a/img540/975/pPnnlB.jpg
1) the field register an account flagged default
2) add a required field “Privacy Policy”
Thank you!
Antonio
Hello,
Changes that you want to make are woocommerce configuration. You can try to make them as described in the following articles:
1. https://wordpress.org/support/topic/how-to-set-a-checkbox-to-checked-as-default
2. https://support.woothemes.com/hc/en-us/articles/203103527-Add-checkbox-field-to-the-checkout
Best regards,
Jack Richardson.
Thank you Jack,
1) I tried to follow the guide :
– woopress/woocommerce/checkout/form-billing.php
changing
<input class=”input-checkbox” id=”createaccount” <?php checked( ( true === $checkout->get_value( ‘createaccount’ ) || ( true === apply_filters( ‘woocommerce_create_account_default_checked’, false ) ) ), true) ?> type=”checkbox” name=”createaccount” value=”1″ /> <label for=”createaccount” class=”checkbox”><?php _e( ‘Create an account?’, ‘woocommerce’ ); ?></label>
to
<input class=”input-checkbox” id=”createaccount” <?php checked( ( true === $checkout->get_value( ‘createaccount’ ) || ( true === apply_filters( ‘woocommerce_create_account_default_checked’, true ) ) ), true) ?> type=”checkbox” name=”createaccount” value=”1″ /> <label for=”createaccount” class=”checkbox”><?php _e( ‘Create an account?’, ‘woocommerce’ ); ?></label>
– woopress/functions.php
adding this filter
add_filter( ‘woocommerce_create_account_default_checked’, function( $isChecked) { return true; } );
The result either way is that the field “Create an Account?” is open but the check is not checked.
http://imageshack.com/a/img538/5227/FQ4S9g.jpg
Thanks for the help!
Antonio
Hello,
Discard all changes in the woopress/woocommerce/checkout/form-billing.php file and add the code in woopress/functions.php:
add_filter( 'woocommerce_create_account_default_checked', function( $isChecked) { return true; } );
Then go to woopress/js and edit the file etheme.js in line 1134. Change line:
$('#createaccount').attr('checked', false);
to
$('#createaccount').attr('checked', true);
Best regards,
Jack Richardson.
Thanks, now it works!
Hello,
You are welcome.
Best regards,
Jack Richardson.
The issue related to '‘Checkout page – Create an account?’' has been successfully resolved, and the topic is now closed for further responses