Overview: Drupal Commerce is a fresh implementation of the Ubercart feature set on Drupal 7 using fieldable entities to the max and depending on Views and Rules. What a product is has been separated from how a product is displayed (see this thread for more details), and the attributes system has been completely redone to work through fields on product types and enforce unique SKUs for every variation of a product. While greatly improving the underlying data model, this adds to the complexity of listing products for sale, especially when closely related products need to be sold through the same display (i.e. multiple sizes of a particular t-shirt style). This project will take advantage of the field settings for fields on product types and Token patterns to create bulk product generation forms and enhancements to the Product Reference field and its Add to Cart form display formatters to present these products for sale.
Description: The Product module defines a fieldable product entity that can have multiple bundles and creates a default product type upon installation. The Product UI module defines a default UI for managing product types, forms for adding and managing products, and Views integration for viewing products.
The Product Reference module defines a field that references any number of products from other entities for display to the end user. Products themselves aren't currently meant to be viewed but rather referenced by the nodes (or other points of display) that market the products. The Cart module defines a display formatter for the product reference field that takes the referenced product IDs and builds a simple Add to Cart form using the data. When multiple products of the same type are referenced, the Add to Cart form will include widgets to select the appropriate product for purchase based on the fields of that product type.
For example, an apparel store might sell every style of t-shirt in small, medium, and large. With the core components, the process from product creation to merchandising for each style of t-shirt is:
- Create a new "T-shirt" product type and add a required Size field to it with the available sizes as options.
- Add a new T-shirt product for each Size with a unique SKU, likely using a pattern based on the Size (SHIRT-001-S, SHIRT-002-M, etc.).
- Create a "Product" node type and add a required Product Reference field to it that is multiple entry, uses the product autocomplete widget, and uses an Add to Cart Form display formatter.
- Add a new Product node for the style of t-shirt with images and descriptive text marketing the t-shirt for sale. Reference each variation of the style of t-shirt through the Product Reference field.
It's easy to see how this process will be cumbersome for store owners, especially as product types include more options per attribute or even multiple attributes. While the core modules will remain austere in terms of the default UI, this GSoC project should result in a module that aids in the speedy creation of large sets of products.
For example, steps 2 and 4 above could happen through a single form where a user chooses a product type, a Token based SKU pattern (perhaps using a default pattern per product type), and a display node type. Upon providing a product title, "T-shirt Style 001", and submitting the form, the module would automatically create a product for every variation of the attributes with a unique SKU based on the attribute values. Additionally, a new display node would be created that automatically references the newly created products, and the user would be redirected to the node's edit form to supply images for the new style and additional descriptive text.
The pay-off here is huge. The Commerce systems are necessarily complex, but a module like this can add a much needed usability layer to enable store owners to quickly list a large amount of products for sale. Assuming the module users the Forms API properly (i.e. defining a bulk product creation API that is called from form submit handlers instead of building all the functionality into the submit handlers), it will have huge implications for product import which has historically been a pain in Ubercart.
Additional functionality can target the much requested ability to list multiple products for sale via a single Add to Cart form using a custom display formatter for the product reference field that uses multiple quantity boxes to add any number of each referenced product to the shopping cart at once. Students should feel free to brainstorm usability solutions based on past experience, feedback in the Ubercart forums / issues, or your own bright ideas for making the lives of store owners easier.
The end result of this project will be a Bulk Product Creation module and patches to improve the core Commerce modules as necessary. The student who takes this on will be hailed as a hero and learn a thing or two about Drupal 7, fieldable entities, Drupal Commerce, and the Forms API along the way. ; )
- Ryan Szrama (rszrama)
Contact Details (email at minimum): Provided as necessary.