Transfer credits widget
Transfer credits widget (administrator use)

Summary

Commerce Credits Transaction extends the Commerce Credits controller class, and
implements a transaction entity to allow credit transfers to be reversible.

The primary use case is for a user to pledge credits to another entity.

Changes to Commerce Credits Behavior

  • Commerce Credits controller class is overridden by Commerce Credits Transaction:
    • All Commerce Credits operations will create a transaction.
    • Remove credits will *not* delete the credits entity if the amount of credits is less than 1.
  • Rules
    • It is recommended to use the Commerce Credits Transaction transfer rule action instead of the Commerce Credits transfer rule action.
  • Widget
    • An improved widget that uses CTools should be used for paying or pledging credits.
    • A CTools content-type plugin is provided that requires a node content for spending credits to node entities.

Usage

  • Create a rule to add credits on checkout for commerce credits product per Commerce Credits instructions.
  • Add a link to the pay widget for an entity with the "ctools-use-modal" class:
    • credits/transaction/<strong>CREDITGROUPTYPE</strong>/<strong>ENTITYTYPE</strong>/<strong>ENTITYID</strong>/nojs
      • Optionally the entity to transfer from can be added to the end of the URL if the user has access to do this. By default, the current user will pay from their credits store.
      • An example using the default Commerce Credits group installed via Commerce Credits UI and for nodes: <a href="credits/transaction/credit/node/1/nojs" class="ctools-use-modal">Pay</a>
    • OR use the content-type plugin to add the widget to panels with a node context.
  • Create a rule to reverse credits from an entity such as when a node is unpublished or a field on a node changes to a different value.
  • Review transactions at admin/commerce/credits/transaction.

This module is still supported in Drupal 7, but not needed in Drupal 8.

Project information

Releases