SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
Hybrid View
-
May 31, 2007, 04:11 #1
- Join Date
- Sep 2004
- Location
- Pakistan
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Cookie Based Or Session Based Shopping Cart
Hi!
I want to make shopping cart which should be based on PHP cookies or Sessions.
Some points :
A- Only data will be fetched from database [like product name, product picture , product price etc].
B- No data insertion in database tables [untill user clicks on checkout process]
C- All shopping cart calculations would be handled through PHP cookies or session values.
Can someone guide in this regards [some code example] and which approach is better :
1- Cookie based
2- Session Based
Thanks in advance
-
May 31, 2007, 04:15 #2
- Join Date
- Apr 2006
- Location
- Pennsylvania
- Posts
- 1,736
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Wel, really, I'd make it session based, but perhaps have an option for user login so that their data, information, and preferences can be stored longer.
-
May 31, 2007, 06:59 #3
- Join Date
- Sep 2004
- Location
- Pakistan
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes, data would be stored in database , but after login. As I don't want to store junk shopping cart data in database and then executing queries to cleanup database. I think it would be better to store data in sessions/cookies so only serious customer's [signed up customers] data would be stored in database .
Can anyone provide sample code about session/cookie based shopping cart.
Thanks in advance
-
May 31, 2007, 07:15 #4
- Join Date
- Apr 2006
- Location
- Pennsylvania
- Posts
- 1,736
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I really disagree. If they are logged in, and they add something to their shopping cart, you probably want it to still be there if they come back later on? That makes the most sense to me.
-
Jun 1, 2007, 04:59 #5
- Join Date
- Sep 2004
- Location
- Pakistan
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes, you are right, but I am all talking about shopping cart handling before login.
-
Jun 1, 2007, 05:19 #6
- Join Date
- Apr 2007
- Location
- India
- Posts
- 509
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This might help you.
shopping cartBarbara
-
Jun 1, 2007, 05:59 #7
- Join Date
- Sep 2004
- Location
- Pakistan
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks Barbara1712.....
Bookmarks