X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Mini-cart (or other functionality) on a non-xcart page (https://forum.x-cart.com/showthread.php?t=14443)

Jon 12-28-2006 02:45 PM

Re: Mini-cart (or other functionality) on a non-xcart page
 
Change <? to <?php, the cannot initiate program error indicates that the code is working correctly.

You need to change the necessary things in the code, beginning with:
require_once "/your/full/path/to/xcart/auth.php";

pcarcare 12-28-2006 03:02 PM

Re: Mini-cart (or other functionality) on a non-xcart page
 
The opening tag that I was using was <php? - still learning php. When I open the script with <? I get the error....

ERROR: Can not initiate application! Please check configuration.

Using <? for the opening tage and removing

"require_once "/home/myusername/public_html/store/auth.php";"

gives me this error....

Fatal error: Call to undefined function: x_session_register() in /home/myusername/public_html/ext_menu_cart.php on line 4

This makes me think that I am calling the auth.php file incorrectly. I am sure that I am using the proper path to the auth.php I verifed this path and confirmed it with xcart admin -> summary page.

I can't figure this out.........

pcarcare 12-28-2006 03:42 PM

Re: Mini-cart (or other functionality) on a non-xcart page
 
I added

@include_once $_SERVER['DOCUMENT_ROOT'] . "/store/top.inc.php";
@include_once "../top.inc.php";
@include_once "../../top.inc.php";

To auth.php and everything is working

Thanks for your help

Jon 12-28-2006 04:42 PM

Re: Mini-cart (or other functionality) on a non-xcart page
 
Excellent, glad I could help.

pcarcare 12-28-2006 04:59 PM

Re: Mini-cart (or other functionality) on a non-xcart page
 
Okay. I decided to work on the login form first. I got it working for the most part. I am using smarty on my pages outside xcart. I have setup a test index at http://www.professionalcarcare.com/index_test.php with my login form included in my home template I get this error....

Warning: Cannot modify header information - headers already sent by (output started at /home/myusername/public_html/Smarty-2.6.16/templates_c/%%63^631^6318A91D%% in /home/myusername/public_html/store/referer.php on line 61

Warning: Cannot modify header information - headers already sent by (output started at /home/myusername/public_html/Smarty-2.6.16/templates_c/%%63^631^6318A91D%% in /home/myusername/public_html/store/include/get_language.php on line 148

Warning: Cannot modify header information - headers already sent by (output started at /home/myusername/public_html/Smarty-2.6.16/templates_c/%%63^631^6318A91D%% in /home/myusername/public_html/store/include/get_language.php on line 149

Secondly when I call the login form directly at http://www.professionalcarcare.com/include/auth.php I can't login. It goes to the xcart error message "incorrect username or password" However, If I login from xcart and then go the external login form (/include/auth.php) it does show that I am logged in.

Any ideas what I can do to fix this problem?

pcarcare 12-28-2006 05:52 PM

Re: Mini-cart (or other functionality) on a non-xcart page
 
Just an update. I went ahead and created login.tpl and logout.tpl from the auth.php I earilier created. This corrects the "Warning: Cannot modify header information......"

However I still have the login problem.

sjrconsulting 11-07-2007 04:06 PM

Re: Mini-cart (or other functionality) on a non-xcart page
 
Anybody use this on a 4.1.9 Cart?

Also, is there a reason why this would not work on a different domain? The cart is installed on the same server, just a different domain.

Thanks
Steve

polren 12-11-2007 02:19 PM

Re: Mini-cart (or other functionality) on a non-xcart page
 
Jon,

Have you (or someone else) tried this code on 4.1.x?

typologist 12-25-2007 11:36 AM

Re: Mini-cart (or other functionality) on a non-xcart page
 
Excellent, thanks for this. I tested in 4.1.8 and worked smoooothly ;)

Deal-z 03-19-2008 12:43 PM

Re: Mini-cart (or other functionality) on a non-xcart page
 
I get this error:

Quote:

Could not connect to SQL db
Fatal error: Call to undefined function: x_session_register() in /*path*/carttest.php on line 31

Any ideas? Does the minicart have to be on the same domain, and IP?


All times are GMT -8. The time now is 01:31 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.