Hello XStore Support Team,
I hope this message finds you well.
I’m currently customizing the registration process on my website ([your-website-url.com], e.g., abyatalamal.com) which uses the XStore theme and an XStore Child theme.
I’ve added several custom fields (First Name, Last Name, Phone, Password Confirmation, Terms checkbox) to the WooCommerce registration form using code in my child theme’s functions.php file. I’ve also implemented custom validation rules and email verification successfully.
However, I’ve encountered an issue with duplicate HTML element IDs on the default WooCommerce “My Account” page (/my-account/ or a similar slug) when a user is logged out. The browser console shows multiple errors like:
[DOM] Found 2 elements with non-unique id #reg_billing_first_name: …
[DOM] Found 2 elements with non-unique id #reg_password: …
[DOM] Found 2 elements with non-unique id #reg_password_confirm: …
[DOM] Found 2 elements with non-unique id #terms: …
(and similar errors for other fields)
This occurs because the default “My Account” page template seems to render both the standard Login form and the Registration form (with my custom fields included) within the main page content in addition to the Login/Register forms present in the theme’s built-in off-canvas panel / pop-up.
Having duplicate IDs is causing issues, particularly preventing custom JavaScript (like a password strength indicator I added) from targeting the correct elements reliably.
My Goal:
I want to prevent the default Login and Registration forms from rendering within the main content of the “My Account” page when the user is logged out, and rely only on the theme’s off-canvas/pop-up forms for login and registration. This should resolve the duplicate ID issue.
My Question:
Is there a built-in theme option in XStore (Theme Options or Customizer) to disable the rendering of the default login/registration forms on the “My Account” page content for logged-out users?
If not, what is the recommended method or hook/filter within the XStore framework to correctly remove or hide these default forms from the page content (specifically the forms rendered by woocommerce_account_content or the myaccount/form-login.php template for logged-out users), while ensuring the off-canvas/pop-up functionality remains intact?
I have tried adding custom PHP code to functions.php using remove_action and filtering wc_get_template to prevent myaccount/form-login.php from loading, but I want to ensure I’m using the best practice compatible with XStore’s structure.
Could you please provide guidance on the correct way to achieve this within the XStore theme?
Thank you for your time and assistance!
Best regards,