• Resolved partynoparty

    (@partynoparty)


    During user registration, I would like to automatically generate a username and set it to the email value.

    In the past there was an option to automatically generate a username during account creation. I no longer see this option listed under the WooCommerce settings. Is this no longer possible?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello partynoparty,

    Thank you for contacting Woo support.

    The option to automatically generate a username during account creation was never a built-in feature of WordPress or WooCommerce. However, there is an option for automatically generating passwords.

    If you previously had a feature that generated usernames, you were likely using a third-party plugin that provided this functionality.

    Please don’t hesitate to contact us again if you have more questions or concerns.
    We are here to help ??

    Best regards.

    Thread Starter partynoparty

    (@partynoparty)

    I believe the account creation section used to look like this, if I’m not mistaken. This option is in fact still referenced in the official WooCommerce documentation, under the Account Creation section.

    https://woocommerce.com/document/configuring-woocommerce-settings/accounts-and-privacy/#guest-checkout-and-accounts

    If this was not ever the default WooCommerce settings, then what plugins might bring back this setting? Or what hooks can be used in functions.php to achieve the same affect?

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @partynoparty

    Yes, this option has been updated, and documentation will be updated soon. However, if you prefer to let your customer enter their password manually, you can disable the “Send password setup link (recommended)” option.

    Furthermore, there is no option or ready-to-use code snippet to restore those old settings.

    I hope this provides some clarity. Please let us know if you have any other questions!

    Thread Starter partynoparty

    (@partynoparty)

    Thank you for your response, however my interest was not in regards to setting the password, but the username.

    I thought I might be able to achieve this by:

    • hiding the username field using css
    • disabling the form field validation for the username field
    • setting the value after submission using the woocommerce_register_post hook

    My main hangup now is trying to disable the the field validation. I have tried several hooks (woocommerce_registration_errors and another that I can’t recall) but none seemed to work. Is there is a current hook available that can do this?

    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi @partynoparty,

    I’m unable to share the correct hook for your specific need here, but I’d recommend tryign the following:

    1. Running the exact question you’re asking, along with the code you previously tried, through an AI platform like ChatGPT for recommendations/changes to your code;
    2. Checking whether there are existing plugins in the WordPress plugin repository that might be doing that already.
    3. Joining our WooCommerce Slack community (it does have a developer channel where you can ask coding questions): https://woo.com/community-slack/

    Hope this helps!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.