I'm building a shopping cart in Coldfusion. Anyone have advice and tips as I get started with this? Any good tutorials for any part of a good shopping cart application? Any direction or code snippets you can share would be much appreciated.
I normally use a session based structure that holds all user and session information, as well as the cart contents. Don't be afraid to use <cftransaction> liberally.
Do you use an array of structures? And, why would you use a session variable rather than a client variable for cart content info?
Depending on your CF Admin setting, Client variables could be stored in a client side cookie, while session vars are stored in a session cookie. Most shared hosting companies use this setting (the other options are in the windows registry, or in a database) If the user does not accept cookies and that is your setting for client vars, then the application will not work for them. One benefit of using client cookies, though, is that the cart will remain populated if the visitor comes back on another day... I use a structure that includes an array for cart items.