How to Sell Userpoints using the Rules module #Drupal
Using Userpoints commerce and Rules module, Drupal Commerce, ofc.
You can achieve this.
1) Rule
Event: on payment completed
Action: loop through the order line-items. Each line-item has an action to call the next component with parameters of order and the line-item.
2) Component
Parameters: order, line-item
Condition: data comparison line-item:type is Product (to expose line-item:commerce-product)
Action: call next component with parameters of order and line-item:commerce-product
3) Component
Parameters: order, product
Condition: data comparison product:type is Product (to expose the product:field-points-to-add)
Action: add userpoints, number to add being product:field-points-to-add
Written by Victor Reyes
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Drupal commerce
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#