Zen Cart Logo
Forums / General Questions / Populating zen cart shopping cart from a script

Populating zen cart shopping cart from a script

Locked

Views: 1,400

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
17 Dec 2010, 10:04 AM
#1
webcomsystems avatar

webcomsystems

New Zenner

Join Date:
Aug 2009
Posts:
9
Plugin Contributions:
0

Populating zen cart shopping cart from a script

Hi,

I'm trying to populate the zen cart shopping cart from a script in a client installed program.

I will be posting to a url script (written by me) and then use this script to populate set items into the cart.

The user will then be be prompted to log on or register, then proceed to Checkout.

the problem is I cant find where these items are stored? Where does the shopping cart reside? Which table?

I'm using Zencart 1.3.9 on LINUX/apache server.

thanks in advance.

21 Dec 2010, 12:19 PM
#2
webcomsystems avatar

webcomsystems

New Zenner

Join Date:
Aug 2009
Posts:
9
Plugin Contributions:
0

Re: Populating zen cart shopping cart from a script

No one got any ideas???

21 Dec 2010, 12:33 PM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Populating zen cart shopping cart from a script

I cant find where these items are stored?

Where does the shopping cart reside? Which table?
They are only temporary until ordered, then they are in the orders table

Not sure what you are attempting from your description

So a better detailed description might be in order

21 Dec 2010, 2:07 PM
#4
webcomsystems avatar

webcomsystems

New Zenner

Join Date:
Aug 2009
Posts:
9
Plugin Contributions:
0

Re: Populating zen cart shopping cart from a script

Basically I have a client-installed application which can post to a url and order supplies from my shop.

so the post url could be....

http://www.myshop.com/populate_cart.php?item1=101&item2=32&item3=50

So I want to write my script populate_cart.php to handle adding items into the cart.

Now, I know that you dont need to be logged on to Zen Cart to add items to your shopping cart, but what I need to know is where the items are actually stored?

I thought it was in the orders_products table but it appears not.

Can anyone help? there must be a table somewhere that stores this data, since it cant be stored in a cookie, too small!

Any help appreciated.

21 Dec 2010, 2:14 PM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Populating zen cart shopping cart from a script

what I need to know is where the items are actually stored?
If you mean products then they are in the 'products" table

If not then again expand on what your are actually referring to...

21 Dec 2010, 2:55 PM
#6
webcomsystems avatar

webcomsystems

New Zenner

Join Date:
Aug 2009
Posts:
9
Plugin Contributions:
0

Re: Populating zen cart shopping cart from a script

what I mean is, where are the shopping cart items stored when you add an item to the cart?

Normally it's the orders_products table, if you're logged on.

But if you're NOT logged on, where are they stored? There must be another "non-authenticated" cart somewhere? ie some kind of session cart which stores the items to your cart as you add them.

thanks

21 Dec 2010, 3:02 PM
#7
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Populating zen cart shopping cart from a script

where are the shopping cart items stored when you add an item to the cart
These are the tables where a logged in customers added items are saved if purchase is not completed

customers_basket
and
customers_basket_attributes

21 Dec 2010, 3:45 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Populating zen cart shopping cart from a script

Items just added to a cart are not stored in the database but in session variables.

21 Dec 2010, 8:40 PM
#9
webcomsystems avatar

webcomsystems

New Zenner

Join Date:
Aug 2009
Posts:
9
Plugin Contributions:
0

Re: Populating zen cart shopping cart from a script

Ah!
thank you!

I suspected this, since I did more tests and found that the customers_basket table was empty after adding items to the cart.

So how would I add items to the session with a script then?

Presumably there's already a Zen Cart module which handles this?
Can someone point me in the right direction?

thanks!

21 Dec 2010, 9:15 PM
#10
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Populating zen cart shopping cart from a script

webcomsystems:

I suspected this, since I did more tests and found that the customers_basket table was empty after adding items to the cart.
=gjh42Items just added to a cart are not stored in the database but in session variables.
Note the "just" referenced....that means logged in or not they are stored in a session variable
If a not logged in shopper leaves these are not maintained anywhere as the session expires

If you are logging in and adding to your cart without completing the purchase, then you should be seeing them in the table I referenced.
You must be logged in for this to be saved in the table

21 Dec 2010, 9:26 PM
#11
webcomsystems avatar

webcomsystems

New Zenner

Join Date:
Aug 2009
Posts:
9
Plugin Contributions:
0

Re: Populating zen cart shopping cart from a script

Thanks,

but in the majority of cases the customer will not be logged on to Zen Cart.

Therefore, I need to create a script that will handle the POST from my client app and populate the session variables with this data.

In other words, the client app will have shop items with their corresponding quantities POSTed to the Zen Cart, then the session cart will be populated with this.

Then the customer logs on (or registers) to go to the Checkout.

So, I need to know which Zen cart script handles the population of products_id and customers_basket_quantity into the session?

21 Dec 2010, 10:59 PM
#12
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Populating zen cart shopping cart from a script

In other words, the client app will have shop items with their corresponding quantities POSTed to the Zen Cart, then the session cart will be populated with this.

Then the customer logs on (or registers) to go to the Checkout.
ZenCart already handles this without the need for an additional script

22 Dec 2010, 11:14 AM
#13
webcomsystems avatar

webcomsystems

New Zenner

Join Date:
Aug 2009
Posts:
9
Plugin Contributions:
0

Re: Populating zen cart shopping cart from a script

Yes, I know.

but where is the script that does this?

I need to see it so that I can interface with it with my own handler from my client app.