In reference to
OpenGeek’s post, What do you think is the best practice for the next version of Treasure Chest.
The following would be standard in either scenario
- Modular checkout system, easily extendable via subclass of Checkout.php so any programmer can write a paypal, google checkout, etc... checkout.
- Support for multiple options (color, size, flavor, whatever) and support for multiple options on the same item in the cart (a green shirt AND a red, medium shirt (shirt is a single product).
- Support for multiple shipping methods and ability to set shipping calculation by total weight, per item, or flat rate.
As Jason said, there is a lot of overhead if you have many, many products and are using the document interface (and TVs) for setting product attributes, BUT... there is a huge convenience for end users that you may turn the site over to in that they can keep products organized in the document tree, use Ditto to display by tags or document hierarchy, and have the included search functionality.
Putting the products in a separate database table (or tables) will definitely lower the overhead with big catalogs, and will abstract all the product management to an easy module interface, but may result in complex snippet calls and would probably add query strings to the URL which might be something you are trying to avoid.
As many of you know, I am a huge fan of the jQuery javascript library. If a separate table and a module are chosen I am considering
Flexigrid for jQuery for the catalog list (see example 3). This would allow searching by product name, category, price, etc...
The original TreasureChest was a closed development environment and, I think, as a result turned out to be of limited use. I want Treasure Chest 2 to be a community project in every aspect, from planning to implementation, to best practices, to documentation (especially documentation!). I think we can all agree that a community driven project will be, by necessity, more useful, extendable, and customizable because there are only so many potential end use situations that a single developer can anticipate, and many eyes make all bugs shallow. Also, if any community can pull this off, it is the MODx community.
I am voraciously awaiting your feedback, and please note that this poll and these comments are not restricted to developers. Anyone who would like to contribute to this project in any way is welcome. I have set up an SVN with google code (for the time being), and will humbly assume the role of primary developer on this project, but many cooks are invited to this kitchen.
I have begun work (rework, started from scratch a dozen times, whatever) on some of the classes for abstracting things like checkouts, a singleton to manage the cart session, and a few other things, but before any hard core coding gets underway, I would like the community to establish some best practice guidelines, and together we can get a general layout of how this should work.
-sD-
Dr. Scotty Delicious, DFPA.