Voting starts in March for the Drupal Association Board election.
Extension module for Drupal Commerce, providing:
- Contribution product type,
- Contribution display content type,
- Contribution line item,
Inspired by Randy Fay's idea of using Custom Line Items to provide a donation feature to Drupal Commerce.
Developed in line with new Drupal Commerce approach of making as few hard-coded assumptions as possible about how a site's eCommerce systems should function - therefore using only entities, rules and views, with nothing hard-coded, and all features imported through Features module, thus making them fully configurable and changeable.
Built as much more flexible alternative to Commerce Contributions module, trying not to force any behaviors on the end users and avoid creating new products for each contribution transaction.
Contribution product type
commerce_pricefield as Target amount - a maximum amount that can be contributed to each project.
- Defines new field
field_already_contributedused for storing total already contributed amount for each project.
Contribution display content type
Content type used specifically for displaying Contribution products on the site.
Contribution line item
- Defines new Price-type field
field_contribution_amountused on Add to Cart forms for entering contribution amount.
- Merge line item quantities
Updates line items having quantities higher than 1 back to 1, at the same time multiplying their previous unit price by previous quantity.
- Merge duplicate contribution products + Sum duplicate contribution product amounts
Merge multiple line items for the same product into one, adding up their unit prices.
- Disallow too big contributions + Calculate total contribution for a product + Compare total contribution with target amount
Makes sure that sum of all previous contributions for a specific product and new Contribution amount entered when adding a Contribution product to shopping cart do not exceed Target amount defined for a product.
- Use contribution amount in line item
Updates line item Unit price with Contribution amount entered when adding a Contribution product to shopping cart.
- Update total contribution amounts from completed order + Update total contribution amount for a product
Update contribution product's Already contributed field value after order has been marked as completed.
- admin Contributions, available in admin area, listing all contributions,
- User contribution, available in user profile, listing only user contributions.
- Drupal Commerce modules: commerce_cart, commerce_price, commerce_product_reference, commerce_product_ui
- Commerce Features
- Commerce Custom Product
- There is some funny behavior when importing Contribution line item type feature, when sometimes two new line item types are being created, one of those without the machine name. If such thing happens to you just get rid of the additional line item type.