VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: holanpan7 on September 16, 2013, 17:52:40 PM

Title: username in orders' e-mail
Post by: holanpan7 on September 16, 2013, 17:52:40 PM
Hi,

I would like to add the client's username in the e-mail received when placing an order.
I search all the forums but coudn't find any tips. Can anyone help?

Thanks a lot
Title: Re: username in orders' e-mail
Post by: PRO on September 17, 2013, 03:20:43 AM
http://forum.virtuemart.net/index.php?topic=90935.0

This code will print the username
<?php
$user = JFactory::getUser();
    echo 'Your username';
      echo $user->get('username');
?>


The order email templates are in the


views/invoice    folder.

also, do all customers have to register? If not, than the code needs to change a little

Title: Re: username in orders' e-mail
Post by: holanpan7 on September 17, 2013, 22:10:19 PM
Thanks Pro!
I was looking for this for a long time :D
Title: Re: username in orders' e-mail
Post by: holanpan7 on September 18, 2013, 09:17:52 AM
Hi Pro,

I tried to put the piece of code in mail_html_shopperaddresses.php but it returns the administrator's username i/o the user's username.

All my customer's need to register so they have their own username.

Any ideas?

Thanks
Title: Re: username in orders' e-mail
Post by: PRO on September 18, 2013, 14:53:01 PM
Quote from: holanpan7 on September 18, 2013, 09:17:52 AM
Hi Pro,

I tried to put the piece of code in mail_html_shopperaddresses.php but it returns the administrator's username i/o the user's username.

All my customer's need to register so they have their own username.

Any ideas?

Thanks


did you try and register separate?

&& is this from the backend, or from the frontend?

Title: Re: username in orders' e-mail
Post by: holanpan7 on September 18, 2013, 23:45:22 PM
This is from the e-mail I receive when an order is placed.
Instead of showing the customer's username it shows the administrator username in both the e-mail sent to the customer and to the admin.
What do you mean by register separate?
Title: Re: username in orders' e-mail
Post by: PRO on September 19, 2013, 00:48:47 AM
i mean are you trying this with YOUR username?

or has a custom ordered & it said your username>?
Title: Re: username in orders' e-mail
Post by: holanpan7 on September 19, 2013, 08:31:24 AM
A customer ordered and it says my username.

Title: Re: username in orders' e-mail
Post by: PRO on September 20, 2013, 20:20:10 PM
sorry, i cannot help with this.
Title: Re: username in orders' e-mail
Post by: holanpan7 on September 23, 2013, 11:26:57 AM
Thanks anyway Pro.


Title: Re: username in orders' e-mail
Post by: Maxim Pishnyak on September 23, 2013, 16:21:04 PM
Use forum search button more often, please. Thread 'Phone number from customer in billing address' is worth checking.
Title: Re: username in orders' e-mail
Post by: holanpan7 on September 24, 2013, 00:27:20 AM
Quote from: PRO on September 19, 2013, 00:48:47 AM
i mean are you trying this with YOUR username?

or has a custom ordered & it said your username>?

In fact, it is working fine when I use a customer's account to place an order. The problem is when I update the order status from the back end, it shows the administrator's username.
Title: Re: username in orders' e-mail
Post by: PRO on September 24, 2013, 01:11:48 AM
Quote from: holanpan7 on September 24, 2013, 00:27:20 AM
Quote from: PRO on September 19, 2013, 00:48:47 AM
i mean are you trying this with YOUR username?

or has a custom ordered & it said your username>?

In fact, it is working fine when I use a customer's account to place an order. The problem is when I update the order status from the back end, it shows the administrator's username.

yes, that will happen

because thats your username.

It is doable, BUT i do not have time to find the right code to do it

Title: Re: username in orders' e-mail
Post by: Maxim Pishnyak on September 26, 2013, 15:21:01 PM
Quote from: holanpan7 on September 24, 2013, 00:27:20 AM
In fact, it is working fine when I use a customer's account to place an order. The problem is when I update the order status from the back end, it shows the administrator's username.
Holanpan, is my previous post invisible for you somehow?
Title: Re: username in orders' e-mail
Post by: holanpan7 on September 26, 2013, 16:23:04 PM
Hi Maxim,

Sorry for not replying you. I did search the entire forum before posting but couldn't find an answer.

I searched and found the thread for 'Phone number from customer in billing address'

I tried echo $this->userfields[fields][username][value]; with no luck.
The username information is not in the variable

Title: Re: username in orders' e-mail
Post by: Maxim Pishnyak on September 26, 2013, 18:20:31 PM
What do you have by applying

<?php
print_r($this->userfields[fields]);
?>

?
Title: Re: username in orders' e-mail
Post by: holanpan7 on September 26, 2013, 20:38:56 PM
Hi Maxim,

Thansk for your help.
This is what I have. I cannot find the username.

Array ( [email] => Array ( [name] => email [value] => xxxx@yahoo.com [title] => E-mail [type] => emailaddress [required] => 1 [hidden] => [formcode] =>  [description] => ) [name] => Array ( [name] => name [value] => [title] => Nom à afficher [type] => text [required] => 1 [hidden] => [formcode] =>  [description] => Saisissez le nom qui sera affiché sur votre compte ) [company] => Array ( [name] => company [value] => [title] => Nom de la société [type] => text [required] => 0 [hidden] => [formcode] =>  [description] => ) [title] => Array ( [name] => title [value] => Mr [title] => Civilité [type] => select [required] => 0 [hidden] => [formcode] =>  Mr Mme Melle Autre [description] => ) [last_name] => Array ( [name] => last_name [value] => Lanpan [title] => Nom [type] => text [required] => 1 [hidden] => [formcode] =>  [description] => ) [first_name] => Array ( [name] => first_name [value] => Ho [title] => Prénom [type] => text [required] => 1 [hidden] => [formcode] =>  [description] => ) [address_1] => Array ( [name] => address_1 [value] => dsd [title] => N° et nom de la rue [type] => text [required] => 1 [hidden] => [formcode] =>  [description] => ) [address_2] => Array ( [name] => address_2 [value] => dgrgf [title] => Entrée, bâtiment, immeuble, résidence [type] => text [required] => 0 [hidden] => [formcode] =>  [description] => Entrée, bâtiment, immeuble, résidence ) [zip] => Array ( [name] => zip [value] => 93561 [title] => Code postal [type] => text [required] => 1 [hidden] => [formcode] =>  [description] => ) [city] => Array ( [name] => city [value] => dsdfsd [title] => Ville [type] => text [required] => 1 [hidden] => [formcode] =>  [description] => ) [virtuemart_country_id] => Array ( [name] => virtuemart_country_id [value] => France [title] => Pays [type] => select [required] => 1 [hidden] => [formcode] =>  -- Sélectionner -- Allemagne Andorre Autriche Belgique Bulgarie Chypre (pays) Danemark Espagne Estonie Finlande France Grèce Hongrie Irlande Italie Liechtenstein Lituanie Luxembourg Malte Monaco Pays-Bas Pologne Portugal Romania Royaume-Uni République tchèque Saint-Siège Slovaquie Slovénie Suisse Suède [description] => [country_2_code] => FR [country_3_code] => FRA ) [phone_1] => Array ( [name] => phone_1 [value] => 026217984 [title] => Téléphone [type] => text [required] => 1 [hidden] => [formcode] =>  [description] => ) [phone_2] => Array ( [name] => phone_2 [value] => [title] => Portable [type] => text [required] => 0 [hidden] => [formcode] =>  [description] => ) [codeporte] => Array ( [name] => codeporte [value] => A3265 [title] => Code porte [type] => text [required] => 0 [hidden] => [formcode] =>  [description] =>
Title: Re: username in orders' e-mail
Post by: Maxim Pishnyak on September 30, 2013, 07:10:15 AM
Damn it was close. You need to visit official Joomla forum or google your Joomla specific issue.