I have a page on my site running another open source script that i want to access the Zen cart session from.
This page is not a zen cart page.
Is there a way to do this so I can display cart counts on this other page.
Thanks in advance
~D
I have a page on my site running another open source script that i want to access the Zen cart session from.
This page is not a zen cart page.
Is there a way to do this so I can display cart counts on this other page.
Thanks in advance
~D
Due to sessions security this is almost impossible
Zen-Venom Get Bitten
Thanks for the quick reply on this.
All i need is the cart count from this here.
Is there a way to save this data in a separate cookie or session outside of the Zencart DB Session.PHP Code:
$_SESSION['cart']->count_contents()
Everything I have tried stores it in the DB.
Thanks Again
Check your configure.php files forEverything I have tried stores it in the DB
Change to "none" or "file" see if this helpsdefine('STORE_SESSIONS', 'db');
none = ''
Zen-Venom Get Bitten
Yes, you could add your own custom code to Zen Cart to have it set another cookie with the information you seek. As long as the cookie's domain name matches the domain shared by both software systems.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Thanks Dr B.,
I got it working.
Question though, Should I be using something different for the expire time?
I used the following code to set the cookie.
Now on my non-zen pages I can call the value.PHP Code:
setcookie('zenGCT',$_SESSION['cart']->count_contents(),'0','/','www.mydomain.com');
I then though it would be a good idea to mask the actual count so I added some math.PHP Code:
echo $_COOKIE['zenGCT'];
andPHP Code:
setcookie('zenGCT',$_SESSION['cart']->count_contents() * 999,'0','/','www.mydomain.com');
You could set the 999 to whatever you wanted.PHP Code:
echo $_COOKIE['zenGCT'] / 999;
Bookmarks