Earning Rules

Earning Rules define how customer can earn points. You can create as many rules as you need with their own conditions.

To create a new Earning Rule, go to the Reward Points -> Earning Rules and press the button Add New. You will be brought to the first stage of Rule creation.

On this stage you need to set up General Information options (common for all rule types), and select a Rule type:

  • Rule Name - name of the rule. Used only for internal purposes.
  • Type - type of the rule. This field is mandatory. There are following types of rules:
    • Behaviour Rule - triggers on certain events, that resemble customer's actions - signing in, or writing a review for example.
    • Product Rule - is the most simple of them. It features a hint on product pages (and on a categories - it, however, depends from theme), which shows, how much customer will receive points for buying that product. At the cart and checkout stage this rule calculates points amount only from product prices, and includes only tax, included to that price. Shipping charge and separate taxes are skipped.
    • Cart Rule - It does not feature hint on product page, because is applied only to cart in a whole. Therefore, points amount in this rule type is calculated from subtotal - e. q. actually paid money amount, which can include shipping fees and taxes.
  • Is Active - rule status.
  • Active From, Active To - period, during which rule should be applicable.
  • Websites - websites where rule will be active.
  • Customer Groups - customer groups for which rule can be applied.
  • Stop further rules processing - if enabled, there are no more rules will be applied after this rule.
  • Priority - order which will be used for rules sorting before applying.

Each type of rule have it's own purpose and use scope, as well as conditions set.


Behaviour Rules

These rules trigger in specific event, which corresponds to some customer's action.

Conditions

  • Event - customer's action which can trigger the rule. Available actions are:

    • Customer logs in to store - triggered on each login. This event is useful for threshold or lifetime loyalty points awards.
    • Customer places an order - triggered, whenever customer places an order, and it is completed (e. q. invoiced and shipped). Useful for awarding points for backend orders.
    • Customer signs up in store - triggered, whenever customer registers in store.
    • Customer votes - triggered, whenever customer votes in the poll. Read more about Magento Polls.
    • Customer emails product's link to a friend - triggered, whenever customer sends by email a link to a product.
    • Newsletter sign up - triggered, whenever customer subscribes to newsletter. Read more about Magento Newsletters.
    • Customer adds tag to a product - triggered, whenever customer marks product with some tag.
    • Customer writes a product review - triggered, whenever customer submits a review, but points will be rolled to his balance only on Review approval.
    • Customer has a birthday - triggered at 00:00 of customer's birthday. This rule is actually executed by special crontask mirasvit_rewards.
    • Customer is not active for long time - triggered, when customer has not logged in for a time period. This event also triggers additional Number of Inactive Days field, where you can specify time period.
    • Facebook Like - triggered, whenever registered customer likes one of your pages.
    • Facebook Share - triggered, whenever registered customer shares one of your pages.
    • Twitter Tweet - triggered, whenever registered customer tweets one of your pages.
    • Google+ Like - triggered, whenever registered customer shares on Google+ one of your pages.
    • Pinterest Pin - - triggered, whenever registered customer pins one of your pages to the Pinteres.
    • Referred customer signs up in store - triggered, whenever customer registers in store, on the same session, as visiting Referral Link.
    • Order from Referred customer - triggered, whenever customer, registered as Referral, places an order.
  • Conditions - customer's properties, that can be used to make rule application more precise. Available properties are:
    • Group
    • Lifetime sales
    • Number of Orders
    • Is subscriber to newsletter
    • Is referral (e. q. whether he is invited to the store by other customer)
    • Is referee (e. q. whether he invited to the store one or more other customers)
    • Number of Reviews
    • Balance points amount
    • Number of referred friends signups
    • Number of referred friends orders - number of orders, placed by customers
    • Sum of referred friends signups - total money amount of orders, placed by customers
    • Number of referred friends ordered at least once
    • Referred: Group - used, when event for referred customer is selected. Checks group, which assigned to referral.
    • Referred: Lifetime Sales - used, when event for referred customer is selected. Analyzes total for all completed orders of given referral.
    • Referred: Number of Orders - used, when event for referred customer is selected. Analyzes number of completed orders of given referral.
    • Referred: Is subscriber to newsletter - used, when event for referred customer is selected. Checks, whether referral is subscribed to newsletter.
    • Referred: Is subscriber to newsletter - used, when event for referred customer is selected. Checks, whether referral is subscribed to newsletter.

Actions

  • Number of points to give - number of points that customer receive if rule is applied.
  • Maximum number of earned points for one customer per day - limit the number of points gained by customer per day.
    If the limit is exceeded, points will not be added.
  • Assign customer to Group - allows to automatically transfer customer to desired Group on rule triggering. It is extremely used for planning Threshold Rules (e. q. when customer reaches a certain amount sales, for example) and Referral Policy.

For example, you can create the following behaviour rules in your store:

  • Write a review and receive 10 points

    • General Information:
      • Type: Behaviour Rule
      • Is Active: Yes
    • Conditions & Actions:
      • Event: Customer writes a product's review
      • Number of points to give (X): 10

     

  • Refer a friend and receive 100 points when your friend makes first order

    • General Information:
      • Type: Behaviour Rule
      • Is Active: Yes
    • Conditions & Actions:
      • Event: Order from Referred customer
      • Number of points to give (X): 100
      • Apply the rule only if the following conditions are met
        • Referred: Number of Orders is 1

     


Product Rules

Award points for buying particular product. This type of rule is recommended, when products are presumably simple and have fixed prices.

Conditions

Can contain either single condition, or their combination. Rule can be applied, only if all of them are met.

  • Conditions - product's properties, that can be used to make rule application more precise. Available properties are:
    • Category
    • Product Type (e. q. Simple, Virtual, Bundle, etc.)
    • SKU - can contain one or more SKU's. When use one SKU condition should use "is" and "is not" operators, when more than one - "is one of" or "is not one of".
    • Attribute Set - product attribute setup, created at Catalog -> Attributes -> Attribute Sets
    • Quantity
    • Base Price - base price of the product, set at the General tab in product's properties
    • Special Price - special price, used for actions and sales
    • Final Price - actual price, calculated when Tier of Custom prices are used
    • Base Image
    • Base Image Size
    • Small Image
    • Small Image Size
    • Thumbnail
    • Thumbnail Size
    • PHP Condition

PHP Condition used, when need to filter products on a specific property - custom attribute, for example. Having attribute code, it is possible to get it by putting direct PHP expression in this condition's text field.

Here is the universal expression for any product attribute:

$object->getAttributeText([ATTRIBUTE_CODE]) == [ATTRIBUTE_VALUE]

Attribute codes can be seen at Catalog -> Attributes -> Manage Attributes. For example, to get attribute with code "manufacturer" and check, if it is equal "Adidas", we can write down:

$object->getAttributeText('manufacturer') == 'Adidas'

Also, other product's attributes can be retrieved using this special condition, if the corresponding method exists in Magento API. Quick reference can be found there: Mage_Catalog_Model_Product

Actions

  • Customer Earning Style - algorithm to calculate the number of earned points.
    • Give X points to customer - awards fixed amount of points
    • Give points amount, equal to X percent of price - calculates percent from product's price, and converts to points at 1:1 rate.
    • For every Y, give X points - divides price by Y, and the remainder is the quantity of points.
  • Number of Points (X)
  • Step (Y)
  • Maximum Distributed Points - maximum number of possible earned points for current rule.

For example, you can create the following product rules in your store:

  • Buy product A and receive 100 points

    • General Information:
      • Type: Product Rule
      • Is Active: Yes
    • Conditions & Actions:
      • Conditions
        • SKU is A
      • Actions
        • Customer Earning Style: Give X points to customer
        • Number of Points (X): 100

     

  • Buy any product with price above $100 and receive 100 points

    • General Information:
      • Type: Product Rule
      • Is Active: Yes
    • Conditions & Actions:
      • Conditions
        • Base Price is greater than 100
      • Actions
        • Customer Earning Style: Give X points to customer
        • Number of Points (X): 100

     

  • Buy any product in the category Electronics and receive 1 Reward Point for each spent $1

    • General Information:
      • Type: Product Rule
      • Is Active: Yes
    • Conditions & Actions:
      • Conditions
        • Category is 19 (e. q. ID of Category Electronics)
      • Actions
        • Customer Earning Style: For every Y, give X points
        • Number of Points (X): 1
        • Step (Y): 1

     


Cart Rules

Award points for the total amount of actually spend money at the cart. This type of rule is recommended, when using tier or special prices (with taxes, dependent from shipping country, for example), which can dynamically alter the actual product sell price.

Conditions

Can contain either single condition, or their combination. Rule can be applied, only if all of them are met.

  • Conditions - cart's properties, that can be used to make rule application more precise. Available properties are:
    • Subtotal
    • Total Items Quantity
    • Total Weight
    • Payment Method
    • Shipping Method
    • Shipping Postcode
    • Shipping Region
    • Shipping State/Province
    • Shipping Country
    • Coupon Used - whether any Coupon Code was used by customer on this cart
    • Coupon Code - whether particular Coupon Code was used by customer on this cart
    • Discount Amount - whether some other discount was applied by customer on this cart
    • Current Store - whether cart was created on particular storeview
    • Current Currency - whether cart was created using particular Currency

Cart Rule also allows using current customer's properties as Conditions. They are identical to that described above in Behaviour Rules section.

Actions

  • Customer Earning Style - algorithm to calculate the number of earned points.
    • Give X points to customer
    • Give X points for every spent Y
    • Give X points for every Z quantity
  • Number of Points (X)
  • Step (Y)
  • Quantity Step (Z)
  • Maximum Distributed Points - maximum number of possible earned points for current rule.

For example, you can create the following cart rules in your store:

  • Buy 3 products within one order and receive 100 points

    • General Information:
      • Type: Cart Rule
      • Is Active: Yes
    • Conditions
      • Total Items Quantity equals or greater than 3
    • Actions
      • Customer Earning Style: Give X points to Customer
      • Number of Points (X): 100

    $nbsp;

  • For every spent $1, receive 1 point

    • General Information:
      • Type: Cart Rule
      • Is Active: Yes
    • Actions
      • Customer Earning Style: Give X points for every spent Y
      • Number of Points (X): 100
      • Step (Y): 1

    $nbsp;

  • For every ordered shirt, receive 100 points

    • General Information:
      • Type: Cart Rule
      • Is Active: Yes
    • Conditions:
      • If total quantity equals or greater than 1 for a subselection of items in cart matching ALL of these conditions: (selected as Products Subselection)
        • Type is Shirts
    • Actions
      • Customer Earning Style: Give X points for every Z quantity
      • Number of Points (X): 100
      • Quantity Step (Z): 1

    $nbsp;

Notifications

Each earning rule has additional Notifications tab, where a history message can be specified, and a special email notification message, that will be sent to customer, if this particular rule applies.

Message in the rewards history field should contain a message, that will accompany corresponding Transaction, which is created on rule application, and can be seen in field Comment. This message can contain special variables, to make this message more personal:

  • {{customer_name}} - translates to a current customer's name
  • {{referred_customer_name}} - translates a name of a referral, if rule of referral used

These variables works only in History Messages.

Message for customer notification email field can contain an email template, which will be used for email notification about points awards. It also can contain variables, but the same, that used in regular transactional emails.

Reward Points