Re: Product features system now in core

Ryan's picture
Joined: 08/07/2007
Juice: 15476
Re: Product features system now in core

Real briefly, some may be wondering why this system is even necessary. The short answer is that this creates a simple way for module developers to add optional data and features to products without having to add more and more fieldsets and form elements to the already long product node edit form. Having a simple review table makes it easy for administrators to see the features at a glance, and using a separate form for each feature makes it easier to have complex features and multiple features in a single product.

What your feature does is totally up to your module, along with what actions should fire off its code. For example, a multiple purchase discount module may use this system to administrators can go edit a product, go to its features tab, and click the add button for a quantity discount. That would then display the form from the module that lets them specify what discount to offer for what quantity (say 10% off for 5 or more, and another for 20% off for 20 or more). When the user proceeds to checkout, the quantity discount module would simply check the node IDs of product in the cart against the product features table and see if any quantity discounts have been applied to it. It would handle the logic to know how much of a discount to show on the line items section or elsewhere.

This should be used by modules looking to add any sort of per product feature. For example, a role promotion or a file download may be attached to a product. Depending on the module, they may let you add the feature to any purchase of that product or only to a purchase of that product with a particular SKU (think of a product that can either be a physical CD or a download in mp3 format).

I'm looking for early adopters to help refine the system, so consider using product features if you have any per product need.

Product features system now in core By: Ryan (11 replies) Wed, 10/03/2007 - 16:09