[FX.php List] Shopping Carts - Keep in SessionVars or Add Records right away?

Bob Patin bob at patin.com
Tue Jul 28 17:59:52 MDT 2009


I've taken to using session variables for registrations, and then  
don't write to the database until the process is completely finished.

For a shopping cart, it's really easy to create an array of lineitems;  
all you really need to store are the item number and quantity, and  
then store the buyer's info in session variables as well.

I used to use a temp table for the cart, plus a 2nd table of  
lineitems; then I could tie both the temp order and the finished order  
to the same lineitems.

My current thinking though is to use all session variables until after  
money has been collected.


Bob Patin



Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
Twitter: bobpatin
iChat: bobpatin
AIM: longterm1954
FileMaker 9 & 10 Certified Developer
Member of FileMaker Business Alliance & FileMaker TechNet
--------------------------
FileMaker hosting and consulting for all versions of FileMaker
Web hosting • PHP • Full email services • Free DNS hosting •  
Colocation • Consulting

On Jul 28, 2009, at 6:14 PM, Tim 'Webko' Booth wrote:

>
> On 29/07/2009, at 9:11 AM, Joel Shapiro wrote:
>
>> Hi all
>>
>> Anybody have any thoughts on *when* in shopping cart functionality  
>> it's best to add items as records to the database?
>>
>> My initial thinking is that it would make more sense to just keep  
>> items in Session Variable arrays and only add anything to the  
>> database at the time of Checkout -- to keep the DB from bulking up  
>> with unpurchased items left in the cart.  But searching online, it  
>> seems that carts often add records to the database as soon as they  
>> go into the cart.  (Might that be different when using MySQL as  
>> opposed to FMP?)
>>
>> FWIW - Users on this site will average 1-4 items per order.
>
> I tend to add them immediately - allows me to also re-show previous  
> not actually purchased items on request further down the track...
>
> Cheers
>
> Webko
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

-------------- next part --------------
Skipped content of type multipart/related


More information about the FX.php_List mailing list