| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Mini-cart (or other functionality) on a non-xcart page | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Mini-cart (or other functionality) on a non-xcart page
I'm using mini-cart to php to show the theory behind how this works. You can do this for many of the x-cart features, including customer information, $login variable, etc.
It's important to understand however, that the auth.php adds overhead, because it essentially initializes x-cart. Definitely do not include auth.php more than once on a page. I've put the auth.php include inside this external_minicart.php, but if you are going to have several includes like this, you'll want to include auth.php only once per page and not in your includes. This example is for 4.0.13 Create a new file, called exernal_minicart.php with the following code and substitue your full path for the auth.php include: Code:
Include this file on any other php non-xcart page. |
|||||||||
#2
|
|||||||
|
|||||||
Jon,
I have tried this and changed the auth.php path correctly. I am getting a Code:
Any guesses as to what I am doing wrong?
__________________
x-cart 4.0.13 |
|||||||
#3
|
|||||||||
|
|||||||||
Unfortunately not too sure, I tested the exact code on a 4.0.13 without problem.
Is the rest of your store functioning? |
|||||||||
#4
|
|||||||
|
|||||||
The rest seems to be working just find. Like I said it seems not to matter whether I have the file in the xcart directory or not.
If I comment out the following line Code:
Code:
__________________
x-cart 4.0.13 |
|||||||
#5
|
|||||||||
|
|||||||||
Sounds like your config and whole site is likely messed up, what's the url?
|
|||||||||
#6
|
|||||||
|
|||||||
The URL is http://www.outdoorbasics.com/store
ok tried something and found this: If I place the file (minicart.box.php - or external_minicart.php) in the xcart directory it will work if I access it directly. Problem occurs if I try to include it in a file outside the xcart directory.
__________________
x-cart 4.0.13 |
|||||||
#7
|
|||||||
|
|||||||
If I change the following in auth.php
Code:
Code:
__________________
x-cart 4.0.13 |
|||||||
#8
|
|||||||
|
|||||||
Well, I believe that I figured it out. I had a bit of php code in the top of the file (file #1) I was trying to include the minicart into from one of the things I tried before that was causing it. I can even have the minicart file outside the xcart directory.
Thanks for the help, and sorry it was my stupid mistake. Another question I have is where did you get the info for the php code in the minicart file that pulls the info into the file? For instance if I wanted to do the same for the login 'box'. I am not asking for you do necessarily do it for me, but rather teach me where you got it or how to know what to pull so I can do any one that I want. Again, thanks for the help it is greatly appreciated.
__________________
x-cart 4.0.13 |
|||||||
#9
|
|||||||
|
|||||||
Another question:
What is the syntax here? Code:
Code:
Code:
Why?
__________________
x-cart 4.0.13 |
|||||||
#10
|
|||||||||
|
|||||||||
K, great, that was confusing for me
--------------- The code syntax: Code:
is equivalent to Code:
so you'd have to use: Code:
--------------- I pulled the mini-cart information from include/minicart.php and then added some additional code to pull additional info, removed all the smarty references and instead echo'd the information directly. |
|||||||||
|
|||
X-Cart forums © 2001-2020
|