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
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
Thanks Pro!
I was looking for this for a long time :D
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
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?
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?
i mean are you trying this with YOUR username?
or has a custom ordered & it said your username>?
A customer ordered and it says my username.
sorry, i cannot help with this.
Thanks anyway Pro.
Use forum search button more often, please. Thread 'Phone number from customer in billing address' is worth checking.
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.
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
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?
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
What do you have by applying
<?php
print_r($this->userfields[fields]);
?>
?
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] =>
Damn it was close. You need to visit official Joomla forum or google your Joomla specific issue.