CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Bookstore / Portal

Print topic Send  topic

Author Message
Don
Posted: 04/05/2002, 4:54 PM

I'm trying to incorporate the shopping cart aspects of Bookstore into Portal and I have it more or less working except for a couple things.

I notice that new items added to the cart each have a separate order ID number. How can this be? What would happen if the same customer came back much later after this purchase and wanted to buy other things? Since it is apparantly using only the customer ID, wouldn't the old ones still show up in the cart? How can I use the session ID instead, which will be different the next time, or in some other way give all the items the same order ID?

Also, when I add a new item to the cart, it seems to be missing the item number and price even though I can see its description. It does not show up when I view the cart unless I go into the database and manually enter the number. The card form is submitting it (I see it in the source code) but it appears that the cart itself is not receiving it

I am doing all this in PHP with a MySQL database.
Nicole
Posted: 04/06/2002, 1:38 AM

Don,
1. when user confirms the purchase all item belong to logged in user should be deleted from orders table.
2. probably item number and price are of Label type on the form that is used as 'Add to shopping cart'. Label fields are non updatable and they are not included into generated sql query. The workaround is to duplicate Label field with Hidden field and assign them different names on field properties.
Don
Posted: 04/08/2002, 12:27 AM

Yes, I discovered that I needed to give another variable name so now it is getting the "ItemID" that was missing before and the newly added items are showing up in the cart because of it. I'll look into the hidden form tags for the price and subtotal.

I do not see any kind of facility that would empty out the cart nor any "submit order" button at all. Maybe it got lost when I imported the Bookstore pages into the Portal site.

I think though, that I want the items to remain in the cart for use on an invoice that the buyer can access at any time so I would like to use the session ID in a new field in the Orders table but I cannot figure out the PHP value for the session ID. In VBScript it is something like session.id (I don't have it in front of me but it's something like that) but I don't know what it is in PHP. Can you tell me? I know the session ID will be different the next time but that should not be an issue as long as it's the same for a given cart's contents. Any new items they add on the next visit will then have a different one so will become a new order.

Don
Don
Posted: 04/08/2002, 6:13 PM

To answer my own question, to get the session ID value in PHP:

$session = session_id();

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.