| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Retrieve $login variable outside of x-cart pages | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() 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
__________________
V4.1 |
|||||||
#2
|
|||||||
|
|||||||
![]()
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
![]() 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?
__________________
V4.1 |
|||||||
#4
|
|||||||
|
|||||||
![]() 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 ![]()
__________________
v 4.1.0 |
|||||||
#5
|
|||||||
|
|||||||
![]() 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?
__________________
Cool. X-Cart v 4.1.8 (Live Site - Slowly dying) X-Cart v 4.1.11 (In Development- Being born) Joomla 1.5.6 + X-cart 4.1.11 Integration complete ![]() |
|||||||
#6
|
|||||||||
|
|||||||||
![]() 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:
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:
__________________
Richard Williams Rogue Wave Limited Initial Inventory Imports Daily Inventory Updates Daily Inventory Reports Drop Ship Support Order Export to Shipper/Supplier Shopping Feeds That Work Programming for X-Cart richard@roguewavelimited.com http://www.roguewavelimited.com |
|||||||||
#7
|
|||||||
|
|||||||
![]() 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
__________________
Cool. X-Cart v 4.1.8 (Live Site - Slowly dying) X-Cart v 4.1.11 (In Development- Being born) Joomla 1.5.6 + X-cart 4.1.11 Integration complete ![]() |
|||||||
|
|||
X-Cart forums © 2001-2020
|