Experimental project

This is a sandbox project, which contains experimental code for developer use only.

This is a complete rewrite of the commerce_contributions module https://drupal.org/project/commerce_contributions.

It uses a field collection instead of creating a custom field meaning no new database tables or queries are required. It also doesn't force the use of custom products or line items which means you can add a contribution meter to anything you want. Meaning you can put the contribution meter on any product display, product variation, line-item, page, comment, whatever is fieldable.

In order to accomplish the same goals but using less intrusive code I leveraged some basic functionality.

1. Field Collection is used to store the current and goal amounts so that line items and products don't need to be custom modified by the module and no custom fields either.

2. A Field Collection formatter was all that is needed to extract the values from the collection to build the themed output for the meter.

3. The field collection can be placed anywhere you want on a product display, product variation, line item...whatever you want (Note: You'll need to update the rule to make this work.)

Project information

  • Project categories: E-commerce
  • Created by ben.bunk on , updated