| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
X-Cart minicart totals and login data on non x-cart pages | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
X-Cart minicart totals and login data on non x-cart pages
Jon has already posted another method of doing this that may or may not work better for some people depending on what you need to do, but here's what I use in X-Cart 4.1.8. I really didn't want all the x-cart overhead caused by adding xcart's auth.php file to the non-xcart part of my site, and I prefer to use PEAR MDB2/mysqli in most situations. Also, I don't care about letting people log in anywhere except inside x-cart, but when they go to a different part of my site, I still want to display their login info and minicart data, so I use the following scripts...
1. Create a file in your non-xcart part of your site called config.inc.php and it should contain the following: Code:
2. Create another file in the same directory called xcart_session_snooper.php and it should contain the following: Code:
Now you should have access to the minicart variables in the rest of you script which you can use as you see fit. I have used this method on standard PHP pages throughout a site, and you can even include the xcart_session_snooper.php file at the top of a Wordpress config file and it doesn't seem to interfere, so I just put my xcart_session_snooper.php file in the main site root directory and then include it from wherever I need it. Works great for me.
__________________
www.brettbrewer.com Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more. |
|||||||||
#2
|
|||||||||
|
|||||||||
Re: X-Cart minicart totals and login data on non x-cart pages
very good share. it would be quite useful for integrating other systems.
__________________
Dongan MercuryMinds Technologies Professional X-Cart Design, X-Cart Development, X-Cart Customization Services www.mercuryminds.com Follow us at Facebook / Twitter |
|||||||||
|
|||
X-Cart forums © 2001-2020
|