![]() |
Retrieve $login variable outside of x-cart pages
I have a shop currently that has category and product pages which have html add to cart links to x-cart. I would like to have my other pages be able to retrieve the $login variable from x-cart once it is set and greet the user on all other pages not generated by the smarty engine. I've tried setting it as a session variable but that doesn't seem to work. Does anyone know how to greet users on non smarty pages?
Thanks, Marnix |
|
that doesn't seem to offer how to retrieve the $login variable after it has been set though, I just need to be able to access it for other pages... any ideas?
|
I have the same need - 1 website with 2 sections that need to be linked but separate.
Section 1. has user membership requiring login to view content/member-only pages. This is already built with custom admin front end etc Section 2. is the site online store which takes care of prod orders + user logon details Both sections access the same database but I don't want to make users login twice if I can just carry a session variable across between pages, accessing {$login} from the other section of the site. Any help appreciated :) |
Re: Retrieve $login variable outside of x-cart pages
Are there any updates on this?
I have a website running two different applications, a custom PHP application in one directory, and x-cart in another. I am interested in figuring out how to retrieve the $login variable from my custom PHP app, since I would like to show a login form if $login is empty, and hide the form if $login is set. Also, as a side question, is it possible to retrieve cart information on non-xcart pages? Showing a mini-cart on my custom PHP app would be pretty useful as well. Any thoughts? |
Re: Retrieve $login variable outside of x-cart pages
Not very good coding practice but you can use a global variable to allow access to the data. To add this all you need is to add this line to any php module where $login is being either set and used.
Code:
global $login; Then use the $login variable as you would normally. To use the $login in a tpl module it will be more complicated. To access it on a tpl page you can use this code: Code:
{php} |
Re: Retrieve $login variable outside of x-cart pages
Hey rogue,
Thanks! Insightful information, might come in handy for other uses. I actually found another thread that discussed how to add login/minicart functionality to non-xcart pages. Here it is for anyone that's interested: http://forum.x-cart.com/showthread.php?t=14443 Best regards, ewebartist |
All times are GMT -8. The time now is 11:28 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.