| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
How to get email address of logged on user? | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Sorry, I'm still new to editing X-cart. Hopefully this will be an easy one. I just want to get the email address of the logged on user so I can build an html link.
I'm editing the new archive template /common_files/modules/News_Management/customer/news_archive.tpl Here is the code I've written for test purposes. Code:
What do I put in place of {$email} so it will return the e-mail address? Arren X-Cart Pro v 4.5.4 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() If you are using email as username (which I recommend), then just try {$login}.
Another one to try if you are using product notifications: {$prod_notif_prefilled_email} On some pages, like my account and checkout areas you can use {$userinfo.email} Try using webmaster mode to learn what variables are assigned to the page in question.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#3
|
|||||||
|
|||||||
![]() Thanks for the tip, but unfortunately the e-mail address is not being used as the username right now. I have to do a cleanup of users before I can switch to that mode.
I ran webmaster mode, but didn't see any variables for the email address when I was on the page. So.. I guess my question is, How do get get the e-mail address of the logged on user from the database and return it to a template so I can use it in an html link?
__________________
X-Cart Pro v4.5.5 |
|||||||
#4
|
|||||||||
|
|||||||||
![]() If we could do this from a page that had $userinfo assigned like the my account page, then this would be a snap.
It's not going to be that hard, but it is going to require some PHP and a database query. First, lets determine what php page you are working with. Can you provide a link to the page? What does it say in the address bar? Is it news.php? If so then we are going to have to place some code in that php file, to query the DB and assign it to smarty. Open up news.php and try adding this to the bottom: Code:
Add it right before: Code:
Be sure to make changes like this on your dev/test site first, and make backups if the original files, and note the change in your changelog.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
#5
|
|||||||
|
|||||||
![]() Thanks! That worked like a charm!
Arren ![]()
__________________
X-Cart Pro v4.5.5 |
|||||||
|
|||
X-Cart forums © 2001-2020
|