i want to welcome my customer to show as a “Welcome, [customer name]” how can I do this? Can anyone help me with this?
Hello! @timoo23 Please follow these steps to add code:
- Go to your Online Store
- Click on “Themes”
- Select “Edit code”
- Open main-account.liquid file
Replace the H1 tag with the following code for customer__title.
{% if customer %}
# Welcome {{ customer.first_name }}!
{% endif %}
If you need further assistance, please let me know. If you found my help useful, consider liking this message and marking it as the solution.
Best regards
K.K
1 Like
Thank you @Huptech-Web working ![]()
i need one more thing. I need to validate the email in the account page. How can I do that? Can you please help me?
sure @timoo23 Allow me a couple of minutes.
Please share to Arvind Lakeview.
Please try this code @timoo23
document.querySelector('#my-form').addEventListener('submit', function(event) {
const email = document.querySelector('#email').value;
if (!email.includes('@')) {
event.preventDefault();
alert('Please enter a valid email address.');
}
});
Please replace the #my-form with your form id and email with your email input id.
Best regards
K.K
1 Like
Hello @timoo23 ,
So get more of layouts for accounts page . you can basically do some custom code or may be use some of the Customer accounts app .
