Hi Michael, Shopping cart philosophy. Always loaded with lively opinions. Here's mine:
I use a db. Someone pointed out earlier that these things always get more complex over time, and that's been my experience as well. A well-built db is going to be a lifesaver over the long haul. Performance has never been an issue. I'm sure its slower doing disk access vs. in-ram ops, but I have a server running dozens of these with mysql as the back end and have never had any problems, either with the server handling the load or having a visible slowdown in performance. I have heard AbleCommerce uses a db, but don't know if that's still the case. --Matt Robertson-- MSB Designs, Inc. http://mysecretbase.com -----Original Message----- From: Michael Tangorre [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 28, 2002 3:00 PM To: CF-Talk Subject: Shopping Cart Opinions Hi everyone. I have just created a simple shopping cart and wanted to get some thoughts on my approach to it. I create a structure of lists which is stored in the session scope. 1. cart.quantities 2. cart.prices 3. cart.products Basically every time I (add/remove/changeqty) a product, I go through and make changes to the three lists: Example: products list (holds product IDs) 1001, 1002, 1003, 1004 price list (hold price for sinlge product) 5.99, 6.45, 2.50, 8.99 quantity (holds quantity of product added) 2, 4, 1, 1 So basically everytime I perform an operation, I use ListFind to get the position in the list of the product whose ID is passed into the page. Using that location of the product in the list, I just perform simple insertions, deletions, and updates using the location. Does anyone see any downsides to this method? I build another cart using arrays, and the execution times for the templates were considerably longer. Hit me back with some pros and cons or comments. Thanks, Mike ______________________________________________________________________ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

