News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

username in orders' e-mail

Started by holanpan7, September 16, 2013, 17:52:40 PM

Previous topic - Next topic

holanpan7

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

PRO

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


holanpan7

Thanks Pro!
I was looking for this for a long time :D

holanpan7

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

PRO

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?


holanpan7

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?

PRO

i mean are you trying this with YOUR username?

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

holanpan7

A customer ordered and it says my username.


PRO


holanpan7


Maxim Pishnyak

Use forum search button more often, please. Thread 'Phone number from customer in billing address' is worth checking.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

holanpan7

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.

PRO

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


Maxim Pishnyak

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?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

holanpan7

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