Re: How to add phone number in customer register page?- Dawn theme

Hi,

I want to add phone in account register page, so I have added new field with below code but it’s not working, can you please guide me on the same?


@bhumip

can you please share full code

Hi,

Here you can see full code, I want to add phone field at the time of user registration and want to store in phone field in customer section, you can see in below screenshots what I have tried and what I want to achieve.

frontend: https://prnt.sc/26skq36

backend code: https://prnt.sc/26skqbg

what I want to achieve: https://prnt.sc/26skrdk

I hope I make this question clear with all above description. Thank you in advance!

@bhumip

This solution does not work. could you please suggest?

probably too late to answer but this worked for me:

{{ customer.default_address.phone }}

Here’s the sample code for the input field:


NOTE: This only extracts the phone number from the default_address.

So, you need to extract the default_address name, email and other details too.

{{ customer.default_address.name }} 
{{ customer.default_address.email }} 

Sample Output: