Jump to content

Get phone from customer first address


Striker Production
 Share

Recommended Posts

I want to send parameters from customer (name,e-mail and phone) and the product name to contact form with tpl an js. But the problem is how to get the phone value, i know only you can get phone like that in tpl {$customer.addresses [Address ID] .phone}. I know you can have multiple addresses, but i want to get first one, and of course to check if it exist. All this data i want to add is in product.tpl file. Any solution how to get first Address ID from customer?

 

Quote

 

<!--Contact Form Parameters-->

{if $customer.is_logged}

<p>Customer FirstName : {$customer.firstname}</p>

<p>Customer Name: {$customer.lastname}</p>

<p>Customer Email: {$[customer.email](https://customer.email)}</p>

<p>Customer ID: {$[customer.id](https://customer.id)}</p>

<p>Phone: ***~~{$customer.addresses\[7\].phone}~~***</p>

{/if}

{if $product.name}<p>Product: {$product.name}</p>{/if}

<!--/Contact Form Parameters--> 

 

  

 

 

 

Edited by Striker Production (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More