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

Bob Patin bob at patin.com
Tue Jul 28 18:06:01 MDT 2009


Another note: in a registration project I just worked on recently, we  
did use a temp table for registrations, because there were so many  
disparate elements to it--probably about 5 tables containing hotel  
room reservations, a guest list, registration info, choice of  
sessions; then, when money is collected, the session's main ID is  
written to the actual transactions table, and all the other elements  
pull in from relationships.

To keep the database slim and trim, there's a script that is fired  
every minute on the server; it looks for any transaction in the temp  
table that wasn't finished within 30 minutes; if one exists, it's  
deleted. The same script also takes care of sending an email to the  
registrant as well; if they finished their reg., it sends their  
confirmation; if they abandoned their cart, it sends an email to that  
effect.


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:59 PM, Bob Patin wrote:

> 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
>
>
> <new_logo_idea3_120w2.jpg>
> 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
>
> _______________________________________________
> 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