Checkout page – Create an account?

This topic has 8 replies, 3 voices, and was last updated 9 years, 5 months ago ago by Jack Richardson

  • 7 Answers
    Avatar: Eva
    Eva Kemp
    Support staff
    June 8, 2015 at 16:17

    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.

    Avatar: labelstudio
    labelstudio
    Participant
    June 9, 2015 at 16:48

    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

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    June 9, 2015 at 21:14

    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.

    Avatar: labelstudio
    labelstudio
    Participant
    June 15, 2015 at 16:35

    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

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    June 15, 2015 at 21:42

    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.

    Avatar: labelstudio
    labelstudio
    Participant
    June 16, 2015 at 12:53

    Thanks, now it works!

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    June 16, 2015 at 12:56

    Hello,

    You are welcome.

    Best regards,
    Jack Richardson.

  • Viewing 8 results - 1 through 8 (of 8 total)

The issue related to '‘Checkout page – Create an account?’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.