Display address data in user account mail

  • Posts: 107
  • Thank you received: 0
11 years 8 months ago #93110

Hallo,

I want to display Address Data in user account mail
I added followed code:

<?php echo JText::sprintf('HIKA_USERNAME').' : '.$data->username;?><br/>
<?php echo JText::sprintf('HIKA_PASSWORD').' : '.$data->password;?><br/>
<br/>
<?php echo JText::sprintf('HKASHOP_USER_ID').' : '.$data->user_id;?><br/>
<?php echo JText::sprintf('TITLE').' : '.$data->address_title;?><br/>
<?php echo JText::sprintf('FIRSTNAME').' : '.$data->address_firstname;?><br/>
<?php echo JText::sprintf('LASTNAME').' : '.$data->address_lastname;?><br/>
<?php echo JText::sprintf('COMPANY').' : '.$data->address_company;?><br/>
<?php echo JText::sprintf('POST_CODE').' : '.$data->address_post_code;?><br/>
<?php echo JText::sprintf('CITY').' : '.$data->address_city;?><br/>
<?php echo JText::sprintf('TELEPHONE').' : '.$data->address_telephone;?><br/>
<?php echo JText::sprintf('FAX').' : '.$data->address_fax;?><br/>
<?php echo JText::sprintf('STATE').' : '.$data->address_state;?><br/>
<?php echo JText::sprintf('COUNTRY').' : '.$data->address_country;?><br/>
<?php echo JText::sprintf('HIKA_EMAIL').' : '.$data->email;?><br/>

username, password, user_id und email is displayed
Other Fields are not displayed
What is wrong?

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
11 years 8 months ago #93246

Hi,

You can't just guess the variables...

Do a var_dump of $data and you will see that the address data is not in $data, but in $data->address_data.

So you need to do actually $data->address_data->address_firstname and not $data->address_firstname in your code.

The following user(s) said Thank You: cobinet_edv

Please Log in or Create an account to join the conversation.

  • Posts: 107
  • Thank you received: 0
11 years 8 months ago #93549

Hallo,

and where is adress_data in "Order creation notification" mail?

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
11 years 8 months ago #93810

There are two address_data in the order creation email.

The billing address data: $data->cart->billing_address
and the shipping address data: $data->cart->shipping_address

Please Log in or Create an account to join the conversation.

Time to create page: 0.056 seconds
Powered by Kunena Forum