Getting Started

Welcome to the Reward Points + Referral Program documentation.

In this documentation, you will find everything you need to set up your Reward Points service and create a flexible reward policy that can cover almost any marketing strategy.

Our extension allows customers to earn points for different actions, and earn additional points from the so-called thresholds (on reaching some tier of sales amount, for example), and even earn from sharing links on most popular social media networks.

Points earned can be spent on orders, as a dynamic discount, and even used to pay for orders completely.

Go ahead, dive in!

Firstly, please, find our extension in My Downloadable Products section of our store. Learn how to install extension, and proceed with Quick Start, which will guide you to set up your reward policy.

How to install the extension

How to install the extension using composer

  1. Backup your store's database and web directory.
  2. Login to the SSH console on your server and navigate to the root directory of the Magento 2 store.
  3. Copy the installation instructions from the page My Downloadable Products to the SSH console and press ENTER.
  4. Run command php -f bin/magento module:enable Mirasvit_Core Mirasvit_Report Mirasvit_Rewards Mirasvit_RewardsAdminUi Mirasvit_RewardsApi Mirasvit_RewardsBehavior Mirasvit_RewardsCatalog Mirasvit_RewardsCheckout Mirasvit_RewardsCustomerAccount to enable the extension.
  5. Run command php -f bin/magento setup:upgrade to install the extension.
  6. Run command php -f bin/magento cache:clean to clean the cache.
  7. Deploy static view files

    rm -rf pub/static/*; rm -rf var/view_preprocessed/*; php -f bin/magento setup:static-content:deploy

Note

As of Magento 2.3* the GraphQl module can be also installed. The command is composer require mirasvit/module-rewards-graph-ql

How to install the extension manually

  1. Backup your store's database and web directory.
  2. Download archive from My Downloadable Products.
  3. Unzip the extension locally.
  4. Copy unzipped folder to the root directory of the Magento store.
  5. Run command php -f bin/magento module:enable Mirasvit_Core Mirasvit_Report Mirasvit_Rewards Mirasvit_RewardsAdminUi Mirasvit_RewardsApi Mirasvit_RewardsBehavior Mirasvit_RewardsCatalog Mirasvit_RewardsCheckout Mirasvit_RewardsCustomerAccount to enable the extension.
  6. Run command php -f bin/magento setup:upgrade to install the extension.
  7. Run command php -f bin/magento cache:clean to clean the cache.
  8. Deploy static view files

    rm -rf pub/static/*; rm -rf var/view_preprocessed/*; php -f bin/magento setup:static-content:deploy

Install the extension for Hyva

  1. Run the command

        composer require mirasvit/module-rewards-hyva:*
  2. Enable installed Hyva modules:

        bin/magento module:enable Hyva_MirasvitRewards Hyva_MirasvitRewardsBehavior Hyva_MirasvitRewardsCatalog Hyva_MirasvitRewardsCheckout Hyva_MirasvitRewardsCustomerAccount 
  3. Update Magento database schema and data with the command:

        bin/magento setup:upgrade
  4. Compile the extension code:

        bin/magento setup:di:compile
  5. Compile the code of the installed extension:

        cd /path/to/theme/web/tailwind/
        npm run build-prod
  6. Run the command below to clean the cache:

        cd /path/to/project/
        bin/magento cache:flush
  7. Deploy static view files
        rm -rf pub/static/*    
        rm -rf var/view_preprocessed/*  
        php -f bin/magento setup:static-content:deploy

Quick Start

Our Reward Points & Referral Program extension for M2 is a simple yet powerful extension that allows customers to build complex reward policies with minimum efforts. Most of its functions work out-of-box.

However, if you intend to create a complex policy, you will need a fresh quick start to build your program.

  1. Reward Policy begins with the creation of at least two rules - one for earning points, and the other for spending them.

    Important Note: While creating these rules, you should fill in the fields "Rule Name" and "Display Name":

    "Rule Name" is the name for your usage and displayed on your store back end.

    "Display Name" is the rule describing your customers. It will be displayed in your client's account, thus bringing to your client or clients the valuable information about the rule (way) to earn (for earning rules) or to spend(for spending rules) the points on your store.

    The main rules for earning points in a client's account are gathered in the "My Reward Points" menu, in the "My Points" tab.

    Rules of points earning with the help of social media are displayed in the "My Reward Points" menu, on the "Share & Save" tab.

  2. Earning rules can be defined as one of the following strategies:

    • Cart Rule, this allows earning points from the total of the whole Cart, including shipping and handling fees;
    • Behaviour Rule, this also allows earning points, but used for conducting specific actions (for example, review placement);
    • Custom Behaviour Rule, this allows you to define your behavior actions;
  3. Spending rules allow you to define, at what rate should your points be spent.

    Important Note: Without at least one of such rules, our extension "do not know", how points should be converted to discounts, as our spending block on the Cart and Checkout won't display.

  4. You can also define your notification policy by creating a customized message at Notification rules. This will appear not only on the Customer's account but also on the Cart. These messages are powerful tools in promoting your reward policy.

  5. Choose social network buttons, which will appear on your products' pages, and use Behaviour Rules to make customers earn from sharing these pages.

  6. Explore great conditions for earning, spending, and notification rules to create a flexible but powerful reward policy. Our extension can support almost any plan you wish to develop.

  7. Use Magento's Customer Groups and build with them customer ranks. Then, using our Behaviour Rules action Assign Customer to a Group build milestone rules to uplift customers in the ranking system.

  8. Observe rewards statistics frequently with our Reports. As it will allow you to see - how points are earned and spent on a daily bases and by the Customer' in different groups, making your Rewards policy flexible and responsive to Customer's actions.

  9. Build up your Referral Program and extend your client base greatly.

It should be a great beginning.

Visit any appropriate section or sections of our manual for more information

Configuration Settings

Go to Stores > Settings > Configuration > Mirasvit Extensions > Reward Points. You will see there, all the Reward Points settings (except Social Buttons, which have their respective sections), divided into the following sections:

  • General Settings
  • Notification Settings
  • Referrals
  • Display Options
  • Widget display options
  • Advanced Settings
  • Tiered Rewards Program

General Settings

Option Description
Point Unit Name Name of unit for points (e.g. Reward Point(s), Gold Coin(s)).
Reward points expire after, days The number of days after which points will be expired. If you don't need this feature, leave this field empty.
Approve earned points on invoice If enabled, points earned will be added to the customer's account after creating a new invoice for the order.
Approve earned points on shipment If enabled, points earned will be added to the customer's account after creating a new shipment for the order.
Approve earned points if order has status If the order has one of the selected statuses from the list, points earned will be approved.
Delay usage of rewards points for, days If enabled, points earned will be added to the customer's account after X days. This option works only with cart earning rules.
After account login, redirect a customer to My Reward Points section If enabled, a logged-in customer is redirected to the page with his or her reward points. Otherwise, the customer is redirected to the store homepage.
Cancel the earned points after the order has been refunded If enabled, points earned will be canceled after creating a new credit memo for an order.
Restore the points spent after the order has been refunded If enabled, the points spent will be restored after creating a new credit memo for an order.
Include discount for Earning Rules If enabled, it allows you to include a discount to calculations of points earned (this applies only to Cart Rules)
Include tax for Earning Rules If enabled, it allows you to include tax to the amount, from which points earned are calculated
Include tax for Spending Rules If enabled,it allows you to include tax to the amount, eligible for paying by points (this applies only when Stores -> Configuration -> Sales -> Tax -> Calculation Settings -> Apply Customer Tax is set to Before Discount).
Apply Spending Points Discount After Tax The discount can be applied using the Magento settings (before taxes or after taxes) and specifically after taxes.
Allow to earn points from shipping charges If enabled, earned points will be added to the customer's account on shipping charges.
Allow to spend points for shipping charges If enabled, the customer will be able to spend earned points on shipping charges.
Allow to place orders with grand total = 0 If enabled, the customer will be able to place orders and earn points with a total = 0.
Allow to display product points as currency equivalent This option allows customers to see points awarded for a particular product as their potential money equivalent. It is calculated from rates defined in the spending rules and assumes that points earned for this product were spent with the highest possible rate. This calculation, however, Does not include conditions defined in spending rules - as they can be applied only in the cart - so this option shows only the approximate money amount.
Allow the display of maximum number of possible points for configurable products This option allows customers to display the number of points on pages of configurable products. These points are calculated as though a customer picked the options with maximum values.

Notification Settings

Option Description
Email Sender An email used to send mails to customers.
Balance update Email Template for balance update notification.
Transaction inactive Email Template for balance updates giving notification of transactions with delayed usage of points.
Points expire Email Template for points expiration notification.
Send notification before points expire (in days) Number of days before which the extension sends a points' expiration notification to the customer.

Tiered Rewards Program

Option Description
Switch between tiers based on Allows selecting the way to switch between tiers.
Use orders in status Enabled if "Switch between tiers based on" is selected as "sum of spent $". This option defines what orders are included in "sum of spent $"
Include Tax Enabled if "Switch between tiers based on" is selected as "sum of spent $". This option defines if the tax is included in "sum of spent $"
Include Discount Enabled if "Switch between tiers based on" is selected as "sum of spent $". This option defines if the discount is included in "sum of spent $"
Include Shipping Enabled if "Switch between tiers based on" is selected as "sum of spent $". This option defines if the shipping is included in "sum of spent $"
In determining tiers, take into account that it only lasts for N days This is the period which the Reward Points module uses to track the customer’s money or points spending for his or her tier calculation.
Automatically move the customer to a lower tier if he or she does not meet minimum tier requirements If this option is enabled, the customer’s tier will be lowered if his or her money and points spending activity for the last N days is below the current tier requirement. This works when Determine customer’s tier based on his activity in the last N days is not 0.

Referrals

Option Description
Invitation Email Template Template for the invitation of referrals.
API Invitation Email Template For the REST API apps Use this template for the invitation of referrals.
Enable Referral System Enables referral system.

Display options

Option Description
Show rewards points menu on frontend If enabled, Reward Points menu item will appear on the Magento menu.
Show rewards points menu on frontend for the customer groups This option excludes any deselected customer groups from the tiered program of Reward Points.
Show rewards points on category page If enabled, Reward Points will display not only on product pages but also in product cells at Category pages.
Show the number of points on the product page If enabled, customers will see the approximate amount of points they will earn for buying the product
Show pending transactions in the customer's account Activates the display of orders with pending status on the History tab of My Reward Points page in the customer’s account.
Checkout Notification This notification can be displayed when a customer has no reward points on his or her account to apply at checkout. Compose the message using variables for customer name, store URL, store name, and balance of customer account.
Referral Invitation Message Allows you to display a message for the Referral invitation in the "My Referrals" section of the customer's account.
Show expiration points in the customer account Enables a bar on the frontend that displays the number of days left before the collected reward points expire.
Show rewards points to expire in the customer account for last N days If the customer has transactions that expire within N days, the amount of these transactions will be displayed in the account.
Enable Rewards Logo You can assign a unique logo to the reward points of your store. Activate this option to display the logo.

Widget display options

Option Description
AddToAny code Use the social sharing service "addToAny" in your referral widget by pasting the addToAny code snippet here.

Advanced Settings

Option Description
Round earning points down As points can not be fractional, this option allows you to control how to round them: to the nearest lowest or highest number
Custom Behavior Events Allows you to add custom behavior rules using this format: rulecode, rulename. For more details refer to the Custom Behavior Events section
Force to apply styles Activate this option to add the extension's styles to the page in case the store’s theme overrides the Magento methods of including styles.



Social Networks Settings

Our Reward Points extension allows you to place social buttons on Product and Category pages. Even more - using [Behaviour Rules](/rules/earning #behaviour), you can make your customers earn points for sharing your products on social networks.

You can configure the buttons which can be displayed on Stores > Settings > Configuration > Mirasvit Extensions > Social Networks Settings:

  • Facebook Settings
  • Twitter Settings
  • Pinterest Settings
  • AddToAny Settings

Facebook Settings

  • Facebook App ID - This option is used when the rule to earn from Facebook, by clicking on the Like or Share button, is created. This rule uses Facebook API to track customers' activity, and for that, the Facebook Application ID is needed.
  • Facebook API Version - Set the identical Facebook API version number that you have set in Facebook application settings here.
  • Show Facebook Like button - If option is enabled, the Facebook Like button will show on both the product and category pages.
  • Show Facebook Share button - If this option is enabled, a Facebook Share button will appear, allowing customers to earn from sharing the page on Facebook.

Important Note: A useful tutorial for creating a Facebook Application can be found here. Facebook Apps themselves are created here.

  • How to Create Facebook Application.

    • Having logged in to Facebook, go to Facebook App Center. Press Add a New App button. Supply two base property:
      • Display Name - a sensical name of your App. For consistency reason, name it just like your store's name.
      • Contact Email - which email shall be connected with this application. It shall be the same as your Facebook account.
    • When App is created, you will receive an ID - it will be displayed at the top, as shown below: Facebook AppId
    • Proceed to Settings -> Basics and add additional properties to make App work:
      • App Domains - enter here your store's base URL (e. q. mystore.com)
      • Category - Business and Pages
    • Save your app, and enter your App ID to the Facebook App ID at Stores -> Settings -> Configuration -> Mirasvit Extensions -> Social Networks Settings -> Facebook Settings section.

     

Twitter Settings

  • Show Twitter Follow button - If option is enabled, the Twitter Follow button will be shown on the product and category pages.

Pinterest Settings

  • Show Pinterest pin button - If the option is enabled, the Pinterest pin button will be shown on the product page.

AddToAny Settings

AddToAny is a special network service that allows you to place a button of any social network in your store. However, these buttons are not tracked by our rules so that they can be used only for promotional purposes.

  • Show AddToAny - If option enabled, AddToAny buttons would be shown on the product page.
  • AddToAny Code - AddToAny code that should be inserted in the template.

Important Note: A useful tutorial for creating AddToAny buttons can be found here;

Display options

  • Show Social Buttons block on category page - If enabled, Social Buttons block will be shown on the catalog page.

Transaction Email Templates

In preparing an email, it must have a template of order, invoice, and credit memo, the following variables must be taken note of:

  • {{var order.getRewardsEarnedPoints()}} - number of points earned for order
  • {{var order.getRewardsSpentPoints()}} - number of points spent for order
  • {{var order.getRewardsSpentAmount()}} - number of money spent
  • {{var order.getInvitationLink()}} - customer referral link
  • {{var order.getCustomerTier()}} - customer tier name

Note

For a partial invoice or credit memo, these variables will contain the amount for the whole order.



Earning Rules

Earning Rules define ways by which customers earn points.

To create a new Earning Rule, go to the Marketing > Promotions > Reward Points > Earning Rules and press the button Add New.

Editing the page of an earning rule is very complex and differs, depending on the type of rule, so each type has its subsection here:

  • General Information (common part)
  • Cart Rule
  • Behaviour Rule

If you wish to create custom earning rule, please, refer to Custom Behavior Rules section of this manual.

General Information


The following options below are common to all types of earning rules:

  • Rule Name -This is the name of the rule. It is used for internal purposes only.
  • Display Name - This is the rule name that will be displayed in your client's account, thus bringing out your client's valuable information on the rule (way) to earn points from your store.
  • Type - This means the type of rule. Below are the different types of rules:
    • Behaviour Rule - These are points earned subject to a customer's action or actions.
    • Cart Rule -These are points earned subject to the total amount in the Customer's cart or the contents thereof.
  • Is Active - rule status.
  • Active From, Active To - period of rule activity.
  • Websites - choose which website the rule is applied to. For a single Magento installation, you can set up multiple websites, each with its own IP address and domain.
  • Customer Groups - These are the Customer's groups upon which Rules can be applied.
  • Stop further rules processing - if enabled, no other rule will be applied, if this applies, please see the important note below for more details.
  • Is show on the product page - display the rule on the product page. This option can be activated only for Cart Rules.
  • Priority - the order, which will be used in sorting out a variety of rules before they can be applied.

Note

Important: It is a common case when different policies are applied to most similar conditions (or the same event), but with some differences - which require applying only one Rule per Order. Then Priority and Stop further rules processing options can be used in organizing their execution order.

Example

For example, a regular customer will receive 10 points, but a VIP shall receive 100.

Let's have two rules, for instance - "Regular" and "VIP". In this case, the VIP rule has a higher priority and has an option forStop further rules processing enabled. If a VIP customer buys a product, the VIP rule will apply, but for that of a Regular customer, he will not, (since the option for Stop processing... is set). When a Regular Customer buys a product, the VIP rule will be skipped, and the Regular Rule will apply automatically.

Each rule has four possible global modes of applying its conditions in respective Conditions tab, shown on a special header If *[apply mode]* of these conditions are *[validation mode]*:

Applying modes define, when rule can be triggered:

  • ALL - implies, that rule will be executed only when strictly all the conditions were met;
  • ANY - implies, that rule will be executed when one or more (but not all) of these conditions are met;

Validation modes defines the result which each condition can produce as "met":

  • TRUE - implies that the conditions are valid.
  • FALSE - implies that the conditions are invalid.

These modes create flexible conditions set to satisfy policy of any complexity.

Cart Rules

Award points consist of the total amount of actual money spent in the Cart. This type of rule is recommended when using tier or special prices (with taxes, dependent on the shipping country, for example), which can dynamically alter the actual cost price of a product.

Conditions

Cart Rules has more complex condition subsystems which are:

  • Product attribute combination - This allows you to set the product attribute combination. Attributes list is the same, as in Product Rule. It has the following scheme: If an item is tagged [validation mode] in the Cart with [applying mode], and any of these conditions are true:.
    • Validation mode can be either FOUND or NOT FOUND, which defines, whether a checked product exist in the Cart or not;
    • Applying mode can be either ALL or ANY, their meanings are the same as in the previous type of rule: whether all the conditions in this container apply or one or more of them does not.
    • Additional to product properties set, this mode provides three additional properties regarding Cart content:
      • Price in Cart - allows the Customer to check the products that match conditions and prices in the Cart. Useful, when discounts or custom prices are used;
      • Quantity in Cart - allows the Customer to check the number of products ordered in the Cart.
      • Row Total In Cart - Total cost of the products that match the conditions in the current Cart. It is calculated by multiplying the two properties above.
  • Product subselection - allows you to check the cart item attributes. It also has a container and has the following scheme If [selection mode] for a subselection of items in the cart matches [applying mode] of these conditions.
    • Selection mode defines, which primary parameter is checked - product quantity (total quantity) or its row total ((total amount)). It shall be supplied with a numeric value.
    • Applying mode can be either ALL or ANY, their meaning is the same as the previous type of rule: whether all conditions in this container apply or one or more of them does,
    • Container can have the same conditions as the above model.
  • Conditions combination - allows you to break rule into logical parts, each of which can be validated separately. It is extremely useful when ANY applying mode is used for a full rule and the complex conditions required. It creates just a nested block of If *[apply mode]* of these conditions are *[validation mode]* type, as described in General section.

  • Cart attribute - allows you to set reward points earning based on the following cart attributes:

    • Additional Payment Method - apply condition with an additional payment method.
    • Subtotal - subtotal of cart, including shipping and handling fees. It can also contain a discount, if Stores -> Configuration -> Sales -> Tax -> Calculation Settings -> Apply Customer Tax is set to Before discount.
    • Subtotal (incl. tax) - subtotal of cart including taxes.
    • Subtotal (excl. tax) - subtotal of cart excluding taxes.
    • Total Items Quantity - the total quantity of items in the current Cart.
    • Total Weight - The total amount that all the products in the Cart weights.
    • Payment Method - payment method.

      Note

      If the payment method is not selected - this condition will return false. Therefore, this condition forces earnings only on checkouts, or when payment selection is available directly from Cart.
    • Shipping Method - shipping method. The note above also applies here.
    • Shipping Postcode - postal code, where the products will be sent. The note above also applies here.
    • Shipping Region - shipping region. The note above also applies here.
    • Shipping State/Province - The state, or province, where the product will be delivered. The note above also applies here.
    • Shipping Country -The Country, where the product will be delivered. The note above also applies here.
    • Is Rewards Points used - apply condition when Reward Points is used.
    • Coupon Used - apply condition when coupon is used.
    • Coupon Code - the identification code of the used coupon.
  • Customer - allows you to set rewards point based on the customers’ status, account statistics and other information:
    • Is Referee - the customer is the referee.
    • Is Referral - the customer is the referral.
    • Email - email of the customer.
    • Group - user group the customer belongs to.
    • Lifetime Sales - customer's total sales.
    • Lifetime Spent Points - customer's total spent points.
    • Number of Orders - customer's total number of orders.
    • Is subscriber of newsletter - the customer is subscribed to newsletter.
    • Number of reviews - customer's total number of reviews.
    • Number of referred friends signups - customer's total number of signed up referrals.
    • Number of referred friends orders - total number of orders made by the customer's referrals.
    • Sum of referred friends order - total sum of orders made by the customer's referrals.
    • Number of referrals who ordered at least once - total number of customer’s referrals who ordered at least once.

Actions

Apply the rule only to cart items matching the following conditions:

  • Cart Item Attribute - the product attribute in the customer’s cart.
    • Price in cart - price of the items in cart.
    • Quantity in cart - the quantity of items in cart.
    • Row in total - row total = (ordered item price * ordered item quantity) + Tax) - Discount

Notification

  • Message - shows a notification on the product pages if the rule is applied to the current product.

Tiers

  • Customer Earning Style - strategy, which is used in calculating points.
    • Give X points to Customer - the Customer is awarded a fixed number of points.
    • Give X points for every spent Y - These are points calculated in chunks, into which Cart subtotal breaks.
    • Give X points for every Z quantity - points are calculated from the total quantity of items in the current Cart.
  • Number of Points (X) - the number of points awarded at each step. It also regulates the minimal number of points that can be awarded.
  • Step (Y) - used only when Give X points for every spent Y strategy is selected, and defines the size of one chunk, into which subtotal should be divided. It also serves as a regulator to the minimal amount of currency, which can be awarded by points.
  • Quantity Step (Z) - used if Give X points for every Z quantity strategy is selected. If it's not empty, items quantity will be divided into chunks of this size, and points will be calculated accordingly.
  • Earn Maximum - the maximum number of points earned from the current rule.

Example

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

  • Buy 3 products with one Order and get 100 points.
  • For every $1 spent, you will receive 1 point.
  • For every product ordered, you will receive 100 points.

This section also contains a special subsection Applying this Rule only to items on the Cart matching the following conditions. It is a shortcut for a condition of Product attribute combination** mode (see above).

Behaviour Rules

These rules only trigger certain Customer' actions, such as writing a review or placing an order.

Conditions

This section allows picking up Event, which corresponds with a Customer's action, and binds it to its a current rule:

  • Customer signs up in store - signing into a store. Useful for awarding points that should be used in the very first Order.
  • Customer places order - triggered when the Customer places an order, and it is completed (e. q. invoiced and shipped).
  • Customer refer a friend - Customer sends an invite to a friend.
  • Customer writes a product review - the Customer adds a review, and it is approved by staff.
  • Customer has a birthday - this rule is executed by cron task, which starts at 00:00 each day for every Customer. If the Customer has a birthday to mark, the rule will be executed at that time.
  • Customer is not active for a long time - should be set in days. This rule also is executed at 00:00 by a cron task.
  • Customer creates RMA - Creates a return merchandise authorization.
  • Newsletter sign up - Customer opts to receive a Newsletter.
  • Twitter Tweet - Customer tweets product page on Twitter.
  • Pinterest Pin - Customer places a pin of a product on Pinterest.
  • Facebook share - Customer shares the product on Facebook.
  • Customer joins the affiliate program - Customer joins with an affiliate program (Mirasvit_Affiliate)
  • Customer tier up - Customer tier lever advances.
  • Customer tier down - Customer tier lever is lowered.
  • Push Notifications sign up - Customer opt in to receive push notifications.
  • Referred customer signs up in the store - referred customer (referee) signs up to the store. For more information refer to Building Referral Program section.
  • Order from a referred customer - the referred Customer had placed an order, and it is complete. For more information, refer to Building Referral Program section.
  • Custom events - list of custom events created using this Custom Behavior Events

Note

Please, note, for the events "Customer has a birthday" & "Customer is not active for a long time" (executed by cron) you can use only the "Give X points to customer" style

Actions

There's also a subsection Apply the Rule only if the following conditions are met, where additional conditions can be set. Here is the list of currently supported properties:

  • Customer - conditions based on the the customer’s information.
    • Is a Referral - checks whether the Customer has invited customers to a store, and if they have become registered customers. This is extremely useful for building a Referral Program for the Customer.
    • Is a Referee - checks whether a customer is a referee (i.e., whether someone invited them)
    • Email - checks the email of a particular Customer.
    • Group - checks the group a particular Customer belongs to.
    • Lifetime sales - calculates the total amount purchased by the current Customer, and compares it with the value supplied.
    • Lifetime spent points - calculates the total points used by the current Customer, and compares it with the value supplied.
    • Number of Orders - calculates the total number of orders, placed by the current Customer, and compares it to the value supplied.
    • Is subscriber of Newsletter - checks whether the Customer has subscribed for a Newsletter.
    • Number of Reviews - calculates the total number of approved reviews made by the current Customer, and compares it to the value supplied.
    • Number of referred friends signups - calculates how many invited customers became registered customers (e. g. became referees).
    • Number of referred friends orders - the whole number of orders placed by the referees invited by the current Customer.
    • Sum of referred friends orders - the total sum of money for all orders placed by all referees, invited by the current Customer.
    • Number of referred friends that ordered at least once - number of referees invited by the current Customer, which placed at least one Order.
  • Order - conditions based on the customer’s order.
    • Subtotal - subtotal of cart, including shipping and handling fees.

Notification

  • Message in the rewards history - the Message that will be added as a description to the rewards earned from previous transactions, created under this rule.
  • Message for customer notification email - the Message sent to the Customer by mail. This Message shall only contain important messages, not the whole template. This Message will be inserted to the Balance update Email template, which can be set in Settings.

Example

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

  • Write a review and get 10 points
  • Refer a friend and get 10 points when your referee makes their first Order

More examples can be found at Earning Rules Examples section.

Tiers

  • Customer Earning Style - strategy, which is used in calculating points.
    • Give X points to Customer - the Customer is awarded a fixed number of points.
    • Give X points for every spent Y - These are points calculated in chunks, into which the Cart subtotal breaks.
    • Give X points for every Z quantity - points are calculated from the total quantity of items in the current Cart.
  • Number of points (X) - number of points that a customer receives if the rule applies.
  • Maximum number of earned points for one Customer per day - sets a limit to the number of points earned by a customer per day. Set at 0 or empty to disable the limit.
  • Assign Customer to Group - allows a Customer to move to his or her desired group, if the rule is triggered. This is extremely useful when maintaining the customers' ranks program, for example, or building a referral program.



Spending Rules

Spending Rules are much simpler than earning them since they only define the rate, at which points can be converted to discounts.

Note

Points can be spent when a customer uses a special block. It will appear on both the Cart and the Checkout pages when the following conditions are met:

  • Options Marketing -> Reward Points -> Settings -> Display are enabled when;
  • At least one Spending Rule is defined and activated;
  • Customer has enough points on his balance;
  • The Customer and his Cart fits in the conditions for Spending Rule(s).

To create a new Spending Rule, go to Marketing > Promotions > Reward Points > Spending Rules and press the button Add New. The rule edit page that will appear is divided into three sections, they are:

General Information

  • Rule Name - the type of the rule. It is used for internal purposes only.
  • Display Name - this gives a vivid explanation to your customers. It can be found in your client's account, thus bringing to your clients, valuable information, or pieces of information on the rule (way) to spend the points in your store.
  • Is Active - rule status.
  • Active From, Active To - the period the rule will be active.
  • Websites - choose which website the rule is applied to. You can set up multiple websites for a single Magento installation, each with its own IP address and domain.
  • Customer Group - the necessary groups that makes the customer qualify to apply for this rule.
  • Stop further rules processing - if enabled, no other rule or rules can be applied.
  • Priority - the order that will be used in sorting the various rules available before each can apply.

Conditions

Spending Rule applies only on the Cart as a whole, so the conditions in this section look like that found in Cart conditions. Refer to Cart Earning Rule section for detailed descriptions of them.

Actions

Applies the rule only to cart items matching the following conditions. Refer to the Cart Earning Rule section for detailed descriptions of them

Actions

This section defines how points are converted into a discount.

  • Points spending style - this defines the basic strategy used in converting points.
    • Flexible - allows spending points to be in proportion to the For each spent X points. For example, for the rule where a customer gets a dollar($1) discount for 10 points, the customer can spend 15 points and get a $1.5 as his discount.
    • Fixed - allows the customer to spend points strictly for multiplication of the For each spent X points. For example, for the rule where a customer gets a dollar($1) discount for 10 points, the customer can spend only 10 or 20 or 30 or more.
  • For each spent X points - defines the minimum number of points that can be traded for discounts. If Flexible strategy is used, then it is used on proportional bases.
  • Customer receive Y discount - defines the amount of currency that should be traded subject to the number of points available (property above).
  • Spend minimum - the minimum number of points that should be spent on one Cart. It is used mainly for Flexible strategy. The percentage value limits the minimum discount that a customer can apply for per sale.
  • Spend maximum - this is the maximum number of points that a customer can spend on one Cart. The percentage value limits the maximum amount of discount that a customer can receive per sale.

Note

To allow a customer to spend their points, you must create at least one spending rule. Otherwise, our spending blocks on Cart and Checkout pages won't appear.

For more examples, see Spending Rules Examples section.



Notification Rules

Notification Rule allows you to set up different messages to your customers, notifying them about their current earning/spending points.

To create a new Notification Rule, go to Marketing > Promotions > Reward Points > Notification Rules and press the button Add New. You will see edit page, divided into three sections, which are:

General Information

  • Rule Name - the name of the rule. It is used for internal purposes only.
  • Is Active - rule status.
  • Active From, Active To - period the rule will be active.
  • Websites - choose which website the rule is applied to.
  • Customer Groups -these are groups which the customer has to belong to for the rule to apply.
  • Stop further rules processing - if enabled, no other rule will apply.
  • Priority - the order that will be used in sorting the various rules available before they can apply.

Conditions

The Notification Rule uses the current persistent Cart.

  • Product attribute combination - This allows you to set a product attribute combination. Attributes list is the same as in Product Rule. It has the following scheme: If an item is tagged [validation mode] in the Cart with [applying mode], and any of these conditions are true:.
    • Validation mode can be either FOUND or NOT FOUND, which defines, whether a checked product exists in the Cart or not;
    • Applying mode can be either ALL or ANY, their meanings are the same as in the previous type of rule: whether all the conditions in this container apply or one or more of them does not.
    • Additional to product properties set, this mode provides three additional properties regarding Cart content:
      • Price in Cart - allows the Customer to check the products that match conditions and prices in the Cart. Useful, when discounts or custom prices are used;
      • Quantity in Cart - allows the Customer to check the number of products ordered in the Cart.
      • Row Total In Cart - Total cost of the products that match the conditions in the current Cart. It is calculated by multiplying the two properties above.
  • Product subselection - allows you to check the cart item attributes. It also has a container and has the following scheme If [selection mode] for a subselection of items in the cart matches [applying mode] of these conditions.
    • Selection mode defines, which primary parameter is checked - product quantity (total quantity) or its row total ((total amount)). It shall be supplied with a numeric value.
    • Applying mode can be either ALL or ANY, their meaning is the same as the previous type of rule: whether all conditions in this container apply or one or more of them does,
    • Container can have the same conditions as the above model.
  • Conditions combination - allows you to break rule into logical parts, each of which can be validated separately. It is extremely useful when ANY applying mode is used for a full rule and the complex conditions required. It creates just a nested block of If *[apply mode]* of these conditions are *[validation mode]* type, as described in General section.

  • Cart attribute - allows you to set reward points earning based on the following cart attributes:
    • Subtotal (Excl. Tax) - subtotal of cart, excluding tax.
    • Subtotal (Incl. tax) - subtotal of cart, including tax.
    • Subtotal - subtotal of cart, including shipping and handling fees. It can also contain a discount, if Stores -> Configuration -> Sales -> Tax -> Calculation Settings -> Apply Customer Tax is set to Before discount.
    • Total Items Quantity - the total quantity of items in the current Cart.
    • Total Weight - The total weight of all products in the Cart.
    • Payment Method - payment method.
    • Shipping Method - shipping method. The note above also applies here.
    • Shipping Postcode - postal code, where the products will be sent. The note above also applies here.
    • Shipping Region - shipping region. The note above also applies here.
    • Shipping State/Province - The state or province where the product will be delivered. The note above also applies here.
    • Shipping Country -The Country where the product will be delivered. The note above also applies here.

Actions

  • Show message on - A checklist of pages where you would like to show your notification message or messages.
  • Message - the texts contained in the message.

More examples can be found at Notification Rules Examples section.

Custom Behavior Events

Using this feature, you can add your own ways by which customers can earn points.

  1. To create a new Custom Behavior Rule, go to Marketing > Promotions > Reward Points > Settings > Advanced Settings.
  2. In this field Custom Behavior Events, add a new rule to this format: rulecode, rulename. You can add more rules, each on a new line.
  3. Insert the following code in the place where points should be charged:
$eventManager = $this->_objectManager->get('Magento\Framework\Event\ManagerInterface');
$eventManager->dispatch('mirasvit_rewards_behavior_rule_process', ['code' => 'rulecode', 'attr' => attribute]);

Example

For example, to create a rule for the event 'user name changed' you should insert in the field Custom Behavior Events: customer_change_name, Change customer name rule

and insert the following code:

$eventManager = $this->_objectManager->get('Magento\Framework\Event\ManagerInterface');
$eventManager->dispatch('mirasvit_rewards_behavior_rule_process', ['code' => 'customer_change_name', 'attr' => $customer->getName()]);

Note: the variable $customer should be defined

General Information

You can use API to attract customers and increase sales rate in your store. At this point, you can simultaneously use Reward Points Extension from external tools that work on separate servers and use other programs, which includes the use of mobile applications. Using Reward Points, users can get rewards for the particular actions made out of a store.

For example: If you use a mobile app for your store, then a buyer can obtain additional points from this app.

Reward Point extension is available to partner programs, and it works with tools that interact with your customers directly.

To get the full list of available REST APIs, check API Docmentation. You can check some examples in Example of REST API section

Example of REST API

To place an order using the Reward Points, you have to complete the following preconditions:

  • The customer should be registered and logged in, as the module doesn't work with guest customers
  • You should have at least one configured and enabled Payment method: Stores > Settings > Configuration > Sales > Payment Methods
  • Also, there should be at least one configured and enabled Shipping method on Stores > Settings > Configuration > Sales > Shipping Methods
  • To spend points, you have to configure a Spending rule according to your requirements: Reward Points > Spending Rules
  • Your customer as well should have points on his account

Our example below is intended to provide a step-by-step guide for placing an order using points.

Here are the token and customers ID in case you wish to perform these actions in our demo store:

  • <token> - xdezikuhh6ryzrgr6ggzi51byafd5bj0
  • <customerId> - 6
  1. Firstly you should get the customer's cart:
    curl -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -XPOST "http://rewards.m2.mirasvit.com/index.php/rest/V1/customers/<customerId>/carts"
  2. Secondly, When we have got the cart ID, we can add an item on the cart: <cartId> - current active cart ID returned in previous request
    curl -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -XPOST "http://rewards.m2.mirasvit.com/index.php/rest/V1/carts/<cartId>/items" -d'{"cart_item":{"quote_id":<cartId>,"sku":"24-MB03","qty":1,"price":19.00}}'
  3. After adding the items, we can then check out for the total information:
    curl -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -XPOST "http://rewards.m2.mirasvit.com/index.php/rest/V1/carts/<cartId>/totals-information" -d'{"cartId":<cartId>,"addressInformation":{"address":{"region": "New York","region_id": 43,"region_code": "NY","country_id": "US","street": ["123 Oak Ave"],"postcode": "10577","city": "Purchase","firstname": "Jane","lastname": "Doe","customer_id": 4,"email": "[email protected]","telephone": "(512) 555-1111","same_as_billing": 1}}}'
  4. Get the available shipping address:
    curl -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -XPOST "http://rewards.m2.mirasvit.com/index.php/rest/V1/carts/<cartId>/estimate-shipping-methods" -d'{"address": {"region": "New York","region_id": 43,"region_code": "NY","country_id": "US","street": ["123 Oak Ave"],"postcode": "10577","city": "Purchase","firstname": "Jane","lastname": "Doe","customer_id": 4,"email": "[email protected]","telephone": "(512) 555-1111","same_as_billing": 1}}'
  5. Now we have the address where we want to receive the items ordered, we will be able to set down the necessary shipping method:
    curl -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -XPOST "http://rewards.m2.mirasvit.com/index.php/rest/V1/carts/<cartId>/shipping-information" -d'{"addressInformation": {"shipping_address": {"region": "New York","region_id": 43,"region_code": "NY","country_id": "US","street": ["123 Oak Ave"],"postcode": "10577","city": "Purchase","firstname": "Jane","lastname": "Doe","email": "[email protected]","telephone": "512-555-1111"},"billing_address": {"region": "New York","region_id": 43,"region_code": "NY","country_id": "US","street": ["123 Oak Ave"],"postcode": "10577","city": "Purchase","firstname": "Jane","lastname": "Doe","email": "[email protected]","telephone": "512-555-1111"},"shipping_carrier_code": "flatrate","shipping_method_code": "flatrate"}}'
  6. We can now add the reward points required:
    curl -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -XPOST "http://rewards.m2.mirasvit.com/index.php/rest/V1/rewards/<cartId>/apply/1148"
  7. Get the payment methods available:
    curl -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -XGET "http://rewards.m2.mirasvit.com/index.php/rest/V1/carts/<cartId>/payment-methods"
  8. Once we have checked the payment methods we have available, - we can pick one from them:
    curl -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -XPUT "http://rewards.m2.mirasvit.com/index.php/rest/V1/carts/<cartId>/selected-payment-method" -d'{"method": {"method": "checkmo"}}'
  9. All required steps are complete and we can place order:
    curl -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -XPUT "http://rewards.m2.mirasvit.com/index.php/rest/V1/carts/<cartId>/order"

GraphQL Objects Reference

The full documentation on GraphQL is available on Magento DevDocs page GraphQL Developer Guide

To use GraphQL in the Reward Points + Referral program module it is mandatory to install Rewards GraphQl module.

Cart object

One of the standard Magento 2 objects is Cart object. The cart is responsible for:

  • tracking each item in the cart
  • tracking item's quantity
  • tracking base cost
  • determining estimated shipping costs
  • calculating subtotals
  • computing additional costs
  • applying coupons
  • determining the payment method

Our module expands Cart object with Reward Points using attribute mstRewardPoints.

The Cart object can contain the following attributes.

Attribute Data Type Description
mstRewardPoints CartPoints Reward points information for cart

Here is the GraphQL request to check Reward points of a new empty cart of a chosen user

query {
    customerCart {
        id
        mstRewardPoints {
            is_applied
            spend_points
            base_spend_amount {
                value
            }
            spend_amount {
                value
            }
            spend_min_points
            spend_max_points
            earn_points
        }
    }
}

Response

{
  "data": {
    "customerCart": {
      "id": "7FaFEP6tXE2SpPULMt4X2JQnImx3MwwS",
      "mstRewardPoints": {
        "is_applied": false,
        "spend_points": null,
        "base_spend_amount": {
          "value": null
        },
        "spend_amount": {
          "value": null
        },
        "spend_min_points": null,
        "spend_max_points": null,
        "earn_points": null
      }
    }
  }
}

CartPoints object

The parameters of the reward points information for a cart from the query response above can be deciphered by the attributes of the CartPoints object.

The CartPoints object can contain the following attributes

Attribute Data Type Description
is_applied Boolean .
spend_points Int The number of points that were added to the cart.
base_spend_amount Money Based Amount of money that was added to the cart.
spend_amount Money the Amount of money that was added to the cart.
spend_min_points Int Min number of points that could be added to the cart.
spend_max_points Int Max number of points that could be added to the cart.
earn_points Int The number of points that were added to the cart.

Attributes base_spent_amount and spend_amount each have two fields: value and currency.

Request

query {
    customerCart {
        id
        mstRewardPoints {
            is_applied
            spend_points
            earn_points
            base_spend_amount {
                value
                currency
            }
            spend_amount {
                value
                currency
            }
            spend_min_points
            spend_max_points
            earn_points
        }
    }
}

Response

{
  "data": {
    "customerCart": {
      "id": "7FaFEP6tXE2SpPULMt4X2JQnImx3MwwS",
      "mstRewardPoints": {
        "is_applied": true,
        "spend_points": 10,
        "earn_points": null,
        "base_spend_amount": {
          "value": null,
          "currency": null
        },
        "spend_amount": {
          "value": null,
          "currency": null
        },
        "spend_min_points": null,
        "spend_max_points": null
      }
    }
  }
}

Customer object

This is another standard Magento object. The customer query returns information about the logged-in customer, store credit history and customer’s wishlist.

To return or modify information about a customer, Magento recommends you use customer authorisation tokens in the header of your GraphQL calls.

This module expands Customer object with Rewards Balance using attribute mstRewardPointsBalance.

The Customer object can contain the following attributes

Attribute Data Type Description
mstRewardPointsBalance RewardsCustomerInfo Reward points information for customer

Here is how to look at the account information of currently logged in customer for which GraphQL session is conducted. The responce will show user's first and last name, e-mail, shipping and billing addresses, phone numbers, etc. The rewards balance, user's reward tier and list of rewards transactions are also available.

Request

query {
    customer {
        mstRewardPointsBalance {
            balance
        }

        firstname
        lastname
        suffix
        email
        addresses {
            firstname
            lastname
            street
            city
            region {
                region_code
                region
            }
            postcode
            country_code
            telephone
        }
    }
}

Response

{
  "data": {
    "customer": {
      "mstRewardPointsBalance": {
        "balance": 90
      },
      "firstname": "Veronica",
      "lastname": "Costello",
      "suffix": null,
      "email": "[email protected]",
      "addresses": [
        {
          "firstname": "Veronica",
          "lastname": "Costello",
          "street": [
            "6146 Honey Bluff Parkway"
          ],
          "city": "Calder",
          "region": {
            "region_code": "MI",
            "region": "Michigan"
          },
          "postcode": "49628-7978",
          "country_code": "US",
          "telephone": "(555) 229-3326"
        },
        {
          "firstname": "Veronica",
          "lastname": "Costello",
          "street": [
            "64 Strawberry Dr",
            "Beverly Hills"
          ],
          "city": "Los Angeles",
          "region": {
            "region_code": "CA",
            "region": "California"
          },
          "postcode": "90210",
          "country_code": "US",
          "telephone": "123-456-0000"
        }
      ]
    }
  }
}

RewardsCustomerInfo object

It contains the customer's reward points information like current balance of the points, spent points, transactions in which those points were spent, etc.

The RewardsCustomerInfo object can contain the following attributes

Attribute Data Type Description
balance Int number of points available for customer
tier_id Int Customer's tier in reward program
transactions [PointsTransaction] List of transactions and their parameters. It is mandatory to specify its fields.

Request

query {
    customer {
        mstRewardPointsBalance {
            balance
            tier_id
            transactions {
                transaction_id
                created_at
            }
        }

        firstname
        lastname
        addresses {
            street
            city
            region {
                region
            }
            postcode
            country_code
        }
    }
}

Response

{
  "data": {
    "customer": {
      "mstRewardPointsBalance": {
        "balance": 90,
        "tier_id": 1,
        "transactions": [
          {
            "transaction_id": 1,
            "created_at": "2021-02-26 12:40:43"
          },
          {
            "transaction_id": 2,
            "created_at": "2021-03-01 11:38:19"
          }
        ]
      },
      "firstname": "Veronica",
      "lastname": "Costello",
      "addresses": [
        {
          "street": [
            "6146 Honey Bluff Parkway"
          ],
          "city": "Calder",
          "region": {
            "region": "Michigan"
          },
          "postcode": "49628-7978",
          "country_code": "US"
        },
        {
          "street": [
            "64 Strawberry Dr",
            "Beverly Hills"
          ],
          "city": "Los Angeles",
          "region": {
            "region": "California"
          },
          "postcode": "90210",
          "country_code": "US"
        }
      ]
    }
  }
}

PointsTransaction object

The transactions (PointsTransaction object) can contain the following fields regarding reward points transactions

Field Data Type Description
transaction_id Int ID of the specific transaction in user's account
created_at String Time when transaction was created
activated_at String Time when transaction will be activated
amount Int Amount of earned points
amount_used Int Amount of spent points
code String Transaction code
comment String Transaction description
is_activated Boolean Is transaction activated
is_expiration_email_sent Boolean Is expiration email was sent to customer
is_expired Boolean Is transaction expired

Request

query {
    customer {
        mstRewardPointsBalance {
            balance
            tier_id
            transactions {
                transaction_id
                created_at
                amount
                amount_used
                activated_at
                code
                comment
                is_activated
                is_expiration_email_sent
                is_expired
            }
        }

        firstname
        lastname
        addresses {
            street
            city
            region {
                region
            }
            postcode
            country_code
        }
    }
}

Response

{
  "data": {
    "customer": {
      "mstRewardPointsBalance": {
        "balance": 90,
        "tier_id": 1,
        "transactions": [
          {
            "transaction_id": 1,
            "created_at": "2021-02-26 12:40:43",
            "amount": 100,
            "amount_used": null,
            "activated_at": null,
            "code": "",
            "comment": null,
            "is_activated": true,
            "is_expiration_email_sent": false,
            "is_expired": false
          },
          {
            "transaction_id": 2,
            "created_at": "2021-03-01 11:38:19",
            "amount": -10,
            "amount_used": null,
            "activated_at": null,
            "code": "order_spend-5",
            "comment": "Spent 10 Reward Points for the order #000000005.",
            "is_activated": true,
            "is_expiration_email_sent": false,
            "is_expired": false
          }
        ]
      },
      "firstname": "Veronica",
      "lastname": "Costello",
      "addresses": [
        {
          "street": [
            "6146 Honey Bluff Parkway"
          ],
          "city": "Calder",
          "region": {
            "region": "Michigan"
          },
          "postcode": "49628-7978",
          "country_code": "US"
        },
        {
          "street": [
            "64 Strawberry Dr",
            "Beverly Hills"
          ],
          "city": "Los Angeles",
          "region": {
            "region": "California"
          },
          "postcode": "90210",
          "country_code": "US"
        }
      ]
    }
  }
}

Mutation object

A mutation can create, update, or delete objects and fields. In REST terminology, queries operate like GET requests, while mutations are similar to POST, PUT, and DELETE.

A mutation contains the following elements:

  • The keyword mutation
  • An operation name for your local implementation. This name is required if you include variables. Otherwise, it is optional.
  • The mutation name
  • The input object or attributes. Most mutations require an input object that contains data or individual attributes for the Magento server to process. However, some mutations, such as createEmptyCart, do not require an input object.
  • The output object, which specifies which data the mutation returns.

The Mutation object in this module can contain the following attributes.

Attribute Data Type Description
mstRewardsApplyPointsToCart ApplyPointsToCartInput Add reward points to the cart

To set a number of reward points to the current cart the following mutation of mstRewardsApplyPointsToCart method is used. This method requires two parameters: cart_id and amount of applied points.

ApplyPointsToCartInput object

It defines the input object of the applyToCart mutation.

The mstRewardsApplyPointsToCart object can contain the following attributes.

Attribute Data Type Description
amount Int The number of reward points
cart_id String! The unique ID that identifies the customer's cart

Request

mutation {
    mstRewardsApplyPointsToCart(
        input: { cart_id: "7FaFEP6tXE2SpPULMt4X2JQnImx3MwwS", amount: 10 }
    ) {
        cart {
            prices {
                grand_total {
                    value
                    currency
                }
            }
            mstRewardPoints {
                is_applied
                spend_points
            }
        }
    }
}

Response

{
  "data": {
    "mstRewardsApplyPointsToCart": {
      "cart": {
        "prices": {
          "grand_total": {
            "value": 0,
            "currency": "USD"
          }
        },
        "mstRewardPoints": {
          "is_applied": true,
          "spend_points": 10
        }
      }
    }
  }
}

ApplyPointsToCartOutput object

This object shows the result of the mutations above which were applied to cart. It does not make any mutations by itself.

The ApplyPointsToCartOutput object returns data with the following attributes

Attribute Data Type Description
cart Cart! Describes the contents of the specified shopping cart.

In the above mutation request it is the following part of code (this piece will work only inside a code above)

 {
        cart {
            prices {
                grand_total {
                    value
                    currency
                }
            }
            mstRewardPoints {
                is_applied
                spend_points
            }
        }
    }
}

The ApplyPointsToCartOutput prints out those parameters that are applied to the cart, which allows you to check if mstRewardsApplyPointsToCart worked correctly.

Example of GraphQL API usage. Placing an order with the Reward Points + Referral program module

To use GraphQL it is mandatory to install module Rewards GraphQL. Read how to set it up in Prerequisites.

In addition to REST architecture and SOAP protocol Magento offers for API a GraphQL. It is an open-source data query and manipulation language, released in 2015 by Facebook.

It has such advantage as getting only the needed parameters of the object in store without the any unnecessary connected information. GraphQL queries also execute quicker than similar on REST or SOAP. Request with REST or SOAP can require several queries, while request in GraphQL executes in one query.

Here is an example of using GraphQL queries to place an order when using.

GraphQL in Magento

GraphQL query retrieves data from the Magento server similarly as a REST GET call. The current set of Magento GraphQL queries allow a mobile app or browser to render such information:

  • A set of products to be displayed. This can include the entire catalog, or those that match customer-specified criteria.

  • Customer data. With a customer token, a query can retrieve basic information about a customer as well as billing and shipping addresses, wish lists, order history, and other sensitive data.

  • Shopping cart contents. GraphQL supports both guest and logged-in customer carts.

  • Store configuration values, including the theme and CMS settings, the currency code, and supported countries.

Over time, the Magento GraphQL queries will duplicate the functionality of all storefront-facing GET calls, while making it possible to query more data in one request. The main difference will be that GraphQL will support storefront use cases, while REST will support admin use cases.

Magento will not run a query that is too complex. The number of fields, objects, and nodes are the factors in determining the complexity of a query.

Software to access GraphQL

In order to be able to use GraphQL you need an additional software. It can be a GraphQL IDE, like GraphiQL or an extension for a Chrome browser, like ChromeiQL or Altair GraphQL. The latter is also available for Mozilla Firefox.

To begin exploring GraphQL, set in the URL bar of your IDE or extension the GraphQL endpoint by entering http://your-magento2-server-adress/graphql. Check that the POST method is selected.

In this example Altair GraphQL browser extension is used.

Altair GraphQL

Using GraphQL to place an order with the Reward Points module

Let's place an order with reward points of our module for a default Magento user Veronica Costello.

Prerequisites

In order to begin placing order using GraphQL the following preconditions must be completed:

  • Your store should have installed module Rewards GraphQL. It is not available separately, but it can be installed after the purchase of Reward Points + Referral program module. After you have installed this module, open command line interface and go to the directory with your Magento setup.

    Run command composer require mirasvit/module-rewards-graph-ql and after it finishes activate Rewards GraphQl module with command bin/magento module:enable Mirasvit_RewardsGraphQl. In the end run bin/magento setup:upgrade otherwise you will get an error or blank screen

  • The customer should be registered and logged in, as the module doesn't work with guest customers Logged Customer

  • You should have at least one configured and enabled Payment method: Stores > Settings > Configuration > Sales > Payment Methods Configured Payment

  • You should have at least one configured and enabled Shipping method: Stores > Settings > Configuration > Sales > Shipping Methods. Skip this requirement for virtual quotes. Your store can have no Shipping method option, use option Delivery method Delivery Method

  • Your customer should have points on his account. Check the points balance: Customers > All customers Customer Points Balance

  • Configure a Spending rule according to your requirements. Go to Marketing > Promotions > Reward Points and click on Earning Rules to call out the menu where you'll find Spending Rules. Information about parameters of Spending rule is available on Spending Rules page. Examples of Spending Rules are available on page Spending Rules Examples Spending rule

Creating cart, adding item, setting shipping and billing address, shipping method

Step 1: Get customer's authorization token

To be able to use GraphQL on behalf of the chosen user firstly you should get this customer's authorization token. Read more on authorization tokens in official Magento Developer Documentation on page Authorization tokens.

By default, a customer token is valid for 1 hour. You can change these values from Admin by selecting Stores > Settings > Configuration > Services > OAuth > Access Token Expiration > Customer Token Lifetime

Token Lifetime

For generating the token a mutation keyword is used. While GraphQL queries perform read operations, mutations change the data. A mutation can create, update, or delete objects and fields. In REST terminology, queries operate like GET requests, while mutations are similar to POST, PUT, and DELETE. More on the mutations read in Magento Developer Documentation (Magento DevDocs) on page Using mutations

Send request:

mutation {
    generateCustomerToken(
        email: "[email protected]"
        password: "[email protected]"
    ) {
        token
    }
}

You will get response:

{
  "data": {
    "generateCustomerToken": {
      "token": "ebsvrn1t4rd4hj31zou6kjbx2babuuqk"
    }
  }
}

generateCustomerToken

Copy the token, and add it to the header.

Authorization Header

Step 2: Create a customer cart

The customer for whom the token has been generated does not have an active cart. The following query creates an empty cart and returns the cart ID.

Send request:

{
    customerCart {
        id
    }
}

You will get response:

{
  "data": {
    "customerCart": {
      "id": "1pFmurBFkwozlAtssXLK9k8jgM3qagtZ"
    }
  }
}

Generating New cart

Step 3. Adding specific product to cart

When we know customer's cart ID, we can add an item to this cart. GraphQL supports all product types, but this tutorial only demonstrates how to add a simple product to the shopping cart. You can find more details how to add other product types on the following pages of Magento DevDocs:

Send request with cart_id value equal to id value obtained in a previous step. Parameter SKU is the identifier of the simple product you want to add to the cart. You can obtain SKU on the product page.

Request:

mutation {
    addSimpleProductsToCart(
        input: {
            cart_id: "1pFmurBFkwozlAtssXLK9k8jgM3qagtZ"
            cart_items: [{ data: { quantity: 1, sku: "24-MB04" } }]
        }
    ) {
        cart {
            items {
                id
                product {
                    sku
                    stock_status
                }
                quantity
            }
        }
    }
}

Response:

{
  "data": {
    "addSimpleProductsToCart": {
      "cart": {
        "items": [
          {
            "id": "5",
            "product": {
              "sku": "24-MB04",
              "stock_status": "IN_STOCK"
            },
            "quantity": 1
          }
        ]
      }
    }
  }
}

GraphQL Added Item.png

Now previously empty cart has new item, and user can see it in his account.

Step 4. Setting the shipping address

The shipping address is the address where customer wants to receive the items ordered. To set a shipping address for the user a setShippingAddressesOnCart mutation. Its full parameters are available in Magento DevDocs on page setShippingAddressesOnCart mutation

Skip this step for the virtual quotes.

Send request:

mutation {
    setShippingAddressesOnCart(
        input: {
            cart_id: "1pFmurBFkwozlAtssXLK9k8jgM3qagtZ"
            shipping_addresses: [
                {
                    address: {
                        firstname: "Veronica"
                        lastname: "Costello"
                        company: "Company Name"
                        street: ["3320 N Crescent Dr", "Beverly Hills"]
                        city: "Los Angeles"
                        region: "CA"
                        region_id: 12
                        postcode: "90210"
                        country_code: "US"
                        telephone: "123-456-0000"
                        save_in_address_book: false
                    }
                }
            ]
        }
    ) {
        cart {
            shipping_addresses {
                firstname
                lastname
                company
                street
                city
                region {
                    code
                    label
                }
                postcode
                telephone
                country {
                    code
                    label
                }
                available_shipping_methods {
                    carrier_code
                    carrier_title
                    method_code
                    method_title
                }
            }
        }
    }
}

You will get response

{
  "data": {
    "setShippingAddressesOnCart": {
      "cart": {
        "shipping_addresses": [
          {
            "firstname": "Veronica",
            "lastname": "Costello",
            "company": "Company Name",
            "street": [
              "3320 N Crescent Dr",
              "Beverly Hills"
            ],
            "city": "Los Angeles",
            "region": {
              "code": "CA",
              "label": "California"
            },
            "postcode": "90210",
            "telephone": "123-456-0000",
            "country": {
              "code": "US",
              "label": "US"
            },
            "available_shipping_methods": [
              {
                "carrier_code": "flatrate",
                "carrier_title": "Flat Rate",
                "method_code": "flatrate",
                "method_title": "Fixed"
              },
              {
                "carrier_code": "tablerate",
                "carrier_title": "Best Way",
                "method_code": "bestway",
                "method_title": "Table Rate"
              }
            ]
          }
        ]
      }
    }
  }
}

Set Shipping Address.png

The new shipping adress will be visible when order will be placed.

Step 5. Setting the billing address

The folowing step of setting the billing address is similar to the setting of shipping address.

Request:

mutation {
    setBillingAddressOnCart(
        input: {
            cart_id: "1pFmurBFkwozlAtssXLK9k8jgM3qagtZ"
            billing_address: {
                address: {
                    firstname: "Veronica"
                    lastname: "Costello"
                    company: "Company Name"
                    street: ["64 Strawberry Dr", "Beverly Hills"]
                    city: "Los Angeles"
                    region: "CA"
                    region_id: 12
                    postcode: "90210"
                    country_code: "US"
                    telephone: "123-456-0000"
                    save_in_address_book: true
                }
            }
        }
    ) {
        cart {
            billing_address {
                firstname
                lastname
                company
                street
                city
                region {
                    code
                    label
                }
                postcode
                telephone
                country {
                    code
                    label
                }
            }
        }
    }
}

Response

{
  "data": {
    "setBillingAddressOnCart": {
      "cart": {
        "billing_address": {
          "firstname": "Veronica",
          "lastname": "Costello",
          "company": "Company Name",
          "street": [
            "64 Strawberry Dr",
            "Beverly Hills"
          ],
          "city": "Los Angeles",
          "region": {
            "code": "CA",
            "label": "California"
          },
          "postcode": "90210",
          "telephone": "123-456-0000",
          "country": {
            "code": "US",
            "label": "US"
          }
        }
      }
    }
  }
}

Set Billing Address.png

Step 6. Set shipping method

Request

mutation {
    setShippingMethodsOnCart(
        input: {
            cart_id: "1pFmurBFkwozlAtssXLK9k8jgM3qagtZ"
            shipping_methods: [{ carrier_code: "flatrate", method_code: "flatrate" }]
        }
    ) {
        cart {
            shipping_addresses {
                selected_shipping_method {
                    carrier_code
                    method_code
                    carrier_title
                    method_title
                }
            }
        }
    }
}

Responce

{
  "data": {
    "setShippingMethodsOnCart": {
      "cart": {
        "shipping_addresses": [
          {
            "selected_shipping_method": {
              "carrier_code": "flatrate",
              "method_code": "flatrate",
              "carrier_title": "Flat Rate",
              "method_title": "Fixed"
            }
          },
          {
            "selected_shipping_method": null
          }
        ]
      }
    }
  }
}

Set Shipping Method

Step 7. Check the order

After the order details and shipping and billing adresses have been set check the order.

Request

{
    customerCart {
        id
        items {
            id
            product {
                name
                sku
            }
            quantity
        }
        prices {
            discount {
                label
                amount {
                    value
                }
            }
            subtotal_excluding_tax {
                value
            }
            applied_taxes {
                label
                amount {
                    value
                }
            }
            grand_total {
                value
            }
        }
        mstRewardPoints {
            is_applied
            spend_points
            base_spend_amount {
                value
            }
            spend_amount {
                value
            }
            spend_min_points
            spend_max_points
            earn_points
        }
    }
}

Result

{
  "data": {
    "customerCart": {
      "id": "1pFmurBFkwozlAtssXLK9k8jgM3qagtZ",
      "items": [
        {
          "id": "5",
          "product": {
            "name": "Strive Shoulder Pack",
            "sku": "24-MB04"
          },
          "quantity": 1
        }
      ],
      "prices": {
        "discount": null,
        "subtotal_excluding_tax": {
          "value": 32
        },
        "applied_taxes": [],
        "grand_total": {
          "value": 37
        }
      },
      "mstRewardPoints": {
        "is_applied": false,
        "spend_points": 0,
        "base_spend_amount": {
          "value": 0
        },
        "spend_amount": {
          "value": 0
        },
        "spend_min_points": 10,
        "spend_max_points": 35,
        "earn_points": 0
      }
    }
  }
}

Order Checking

Apply reward points to the order

Step 8. Add reward points to the cart

On this step add to the cart the desired number of reward points. Discoint to the order will be applied accordingly to the Spending rule.

Request

mutation {
    mstRewardsApplyPointsToCart(
        input: { cart_id: "1pFmurBFkwozlAtssXLK9k8jgM3qagtZ", amount: 10 }
    ) {
        cart {
            prices {
                grand_total {
                    value
                    currency
                }
            }
            mstRewardPoints {
                is_applied
                spend_points
                base_spend_amount {
                    value
                }
                spend_amount {
                    value
                }
                spend_min_points
                spend_max_points
                earn_points
            }
        }
    }
}

Response

{
  "data": {
    "mstRewardsApplyPointsToCart": {
      "cart": {
        "prices": {
          "grand_total": {
            "value": 17.99,
            "currency": "USD"
          }
        },
        "mstRewardPoints": {
          "is_applied": true,
          "spend_points": 10,
          "base_spend_amount": {
            "value": 20
          },
          "spend_amount": {
            "value": 20
          },
          "spend_min_points": 10,
          "spend_max_points": 20,
          "earn_points": 0
        }
      }
    }
  }
}

Apply Reward Points

Finishing the order: getting and setting payment method, placing the order

Step 9. Get available payment methods

Check what payment methods are available to the current user.

Request

query {
    cart(cart_id: "1pFmurBFkwozlAtssXLK9k8jgM3qagtZ") {
        available_payment_methods {
            code
            title
        }
    }
}

Response

{
  "data": {
    "cart": {
      "available_payment_methods": [
        {
          "code": "checkmo",
          "title": "Check / Money order"
        }
      ]
    }
  }
}

Get Payment Methods

Step 10. Set payment method

Choose one of the available payment methods obtained on the previous step and set this payment method for the current cart.

Request

mutation {
    setPaymentMethodOnCart(
        input: {
            cart_id: "1pFmurBFkwozlAtssXLK9k8jgM3qagtZ"
            payment_method: { code: "checkmo" }
        }
    ) {
        cart {
            selected_payment_method {
                code
            }
        }
    }
}

Response

{
  "data": {
    "setPaymentMethodOnCart": {
      "cart": {
        "selected_payment_method": {
          "code": "checkmo"
        }
      }
    }
  }
}

Set Payment Method

Step 11. Place the order

Up to this moment all required steps for the order are complete and you can place the order. It can take a few minutes.

Request

mutation {
    placeOrder(input: { cart_id: "1pFmurBFkwozlAtssXLK9k8jgM3qagtZ" }) {
        order {
            order_number
        }
    }
}

Response

{
  "data": {
    "placeOrder": {
      "order": {
        "order_number": "000000003"
      }
    }
  }
}

Place Order

User can check his order with applied reward points

The user in his account will get a new order with the same order_number as in the previous step. He will be able to review order details as usual. This order will have reward points applied, and user will see the respective discount.

Placed Order

# Examples of Earning Rules

In this section, we will explain the possible configurations of typical rules.

Behavior Rules

  • Give 5 points for a sign up in the store

    A customer signs up in the store and receives points.

    • Type: Behavior Rule
    • Is Active: Yes
    • Customer Groups: All
    • Event: Customer signs up in store
    • Number of points to give (X): 5
    • Conditions: None
    • Message in the rewards history: Give points for a sign up in the store.
  • A customer receives 10 points for the sign-ups of his/her referrals in the store

    A customer makes referrals to any number of persons.

    • Type: Behavior Rule
    • Is Active: Yes
    • Customer Groups: All
    • Event: Referred customer signs up in store
    • Number of points to give (X): 10
    • Conditions: None
    • Message in the rewards history: Points when your referrals sign up in store.
  • Refer 5 friends and receive 15 points when they order

    The Customer invites many friends but gets points only for the first five referees.

    • Type: Behavior Rule
    • Is Active: Yes
    • Customer Groups: All
    • Event: Order from referred customer
    • Number of points to give (X): 15
    • Conditions:
    • If ALL of these conditions are TRUE:
      • Number of referrals who ordered at least once is 5
    • Message in the rewards history: Points earned for referrals' orders.
  • Give 50 points if Customer is inactive for more than 20 days

    If the Customer is inactive for more than twenty days, he will receive 50 points.

    • Type: Behavior Rule
    • Is Active: Yes
    • Customer Groups: All
    • Event: Customer is inactive for a long time
    • Number of Inactive Days: 20
    • Number of points to give (X): 50
    • Conditions: None
    • Message in the rewards history: We miss you.
  • Write a review and receive 100 points

    Customers will get points for each approved review in the store.

    • Type: Behavior Rule
    • Is Active: Yes
    • Customer Groups: All
    • Event: Customer writes a product review
    • Number of points to give (X): 100
    • Conditions: None
    • Message in the rewards history: Points for a product review.
  • Write max 2 reviews per day and receive 100 points

    The Customer may write several reviews but will get a maximum of 200 points for two reviews per day.

    • Type: Behavior Rule
    • Is Active: Yes.
    • Customer Groups: All.
    • Event: Customer writes a product review.
    • Number of points to give (X): 100
    • Maximum number of earned points for one Customer per day: 200
    • Conditions: None.
    • Message in the rewards history: Points from product reviews.
  • Give 100 points for Birthday

    Customers will get 100 points on their Birthdays each year.

    • Type: Behavior Rule
    • Is Active: Yes
    • Customer Groups: All
    • Event: Customer has a birthday
    • Number of points to give (X): 100
    • Conditions: None
    • Message in the rewards history: Points for Birthday!
  • Give 15 points for pinning to Pinterest

    If the Customer pins the page on Pinterest, he/she stands a chance in getting points.

    • Type: Behavior Rule
    • Is Active: Yes
    • Customer Groups: All
    • Event: Pinterest Pin
    • Number of points to give (X): 15
    • Conditions: None
    • Message in the rewards history: Points from pages pinned Pinterest.
  • Give 15 points for 3 Tweets in day

    If the Customer shares a page on Twitter, he or she stands a chance of getting points.

    • Type: Behavior Rule
    • Is Active: Yes
    • Customer Groups: All
    • Event: Twitter Tweet
    • Number of points to give (X): 15
    • Maximum number of earned points for one customer per day: 45
    • Conditions: None
    • Message in the rewards history: Points from pages shared on Twitter.
  • Give 15 points for a Facebook Share

    If the Customer shares the page on Facebook, he or she stands a chance of getting points.

    • Type: Behavior Rule
    • Is Active: Yes
    • Customer Groups: All
    • Event: Facebook Share
    • Number of points to give (X): 15
    • Conditions: None
    • Message in the rewards history: Points for Facebook Shares.
  • Give 150 points when 5 referred friends register on the website

    The Customer refers to some friends but gets points only for the first five(5) registrations.

    • Type: Behavior Rule
    • Is Active: Yes
    • Customer Groups: All
    • Event: Customer signs up in store
    • Number of points to give (X): 150
    • Conditions:
      • If ALL of these conditions are TRUE:
      • Number of referred friend signups is 5
    • Message in the rewards history: Points earned for registration of referred friends.
  • Use friend invitations and receive 30 points for the first order

    The Customer uses a referral link and places their first order.

    • Type: Behavior Rule
    • Is Active: Yes
    • Customer Groups: All
    • Event: Customer places order
    • Number of points to give (X): 30
    • Conditions:
      • If ALL of these conditions are TRUE:
      • Is Referee is Yes
      • Number of Orders is 1
    • Message in the rewards history: Points earned for the first order placing.
  • Refer a friend and receive 10 points for his first order

    The Customer invites many friends but gets points only for the first five referees.

    • Type: Behavior Rule
    • Is Active: Yes
    • Customer Groups: All
    • Event: Order from referred customer
    • Number of points to give (X): 10
    • Conditions:
      • If ALL of these conditions are TRUE:
      • Referred: Number of Orders is 1
    • Message in the rewards history: Points earned for referrals' orders.
  • Give 20 points if Customer places 4 orders or if he reaches reach $500

    The Customer will get 20 points for placing four orders or for reaching $500.

    • Type: Behavior Rule
    • Is Active: Yes
    • Customer Groups: All
    • Event: Customer places order
    • Conditions:
      • If Any of these conditions are TRUE:
      • Number of Orders is 4
      • Lifetime Sales equals or greater than 500
    • Number of points to give (X): 20
    • Message in the rewards history: Points earned from the number of orders.

Cart Rules

  • Pay with Cash On Delivery and receive a bonus of 100 points

    Customers will pay using the "Cash On Delivery" method and get 100 points.

    • Type: Cart Rule
    • Is Active: Yes
    • Customer Groups: All
    • Conditions:
      • If ALL of these conditions are TRUE:
      • Payment Method is Cash On Delivery
    • Customer Earning Style: Give X points to customer
    • Number of Points (X): 100
  • Order 3 or more products and receive an additional 10 point for every $100

    If the Customer adds three or more products on the shopping cart, he or she will get 10 points for every $100 spent.

    • Type: Cart Rule
    • Is Active: Yes
    • Customer Groups: All
    • Conditions:
      • If ALL of these conditions are TRUE:
      • Total Items Quantity equals or greater than 3
    • Customer Earning Style: For every Y, give X points
    • Number of Points (X): 10
    • Step (Y): 100

#Examples of Spending Rules

In this section, we will explain the possible rules for configurations.

  • For every 10 points give a $1 discount

    The customer will get $1 discount for every 10 points spent.

    • Is Active: Yes
    • Customer Groups: All
    • Conditions: None
    • Actions:
      • For each spent X points: 10
      • Customer receives Y discount: 1
  • For Retailer Customer Group: for every 10 points give a $5 discount

    Only users from the Retailer Customer Group can get this discount.

    • Is Active: Yes
    • Customer Groups: Retailer
    • Conditions: None
    • Actions:
      • For each spent X points: 10
      • Customer receives Y discount: 5
  • Apply the rule for only 4 specified products and every 10 points give a $1 discount

    Customer will get a $1 discount for every 10 points spent, but only for products with SKU: 24-MB01, 24-UG01, MH01-L-Black, MJ04-L-Purple

    • Is Active: Yes
    • Customer Groups: All
    • Conditions: None
    • Actions:
      • If ALL of these conditions are TRUE:
      • SKU is one of 4-MB01, 24-UG01, MH01-L-Black, MJ04-L-Purple
      • For each spent X points: 10
      • Customer receive Y discount: 1
  • Restrict use if less than 100 points and do not allow to use it for more than 30% of order cost

    The customer will get $1 discount for every 10 points spent. But the minimum number of points which they can use in the Shopping Cart is 100 points. Also, they can't use more than 30% of the order cost.

    • Is Active: Yes
    • Customer Groups: All
    • Conditions: None
    • Actions:
      • For each spent X points: 10
      • Customer receive Y discount: 1
      • Spend minimum: 100
      • Spend maximum: 30%

Examples of Notification Rules

In this section, we shall explain the typical rules of configuration.

  • My Reward Points Description

    The rule will show a notification message in the "My Reward Points" section in the customer's account.

    • Is Active: Yes.
    • Customer Groups: All.
    • Show message on: Customer Account > My Reward Points.
    • Message: For each spent $10.00, you earn 10 Reward Points.
  • Invite a friend and earn points

    The rule will show a notification message in the "My Referrals" section in the customer's account.

    • Is Active: Yes
    • Customer Groups: All
    • Show message on: Customer Account > My Referrals
    • Message: Refer a friend and receive points for their first three (3)orders!
  • Place an order for three or more products and earn double points!

    The rule will show a notification message on the Shopping Cart.

    • Is Active: Yes
    • Customer Groups: All
    • Show message on: Cart Page
    • Message: Buy three products or more to earn double points!



Reports

Reports on our extension, are divided into two separate menu actions:

  • Refresh Statistics, which is used in keeping statistics up to date, and concentrating data for displaying.
  • Reports, which is used in the visualization of data.

These actions can be selected from the menu drop-down in Marketing -> Reward Points section.

How to generate Reports on Rewards Policy

If you haven't recently gathered statistics, you will have to go to Marketing -> Reward Points and select Refresh Statistics. It will force data gathering and then redirect you to the Reports page, updated with your current data.

The report chart is build with such parameters:

  • Period - defines a period, from which the chart is built, and when the table is shown;
  • Customer Group - defines the customers' group, which is taken into account;
  • Store View - defines the store view, where the activity is shown;
  • Chart Step - defines which step is taken for each row/chart bar.

Click on Manage Filters on the buttons bar, to show the following filters:

  • Day
  • Earned for order
  • Customer inactivity
  • Customer refers friend
  • Canceled earned points
  • Refunded from credit memo
  • Spent points
  • Spent points restored
  • Expired points
  • Total Spent Points in money equivalent
  • Admin Transactions
  • Earned for Facebook Like
  • Earned for Pin
  • Earned for tweet
  • Earned for RMA
  • Earned for signup

Click on Additional Filters to show the following additional filters on orders, order payments, invoices, customers, stock items, products, categories, customer addresses, order addresses, and payment transactions.

Edit columns - removes the column from the chart.

Export - exports the report in CSV or Excel XML file type.

# Importing Transactions

Our extension allows data importing from other extensions using the CSV data format.

Note

Unfortunately, we can not add a download sample file due to Magento restrictions.

You can get a sample file by creating a manual transaction on Marketing -> Reward Points -> Transaction and then exporting it using Export -> CSV action of the Grid.

How to Import Transactions data

1) Extract data from your Reward Points extension to the CSV file, so that it contains the following columns (each line of that file would consist of transactions):

  • transaction_id - a unique ID of each transaction. Can be simple counter;
  • customer_name - first an last name of the customer;
  • customer_email - email of the customer;
  • customer_group_name - name of the in-store customer group the customer is assigned to;
  • website_id - shall contain not actual Website ID, but its code, according to your M2 store view setup. base is the most common code used by default.
  • amount - the number of points that will be uploaded in the current transaction.
  • amount_used - number of points used. Typically, this is set to 0. If there is no zero value, then the difference between this and the above will be uploaded.
  • comment - comment on current transaction.
  • code - code of action (upload in this case).This is recommended to pick up the same code for all uploaded transactions, so if the upload was incorrect, the transactions could be easily removed.
  • is_expired - whether uploaded points have expired. It is useful when uploading legacy transactions to maintain balance history.
  • is_expiration_email_sent - whether expiration email is sent. Typically 0, as this does not affect uploads.
  • expires_at - This is the expiration date uploaded in the transaction.
  • created_at - date the transaction was made. Extremely useful for uploading legacy transactions.
  • updated_at - date the last transaction was updated. Typically should be the same as the above.

    Note

    If you're importing data from Mirasvit Reward Points extension, you can use special Migration script.

It will extract your data directly into '/tmp/points_export.csv' file. Feel free to change this SQL to suit your needs.

2) Go to System -> Data Transfer -> Import, and on the drop-down menu Entity Type, select Reward Points Transactions. You will see the following options:

  • Import Behavior - defines which action should be performed. Currently supported:

    • Add/Update - adds or updates of transactions (if transaction_id matches);
    • Replace - replaces transactions regardless of their existence.
    • Delete - deletes all transactions with no IDs on the import file. Useful for cleaning up incorrect upload.
      • Validation Strategy:
    • Stop on Error - stops importing, if errors are found;
    • Skip Error Entries - upload data as valid data will be uploaded, while others will be dropped off.
      • Allowed Errors Count - used if Stop on Error is selected, and it determines the number of errors allowed.
      • Field separator, Multiple value separator and Fields enclosure are CSV parameters, make them match your file format.
  • File to Import - specifies the data file to import.

    • Select File to Import - drop here CSV file, that you had exported in the previous step;
    • Images File Directory - used, if links to pictures are used in the file exported. Typically it's not used at all.

    Note

    Magento 2 Import function can have restrictions on the file size. By default, it's only 2M. The best way to increase it is to - open your .htaccess file, and enter the following options (let us make a limit of 40M):

        php_value upload_max_filesize 40M
        php_value post_max_size 40M

    Select appropriate options, and press Check Data. It will conduct data validation.

3) After validation is finished, you will see the messages with errors found under the optionsection. If data validation is passed (errors' quantity did not exceed the Allowed Errors Count parameter), the Import button appears. Press it to import transactions.

Note

You can also upload only the customer's balance. Just treat them as transactions -per customer.

Building Referral Program

Our extension provides tools in creating a flexible referral program. Here is how it works:

  1. The Customer invites some referees to the store, by using the My Referrals section on his account. There are two ways to do this:
    • By sending a mail of invitation, using Send Invitations form;
    • Send (or share on a social network, for example) the so-called Referral Link, displayed at Your referral link label.
  2. Each of our invited customers(referee), receives a unique link that they could use in visiting our store. Our link contains a hidden data picked up by our controller, and recorded as a potential referral section;
  3. If the Customer (the referee) registers during this session, he is registered as a referee. If he doesn't, he will be treated as a regular user after the expiration of the session - unless he uses a referral link again, (another potential record for him will not be created);
  4. When referees register, the event Referred customer signs up in the store will be triggered. If Behaviour Rules were bound to it, they will also be triggered.
  5. When a referee places an order, the event Order from a referred customer will be triggered. If Behaviour Rules were bound to it, they will also be triggered.
  6. You can also create other Behaviour Rules for other events, and connect the referees to the referral policy, using Is a Referral special condition.
  7. You can combine different rules to create a flexible referral program and extend your customer base with corresponding awards.

How-To

Contents

  • How can I make Customer earn points after buying some specific products
  • How can I prevent rules from multiply?
  • How can I set up a rule to award for both referral customers, and their referee
  • How can I create so-called 'threshold' and 'milestone rule'
  • How can I award Customer with 'gift' points, that he can use in his first order

How can I make a Customer earn points after buying specific products

It can be done in two ways - using Product or Cart rules.

If you use Cart rule:

  • You need to control not only the products but also the quantity to it:
    • Jump to Conditions tab and add a new condition. On the drop-down list, select Product subselection. It will produce nested conditions block with a master condition to it, which filters the number of products selected;
    • In this nested block set up, the quantity, that should trigger the rule, if you need to award the Customer for buying three(3) items -should contain If the total quantity is equal to or greater than 3 for a subselection of items on the Cart matching ALL of these conditions;
    • Add to the nested block Category, SKU, or other attributes of the products, that should trigger the rule - as described on the Product rule;
  • If you need to control the presence of the product on the Cart:
    • Jump to Actions tab, and create a new condition in Apply the rule only to cart items matching the following conditions section;
    • Add appropriate product attributes, that should trigger the rule - as described above.

Note

If you use Cart rule, do not use both of the described approaches simultaneously - because they will conflict with each other. Create two Earning rules instead - you may also see next case to trigger them properly;

How can I prevent rules from multiplying? For example: if a customer adds to cart a product, and this product satisfies both rules, only one rule should be triggered.

  • Jump to General Information tab and assign to these rules priorities according to each product's promotional significance. Say, you have products A and B, and both are on the Cart - the reward for B should be applied. The rule for product A should thus have a priority of 20, and for B - 10;
  • Set option Stop further rules processing to Yes. It will prevent rules with the same or lower priority from triggering, even if their conditions apply.

How can I set up a rule to award both the customers and their friends (e. g. customer, and the person that was invited by him).

It can not be done via one earning rule. You will need both - one for the customer, and the second for his referee.

The rule applicable to referees can be created this way:

  • Create a new Earning Rule of Behaviour type at Reward Points -> Earning Rule;
  • If you wish to award the referred Customer for the purchase, pick event Customer places order;
  • Jump to the Conditions (or Conditions and Actions) tab, and add new condition. In drop-down list, in Customer section select Is Referee condition and set it to Yes;
  • Add other conditions - for example, if you need to set awards for a certain order number, refer to milestone rule case, below in this section;
  • Jump to Actions section, set points to earn, save and activate the rule.

The rule for Referral can be created by using only Behaviour type of Earning Rule:

  • Create a new Earning Rule of Behaviour type at Reward Points -> Earning Rule, and jump to the Conditions and Actions tab;
  • If you wish to award Customer, when referees register, pick event Referred customer signs up in-store;
  • If you wish to award Customer, when referees place an order, pick event Orders from referred Customer;
  • If you also need to award Referee for a certain number of orders made, or placed by the Customer referred(the referee) - or make other limitations regarding his referrals, - use the conditions on Referral Customer subsection. For example, if you need to award points only for the first Referee's order, you need Referral: Number of Orders condition;
  • Save and activate the rule.

How can I create the so-called 'threshold' and 'milestone rule', which will award Customer with additional points on reaching a certain sales amount or a certain number of orders made.

To award customers with additional points depending on their achievements, you need to use either Cart, or Behaviour rule. Both of them support the conditions that allow checking out for Customer' properties. Simply add them to the Conditions tab to make a rule threshold or milestone.

Here is the list of conditions that can be used in most cases:

  • Award only with the first order. Use the condition - Number of Orders - and set it to 0. It does not apply only to Behaviour rules, which use Customer places an order event - in this case you need to set 1 (because this event will be triggered after an order is placed);
  • Award customer for certain X-th order (say, 10th). Use the same Number of Orders condition, but it should be equal to X - 1 (for Customer places an order shall be equal to X);
  • Award customer for reaching certain X points on his Balance. Use two conditions Balance points amount - for the lower limit and upper limit (when necessary).
  • Award customer for spending X amount of money in-store. Use two conditions Lifetime Sales - for the lower limit and upper limit (when necessary).

Not only will the Customer's overall achievements be checked, but the purchases made as well. Use for that additional conditions, located under Cart Attributes, for rules of Cart type.

How can I award customers with 'gift' points that they can use in their first order.

Customers can receive points immediately after registering by using only Behaviour rule. Here is how it can be done:

  • Create a Behaviour rule at Reward Points -> Earning points and on Conditions & Actions pick up event Customer signs up in store;
  • Set Customer Earning Style to Give X points to Customer and set the number of points he can receive;
  • If you wish to suppress front end notifications for this rule, add Signing up event at Reward Points -> Settings -> Display -> Disable Behaviour Notifications;
  • Add other condition or conditions, if you need to - for example, a check for Referees (see the case above);
  • Save and activate the rule.

This rule will let a customer receive points upon registration, and they can spend the same in their first order.

Migration from Magento 1 to Magento 2

Below are examples of the script, which may be used in transferring data from Mirasvit Reward Points for Magento 1 to Mirasvit Reward Points for Magento 2.

To use this script, you will need the help of a PHP developer. This script may contain bugs which may not transfer all the necessary data. So you will need to fit it in line with your needs.

Our migration scripts provided above are examples. Unfortunately, in some cases, the migration requires an additional developer's supervision to make the migration go smoothly. Therefore, if you wish to employ our developers' services to make the migration to your store successful, you should buy our migration service on https://mirasvit.com/magento-extensions/data-migration-service.html

Click on the name of the export script below to download:

How to perform the migration

Follow these steps to perform the migration correctly:

  1. Run a standard Magento 2 migration, and ensure, that customers and their orders are transferred from your M1 store to M2;
  2. Ensure that the Reward Points for Magento 2 are [installed]on (/setup/installation) to your M2 store.
  3. Modify "`mirasvit_rewards_m1_export.phpscript to match your setup. Typically, it would be best if you changed$exportFileName``` variable for storing exported data (full path is required). Make sure that this file doesn't exist.
  4. Place "`mirasvit_rewards_m1_export.php``` to the root of your M1 store, and run it either:
    • From browser by opening URL http://store_m1.com/mirasvit_rewards_m1_export.php, or;
    • From SSH/Console: navigate to your store's root and run command php -f mirasvit_rewards_m1_export.php
  5. If the script returns successful, a file with the name, set at $exportFileName, will be created. Transfer it to your workstation.
  6. Run step 2 of Import procedure.
  7. Check migrated data.
  8. When the migration is complete, remove migration script.

Troubleshooting

  • In some cases, import script can be crushed on a timeout or memory overloading error (due to large quantities of data). In this case, you will have to restart the import script by reloading the browser page. It will skip to the previously uploaded data, and proceed from the last unprocessed record.

How to upgrade extension

To upgrade the extension, follow these steps:

  1. Backup your store's database and web directory.
  2. Log in to the SSH console in your server and navigate to the root directory of the Magento 2 store.
  3. Run command composer require mirasvit/module-rewards:* --update-with-dependencies to update current extension with all dependencies.

    Note

    In some cases, the command above is not applicable, or it's not possible to update just the current module, or you need to upgrade all Mirasvit modules in a bundle. In this case, the command above will have no effect.

    Run instead composer update mirasvit/* command. It will update all Mirasvit modules installed in your store.

  4. Run command php -f bin/magento setup:upgrade to install updates.
  5. Run command php -f bin/magento cache:clean to clean the cache.
  6. Deploy static view files

    rm -rf pub/static/*; rm -rf var/view_preprocessed/*; php -f bin/magento setup:static-content:deploy

Disabling the Extension

Temporarily Disable

To temporarily disable the extension please follow these steps:

  1. Login to the SSH console on your server and navigate to the root directory of the Magento 2 store.
  2. Run the command php -f bin/magento module:disable Mirasvit_Rewards Mirasvit_RewardsAdminUi Mirasvit_RewardsApi Mirasvit_RewardsBehavior Mirasvit_RewardsCatalog Mirasvit_RewardsCheckout Mirasvit_RewardsCustomerAccount to disable the extension.
  3. Log in to the Magento backend and refresh the store cache (if enabled).

Extension Removal

To uninstall the extension, please follow these steps:

  1. Login to the SSH console on your server and navigate to the Magento 2 store's root directory.
  2. Run command php -f bin/magento module:disable Mirasvit_Rewards Mirasvit_RewardsAdminUi Mirasvit_RewardsApi Mirasvit_RewardsBehavior Mirasvit_RewardsCatalog Mirasvit_RewardsCheckout Mirasvit_RewardsCustomerAccount to disable the extension.
  3. Run command composer remove mirasvit/module-rewards to remove the extension.
  4. Log in to the Magento backend and refresh the store cache (if enabled).

3.2.9

(2024-10-02)

Fixed

  • Call to a member function getTypeId() on null for spending rules with the condition "Attribute Set"

3.2.8

(2024-09-11)

Fixed

  • Tags displayed in AddToAny widget

3.2.7

(2024-09-09)

Fixed

  • Call to getTypeId on null when validate configurable product

3.2.6

(2024-09-02)

Fixed

  • Passing null to parameter #1 ($string) of type string is deprecated on the account/referral page in customer account
  • Argument #1 ($model) must be of type AbstractModel, null given in cart and checkout
  • Tier name in emails is in json format for multi-stores
  • Integrity constraint violation when set shipping_addresses via GraphQl in M246p3
  • Translate Rewards Email subject

Improvements

  • Compatibility with Amasty_CronScheduleList

3.2.5

(2024-06-14)

Fixed

  • Passing null to parameter #1 in Total/Quote/Discount.php
  • Points number is not displayed for referral invitations in customer account
  • Restored credit memo points expired if customer balance is zero that leads to negative balances
  • Store Name is not dispalyed in the Rewards Checkout Notification message

Improvements

  • Compatibility with Mirasvit Advanced Review
  • Compatibility with MageworksOnestepCheckout
  • Added translation phrasres to submodules and translate emails

3.2.4

(2024-03-21)

Fixed

  • Points are not displayed for the bundle products with fixed price and zero-prices options on the product-view page on frontend
  • Customer account points to expire message does not take into account used points amount

3.2.3

(2024-02-27)

Fixed

  • Restrict adding tags to the Rewards Name forms
  • Customer can earn double points for signup when customer confirmation is required

Improvements

  • Compatibility with Faoni Price 2.4.3v

3.2.1

(2024-02-13)

Fixed

  • Rewards menu link & My Points/My Referrals sections are shown in the customer account if the reward menu is disabled in the admin
  • Trying to access array offset on value of type null in Rewards/Model/Spending/Tier if Spending Rue is not configured in the admin
  • abs(): Passing null to parameter Rewards/Model/Spending/Rule/Condition/Address
  • Discount is not applied to the bundle product with fixed price that leads to unabling to refund

3.2.0

(2024-01-31)

Fixed

  • Removed Facebook Like behavior event
  • Condition validation does not work properly for the configurable product attributes

3.1.17

(2024-01-22)

Fixed

  • Cancel zero points in cart returns NaN value in the Rewards block input
  • Rewards Discount is not displayed in cart after page reload
  • Reward points block is not shown in the drop-down menu on the first page load

3.1.16

(2024-01-11)

Fixed

  • Condition validation does not work for the product attributes in m246p3
  • Argument must be of type array, null given in Tier/Save
  • Rewards discount increased on the shipping tax amount that leads to the negative totals in Credit Memo

3.1.15

(2023-12-20)

Fixed

  • Transaction import creates incorrect transactions per website for multiwebsite stores
  • Transaction expires_at time is not correct

3.1.14

(2023-12-11)

Fixed

  • Not allowed to spend points for the bundle items with non dynamic price

3.1.13

(2023-12-05)

Improvements

  • Added Rewards Earning message to the checkout view page

Fixed

  • Incorrect points calculation on the frontend Bundle Product view page
  • Rules did not validate custom attributes
  • Earning and Spending Rules additionally display tiers that assigned to different websites for the multiwebsite configuration

3.1.12

(2023-11-16

Fixed

  • Related product earning points on the bundle product view page calculated based on the bundle final price instead of the current related product price
  • Points for Bundle products are not displayed on the product page if the product has no dynamic price

3.1.11

(2023-11-13)

Fixed

  • Unable to create empty credit memo

3.1.10

(2023-11-08)

Fixed

  • Redirect to the URL "rewards/account"

3.1.9

(2023-10-31)

Fixed

  • Changed customer account link class to add sort order if required
  • addslashes(): Passing null to parameter #1 ($string) of type string is deprecated for twitter
  • Shipping tax was not discounted if "Tax Class for Shipping" set to "Taxable Goods"

3.1.8

(2023-10-10)

Fixed

  • Time is converted to the locale time for the inactivity points calculation
  • Points were not recalculated for bundle configured price when bundle updated on the bundle product view page

3.1.7

(2023-10-04)

Fixed

  • Rewards shipping discount was added to the item discount and caused negative row total

Improvements

  • Added rewards_base_discount order attribute

3.1.6

(2023-09-29)

Fixed

  • Negative item discount amount if coupon and Rewards are applied

3.1.5

(2023-09-26)

Fixed

  • Balance Update Email sent from the store which the customer was registered instead of the store where the order was placed

Improvements

  • Added different eventlisteners for Facebook Share button

3.1.4

(2023-09-01)

Fixed

  • Fix item discount rounding for items with identical price
  • Fix calculation discount for bundle items in invoice
  • expiration points did not calculated in reports due to nullable columns

Improvements

  • Compatibility with Klarna

3.1.3

(2023-08-03)

Fixed

  • Passing null to parameter #1 ($num) of type int|float is deprecated in Report/Points.php
  • Rewards Discount is additionally displayed in Magento discount field
  • Deprecated Functionality: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in module-price-permissions AdminhtmlBlockHtmlBeforeObserver
  • Facebook Share gave points before post when customer is not logged in to Facebook in the browser session

Improvements

  • The accuracy of tire calculation in time is close to minutes
  • Compatibility with Order Management module

3.1.2

(2023-06-26)

Fixed

  • Rewards Shipping discount wasn't added in invoice and credit memo
  • Undefined array key "qty"/Undefined array key "qty" price in RewardsCatalog/Controller/Product/Points if product view page returns 404

Improvements

  • Added Rewards widget and expiration moints number message for customer account. Replaced AddThis with AddToAny

3.1.1

(2023-05-09)

Fixed

  • Tier calculation for old versions for option "sum of spent $"

3.1.0

(2023-04-20)

Fixed

  • Discount amount doubled in invoices and credit memos
  • Renamed Twitter button in the settings

3.0.58

(2023-04-19)

Fixed

  • Removed unused option 'Allow to place orders with grand total 0'
  • Customer login redirects to 404 with wrong credentials
  • Discount is applied to items in totals calculation method
  • Removed items calculation method option
  • Wrong discount for item total

3.0.57

(2023-03-15)

Fixed

  • PHP 8.2
  • Deprecated Functionality: strpos(): Passing null to parameter in Spending/Tier.php
  • Call to a member function getSpendAmount() on bool in ApplyDiscountToItemPlugin245

3.0.56

(2023-03-02)

Fixed

  • Argument value must be type of string, object given. in framework/Filter/Template.php when points expire by cron

3.0.55

(2023-03-01)

Fixed

  • Changed column names in the admin referral grid
  • The referee name and email was not set after signing up
  • Existent customer became referee by signing up a referral link
  • Magento 2.4.6 returns number of points in currency format
  • Class "Magento\Framework\Filter\FilterInput" not found when save rule in admin
  • Deprecated Functionality: strpos(): Passing null to parameter #1 in Combine.php

3.0.54

(2023-02-01)

Fixed

  • Rewards discount total row is added to the cart total when coupon is applied to the shipping amount and points were not spend
  • Increased discount applied to the item in checkout
  • Cart Rule Actions validated catalog products instead of Cart Items(Mirasvit Sales Rule condition "is Discounted" )

Improvements

  • Compatibility with M2.4.6

3.0.53

(2022-12-12)

Fixed

  • Unsubscribe email link leads to a 404 page
  • Not valid coupon is applied if Earning rule has an option "Coupon used"
  • Points earning for signing up event after account confirmation
  • Rewards discount was multiplied by the Magento rules qty for items calculation method
  • Rewards discount was multiplied by the Magento rules qty for items calculation method
  • Disable displaying separate row total Rewards discount for 'items' calculation method

Improvements

  • Compatibility with MagestyApps_PaymentFee

3.0.52

(2022-11-07)

Fixed

  • Enable Fakebook Like button counter
  • 'special_price' attribute worked for non-valid date
  • Guest customer is redirected to login page when tries to access rewards account
  • Compatibility with Aheadworks_OneStepCheckout
  • Remove duplicate Rewards Description

Improvements

  • Compatibility with Klarna Payment M245

3.0.51

(2022-09-29)

Fixed

  • Items discount does not apply in m2.4.4 and above for items calculation method
  • Deprecated Functionality: str_replace(): Passing null to param
  • Trying to access array offset on value of type null Tier.php when cart rule is not configured

Improvements

  • Added email variables getInvitationLink & getCustomerTier to the order obj
  • Added 'alt' tag to the loader img

3.0.50

(2022-09-05)

Fixed

  • A non well formed numeric value encountered in Spend.php for option 'Display points as currency equivalent'
  • Foreign key constraint fails mst_rewards_customer_referral_link for guest customer on share page
  • Division by zero in Helper/Balance/Earn.php
  • Field Inactivity does not exist in table mst_rewards_points_aggregated_hour
  • M245 strtotime(): Passing null to parameter #1
  • Wrong cells activated upon opening behavior rules

3.0.49

(2022-08-18)

Fixed

  • klarna/m2-checkout <9.1.5v is no longer supported

3.0.48

(2022-08-16)

Fixed

  • Rewards discount description overrides coupon discount label for total calculation method
  • Undefined variable: earnedBehaviorTransaction

3.0.47

(2022-08-10)

Fixed

  • Compatibility with m2.4.5

3.0.46

(2022-08-01)

Fixed

  • Unsubscribe url doesn't work in the rewards history tab in customer account
  • Creating empty purchase for same quote after order placing
  • Points earned for the Behavior rule 'Customer places order' are not canceled with order refund

Improvements

  • Caching calculated product points to avoid performance for product & catalog pages

3.0.45

(2022-07-07)

Fixed

  • Incorrect purchase is returned from PurchaseRepository by orderId
  • afterGetBaseSubtotalWithDiscount returns null for METHOD_ITEMS calculation
  • Deprecated Functionality: trim() in RewardsCheckout/Model/Checkout/Rewards.php
  • Restored and canceled points are taken into account for the tier calculation
  • Earning rule option 'Spend Max' gets only first tier data for setting 'points as currency equivalent'
  • Can't find variable: fbLocaleCode for modal product view for Argento theme
  • Cannot read properties of undefined (reading 'visibleValue')

3.0.44

(2022-05-17)

Fixed

  • Error "PayPal gateway has rejected request. The totals of the cart item amounts do not match order amounts"

3.0.43

(2022-05-17)

Improvements

  • Update mirasvit/module-core dependency
  • Compatibility with MSP_DevTools module

Fixed

  • Rewards amount was not displayed on customer view refund page
  • Condition 'discount is used does not work for Spending Rules'

3.0.42

(2022-03-29)

Fixed

  • Compatibility with Klarna Checkout v9.2.2
  • Saving logo in m2.3
  • Compatibility with AWS S3 filesystem (tier logo)

3.0.41

(2022-03-10)

Improvement

  • php8 compatibility

3.0.40

(2022-02-14)

Fixed

  • Earning Rule Conditions doesn't contain all payment methods
  • Minimum order amount was not validated for 'total' calculation method
  • Magento coupon is unset when the Spending rule is saved
  • Transaction datetime converted the same way as Magento order
  • Reward Points number displayed with the currency symbol in the invoice PDF
  • The option 'Allow to display maximum number of possible points for configurable products' doesn't take into account 'Spend Max' per rule
  • House number and addition weren't added to the shipping address with the Tig PostNL module sipping

3.0.39

(2021-11-22)

Improvements

  • Quick Data Bar
  • PHP 7.1.0+

3.0.38

(2021-11-16)

Fixed

  • Magento coupon is unset when the Spending rule is saved
  • Progress bar displays incorrect progress for the negative tiers calculation
  • Balance email was not sent when transaction is created via API

3.0.37

(2021-11-04)

Fixed

  • Customer_id parameter uncached
  • Condition 'Lifetime Spent Points' selected all existing transactions of the current customer instead of only spend
  • When enabled async sending emails - points are not added to the current purchase due to the order_id saved in the next purchase
  • Rewards discount amount was incorrect in credit memo print pdf
  • Store Credit amount disaplayed in the Rewards input field in Credit Memo
  • Compatibility with Amasty_ShippingTableRates 1.4.12
  • Rewards block inputs are disabled in checkout after page load for Rokantheme checkout
  • Event 'customer writes a product review' didn't work for the rules with the product attributes

Improvements

  • Compatibility with Ajax Cart modules
  • Added report columns for the 'Customer inactive' and 'Customer refers friend' events

3.0.36

(2021-08-20)

Fixed

  • Tier calculations do not include rewards discount
  • Tiers weren't updated for all the customer groups in the store
  • Guest customer is redirected to 404 when press 'Refer Friend' button

Improvements

  • Compatibility with M 2.4.3
  • Added console command to clear rewards purchase table

3.0.35

(2021-07-29)

Fixed

  • Shipping discount applies twice in the invoice

Improvements

  • Added Referral Lending page widget
  • Added Bss_OneStepCheckout compatibility
  • Added new api endpoint getFriendsList
  • Added image to the referral invitation email template

3.0.34

(2021-06-11)

Fixed

  • Removed parameter from API endpoint addReferral
  • Number of points wasn't displayed in Earning rule grig in admin

Improvements

  • Added Refer Friend widget
  • Added endpoint sendReferralMessage

3.0.33

(2021-06-11)

Fixed

  • Added metatitle for the rewards/account page
  • Beginner tier customer attribute is not set so not visible in the customers grid in the admin panel
  • Points are not updated on the product page for configurable product with dropdown options

Improvements

  • Stripe Payment compatibility
  • Added option for the Rewards menu displaying for the separate customer groups

3.0.32

(2021-05-12)

Fixed

  • The setting 'Include discount for Earning rules' did not work properly for 'Apply to totals' calculation method
  • Call to a member function setChildren() on boolean in RewardsCatalog/Plugin/Product/Type/Configurable.php on product page on frontend if the product is out of stock
  • Trying to access array offset on value of type null in EarnPointsStr.php in admin if the rule has empty data
  • Wrong totals in creditMamo for the 'items calculation method'
  • Email variable customer.name didn't work
  • Added multiple index for order_ir in mst_rewards_purchase table to avoid RewardsApi performance issue

Improvements

  • Added console command and cronjob to refresh report statistic from CLI and by cron
  • Compatibility with "Bolt payment gateway integration" v2.21.0

3.0.31

(2021-04-21)

Fixed

  • Call to a member function getAllIds() on null for the Behavior rules with conditions for categories when place order with paypal and add tracking number in shipping as admin
  • Unsupported symbols for the grid notification popup in m24
  • Changed description of the 'Earn maximum' field in Earning rule
  • Failed to parse time string when saving Spending rule for the different locales in admin

3.0.30

(2021-03-30)

Fixed

  • Performance issue on Cart and Checkout due to indexes of the mst_rewards_purcase table

3.0.29

(2021-03-26)

Fixed

  • Styles of social buttons on the account page
  • Points are not calculated for the customizable options of the product
  • Call to undefined method getRequest for custom controllers

Improvements

  • Added Rewards Logo on the frontend

3.0.28

(2021-03-10)

Fixed

  • Unique constraint violation found when cancel order in the backend

3.0.27

(2021-02-17)

Fixed

  • Unable to spend points in the cart/checkout due to order cancellation during payment for some payment methods

3.0.26

(2021-02-02)

Fixed

  • Compatibility with Klarna Checkout v9.1.5
  • Issue when on the twitter popup url is displayed in unicode

3.0.25

(2021-01-25)

Fixed

  • Added tier name to export.csv for export customer grid

3.0.24

(2020-12-30)

Improvements

  • Compatibility with Klarna Checkout v9.1.5

Fixed

  • Points earned in the admin if customer reassigned to the group that is not in the earning rule
  • For METHOD_ITEMS 'SpendMaxPoints' includes shipping amount if 'Allow to spend points for shipping charges' is disabled in the module settings

3.0.23

(2020-12-28)

Improvements

  • Compatibility with klarna/module-core:5.2.4

Fixed

  • Unexpected Return Statement in update_payment_method.js
  • Shipping method dissapears on the backend create order page if this method is enabled on the current website but disabled on the Main website in Sales->Shipping

3.0.22

(2020-11-25)

Fixed

  • Mobile styles for referral section in customer account
  • Earning of reward points for referrals ignore settings "Approve earned points if order has status" and "Approve earned points on invoice"
  • Fixed translation for the phrase 'Checkout now and earn' in cart
  • Issue when the Rewards extension reset selected addresses for multi shipping
  • Added event Prefix to the Transaction Model
  • Earning points calculated with tax for non-tax addresses
  • Shipping address is rewritten to billing in the checkout
  • In Porto theme Rewards link is displayed with the number of earned points for the non-loggedin customer
  • Wrong calculation totals Shipping tax for Credit Memo

3.0.21

(2020-10-22)

Fixed

  • Issue when earning points notification is shown on empty cart
  • Error "Cannot apply Reward Points. The shipping address is missing
  • Error in catrt "The shipping method is missing. Select the shipping method"

Improvements

  • Added support for composer 2

3.0.20

(2020-10-10)

Fixed

  • Fixed issue when earning points notification is shown on empty cart page
  • Added description for Transaction inactive Email notification
  • Fixed issue when 'Use maximum' checkbox in cart couldn't be unchecked
  • Call to undefined method Rewards\Service\ShippingService::getBas
  • Undefined variable when apply pointseRewardsShippingPrice()

3.0.19

(2020-10-02)

Fixed

  • Points displaying for the default selected Bundle product
  • Error "Call to a member function getEntityId() on null in Rewards/Model/Earning/Rule/Condition/Customer.php"
  • Compatibility with Mageplaza_CurrencyFormatter
  • Removed cache tags from Rewards Transaction model
  • Facebook connect id to avoid csp_whitelist blocking due to identical FB IDs(cause FB is not define)
  • Reward Points discount does not remove from the totals after cancelation in the backend order

3.0.18

(2020-09-07)

Fixed

  • Time of expiration email sending

3.0.17

(2020-08-31)

Fixed

  • Compatibility with Aheadworks_AdvancedReviews module
  • JS error when editing rule conditions/actions
  • An incorrect points number in the cart and the checkout rewards message

3.0.16

(2020-08-26)

Improvements

  • Added option "Spending Discount calculating method"
  • Added ability to track referral guest orders + API endpoint V1/rewards/referral/addGuestReferral

Fixed

  • Compatibility with AfterPay Payment
  • Order is not bound to the customer who registered during OnepageAmastyCheckout

3.0.15

(2020-08-04)

Improvements

  • Added option "Spending Discount calculating method"
  • Support of Magento 2.4

Fixed

  • Displaying of the refunded rewards amount in credit memo
  • Compatibility with AfterPay Payment
  • Updated migration section
  • Displaying of earning points for guest customer

3.0.14

(2020-06-03)

Fixed

  • Compatibility with WebShopApps_MatrixRate (Error "infinite loop detected")
  • Compatibility with MageWorx_StoreLocator (Error "infinite loop detected")
  • Earning rule's condition "Coupon Used" when some points were spent

Improvements

  • Added option "Apply Spending Points Discount After Tax"
  • Added validation for tier fields in Earning rules

3.0.13

(2020-05-27)

Fixed

  • Limited Klarna Checkout version (7.0.0)
  • Points calculations for "Apply Customer Tax = After Discount" and "Include tax for Spending rules = true"
  • Error "Class Mirasvit\Rewards\Model\Api\ProductPoints does not exist"

3.0.11

(2020-05-19)

Fixed

  • Compatibility with Aheadgroups_Ordereditor
  • Call to undefined method Mirasvit\Rewards\Helper\Behavior::processRule() in RewardsBehavior/Observer/EarnOnPushNotificationSignup.php
  • Invalid argument supplied for foreach() in vendor/magento/module-sales-rule/Model/Rule/Condition/Product/Found.php

3.0.10

(2020-05-16)

Fixed

  • Wrong calculation of earn points for bundle products with coupon discount
  • API endpoint "/V1/rewards/products/points/get"

3.0.9

(2020-05-08)

Fixed

  • Display of points for ajax loaded blocks
  • Error "Object of class Region could not be converted to string"
  • Issue when coupon discount display in the rewards totals
  • Validation of actions in the cart rules
  • Points calculations when options "Allow to spend points for shipping charges" and "Include tax for Spending rules" are disabled

3.0.8

(2020-05-01)

Fixed

  • Notice: A non well formed numeric value encountered in Mirasvit/Rewards/Helper/Balance/SpendCartRange.php
  • Error "PayPal gateway has rejected request. The totals of the cart item amounts do not match order amounts" for multi currency cart
  • An issue when orders in status "Processing" do not include in the tier progress
  • Compatibility with Rokanthemes_OpCheckout
  • Compatibility with Magento 2.3.5

3.0.7

(2020-04-10)

Fixed

  • Made customer attribute "rewards_subscription" optional

Improvements

  • Added referral api endpoints:
    • added API endpoint /V1/rewards/mine/referalCode
    • added API endpoint /V1/rewards/mine/addReferral

3.0.6

(2020-04-03)

Fixed

  • Issue when customer conditions of earning rules break product page
  • Compatibility with Amasty One Step Checkout v2.10.1
  • Error "Something went wrong: Please check the shipping address information ..." when the Infomodus_Upsap extension enbled
  • Points calculations for modules that reset quote grand total
  • Display of earning points on product page when "Customer Earning Style" = "Give X points for every Z quantity"

3.0.5

(2020-03-24)

Fixed

  • Action validation for earning rules when "Customer Earning Style" = "Give X points to customer"

3.0.4

(2020-03-19)

Fixed

  • Error "Exception #0 (Exception): Warning: Division by zero in vendor/mirasvit/module-rewards/src/Rewards/Model/Total/Creditmemo/Discount.php"

3.0.3

(2020-03-13)

Fixed

  • Error 404 for rewards css file when option "Force to apply styles" is enabled
  • Compatibility with the Customweb_DocDataCw extension
  • Issue "Reward points do not apply during order creation in admin"
  • Earning rules validation for Rewards product block

3.0.2

(2020-03-03)

Fixed

  • Error during import "Please enter a correct entity model"
  • Duplicating of the export "CSV" button in the transaction table
  • Error "Class RewardsDiscount does not exist" when use points with Klarna Payment
  • Fatal error: Uncaught TypeError: strlen() expects parameter 1 to be string, object given in vendor/magento/module-sales-rule/Model/Quote/Address/Total/ShippingDiscount.php"
  • Update of shipping methods when "Minimum Order Amount" is set for Free shipping method
  • Fixed "Notice: Undefined variable: purchase" for soap searchCriteria salesOrderRepositoryV1

3.0.0

(2020-02-12)

Fixed

  • JS errors on guest checkout
  • Change points calculations when enabled "Minimum Order Amount"
  • Rewards balance amount value during customer export

Improvements

  • Code refactoring. Divided the Rewards module to several submodules.
  • Removed earning product rules.
  • Added customer conditions to the spending rules

2.3.46

(2020-01-16)

Fixed

  • Payment method selection was lost after totals' reloading
  • Date saving for different locales
  • Display of points for out of stock products
  • Display od decimal points for the backend earning rules

2.3.45

(2020-01-02)

Fixed

  • Condition "Special Price"
  • Display of reward points for product's options

Improvements

  • Moved rewards social block above product image in the mobile view

2.3.43

(2019-11-28)

Fixed

  • Earning points calculations

2.3.42

(2019-11-26)

Fixed

  • Earning points calculations

2.3.41

(2019-11-22)

Improvements

  • Added ability to display cart rule's points on product page

2.3.40

(2019-11-22)

Fixed

  • Points calculations for shipping and tax applied after discount

2.3.39

(2019-11-20)

Improvements

  • Compatibility with Bambora Online v1.3.1

2.3.38

(2019-11-13)

Fixed

  • Formatting of earned points in credit memo
  • Points update for api requests

2.3.37

(2019-11-12)

Fixed

  • Added customer validation for get balance endpoint
  • Remove requirements for searchCriteria in API endpoints
  • Getting of min shipping amount for different websites

Improvements

  • Added rewards balance to the customer grid

2.3.36

(2019-11-08)

Fixed

  • Calculations for Credit Memo when Adjustment Fee wa used

2.3.35

(2019-10-31)

Fixed

  • Saving reward totals in Checkout sort totals order config for m2.3.3
  • Rewards form does not show in the backend order creation form
  • Points calculations on payment update event

Improvements

  • Added new APIs for tiers, spending and earning rules

2.3.34

(2019-10-21)

Fixed

  • Rewards calculations for creditmemo without returned shipping

2.3.33

(2019-10-15)

Fixed

  • Error "Invalid Method Mirasvit\Rewards\Block\Buttons::isOneActive" since 2.3.32

2.3.32

(2019-10-11)

Fixed

  • Points calculations for option "Allow to display product points as currency equivalent"
  • Deleted Google+ event from behavior rules
  • "Minimum Order Amount" for free shipping method when reward points were used
  • Validation for the field 'For each spent X points'

2.3.31

(2019-09-30)

Fixed

  • Update of earn points in earning message on cart page
  • Displaying of active dates

2.3.30

(2019-09-28)

Fixed

  • Earning points for zero total order

2.3.29

(2019-09-27)

Fixed

  • Error "Exception #0 (Exception): Field order_earn not exists in table mst_rewards_points_aggregated_hour"
  • Points for newsletter subscription for mailchimp/mc-magento2
  • Points calculations for "Include discount for Earning rules"
  • Rounding points up

2.3.28

(2019-09-24)

Fixed

  • Points calculations for Catalog Prices - Including Tax, Apply Customer Tax - After Discount
  • Uncaught Error: Call to a member func on boolean in AddVarsToEmail.php for invoice mail
  • Points calculations for partial creditmemo

Improvements

  • Added "Order Subtotal" condition to behavior earning rules

2.3.27

(2019-09-13)

Fixed

  • Tier error during shpping creation

2.3.26

(2019-09-12)

Fixed

  • Error "Field order_earn not exists in table mst_rewards_points_aggregated_hour" since 2.3.35

2.3.25

(2019-09-12)

Fixed

  • Points displaying for out-of-stock products
  • Points information for partial creditmemo
  • Reports

2.3.24

(2019-09-04)

Fixed

  • Compatibility with MageWorx DeliveryDate extension
  • Incorrect points discount when PayPal payment method was used

Improvements

  • Added searchCriteria to transaction API
  • Added ability to give points for RMA

2.3.23

(2019-08-15)

Fixed

  • Country condition for earning rules
  • Translation for expiration date
  • Display points for tier prices on product page
  • Issue when rewards form does not show in cart/checkout

2.3.22

(2019-08-07)

Fixed

  • Compatibility with Amasty_ShippingTableRates
  • Added condition "Additional Payment Method" to earning cart rules
  • Prevent update of purchase data after order was created
  • Error "Call to a member function getId() on array in Rewards/Model/Cron/Tier.php"
  • Issue when total's spend row hides on cart update
  • Active From/To fields saving for all rules
  • Error "ReferenceError: rewardsCurrentUrl is not defined"

Improvements

  • "activate transaction" cron task

2.3.21

(2019-07-18)

Fixed

  • Possible division by zero
  • Points not loading on catalog page if redis enabled
  • Translation for product page

2.3.20

(2019-07-12)

Fixed

  • Compatibility with extension Bss OrderAmount
  • Calculation for fixed amount steps of earning rules
  • Call to a member func on bool on the product page when Amasty_CommonRules is enabled

Improvements

  • Display of product points using ajax

2.3.19

(2019-06-25)

Fixed

  • Issue when Klarna payment method disappears after points were applied
  • Issue when unnecessary
    added to behavior notification emails
  • Behavior rule condition "Is Referral"

2.3.18

(2019-06-14)

Fixed

  • Issue for Magento EE v2.2.5 when rewards discount is reset on place order (apply customer tax before discount)

2.3.17

(2019-06-12)

Fixed

  • Points amount on product page for tier price
  • Earn points do not display in checkout if spend points is not allowed
  • Condition "Discount Used" in spending rules

Improvements

  • Compatibility with Klarna Checkout

2.3.16

(2019-05-31)

Fixed

  • Points discount for "tax applied after discount"
  • Facebook Like button loading for m 2.3.1 and remove private content for social buttons

2.3.15

(2019-05-27)

Fixed

  • Points rounding on product page
  • Values of condition "Payment Method" for earning rule

2.3.14

(2019-05-24)

Fixed

  • Points rounding on product page
  • Points name on customer order view page

Improvements

  • Added {{order_increment_id}} to earning rule history message

2.3.13

(2019-05-20)

Fixed

  • Compatibility with Amasty Shipping Rates
  • Applying of reward points by "enter" button in checkout

2.3.12

(2019-05-15)

Improvements

  • Compatibility with Klarna extension v6.1.0, Klarna Core v5.1.0
  • Display format of earned points in backend on order view page

Fixed

  • "Minimum Order Amount" does not consider Rewards discount
  • Display of rewards discount for multi currency stores
  • Issue when messages on product page hide very fast

2.3.11

(2019-05-03)

Improvements

  • Added ability to delay usage of rewards points
  • Improve tier update cron job

2.3.10

(2019-04-23)

Fixed

  • Allow to use percent in monetary step of spending rule

2.3.9

(2019-04-19)

Fixed

  • Remove rewards expiring notification subscription from Newsletter Subscription page (left only on My Reward Points > History page)

2.3.8

(2019-04-17)

Fixed

  • Label "Rewards Discount" overrides coupon discount label in cart
  • Points does not applies to Grand Total if tax does not include in spending rules

2.3.7

(2019-04-10)

Fixed

  • Display of tier progress bar for rtl theme
  • Compatibility with m 2.3.1
  • Display Rewards discount in backend order creation form

2.3.6

(2019-03-27)

Fixed

  • Points calculations for min/max price of bundle product
  • Issue when condition "Number of reviews" includes pending reviews
  • Spend maximum calculates incorrect
  • Remove unnecessary rewards calculations

2.3.5

(2019-03-21)

Fixed

  • Compatibility with Magecomp_Surcharge
  • Added Rewards discount to "Checkout Totals Sort Order"
  • Display of Rewards discount in backend print pdf

2.3.4

(2019-03-19)

Fixed

  • Display of rewards discount in backend and emails
  • Rewards information for SOAP API order request

2.3.3

(2019-03-15)

Fixed

  • Display of rewards discount for order

2.3.2

(2019-03-14)

Fixed

  • Translation for the date range in transaction table
  • Compatibility with Aheadworks_OneStepCheckout

Improvements

  • Added new api:
  • /V1/rewards/products/points/get
  • /V1/rewards/products/points/multiplicity

2.3.1

(2019-03-12)

Fixed

  • Rewards discount does not includes in Paypal total
  • error "Notice: Undefined index: int NOT NULL DEFAULT 0" for Magento 2.3.x
  • Js error "Mirasvit_Rewards/js/product/view.min.js net::ERR_ABORTED 404 (Not Found)" on backend order creation page

2.3.0

(2019-03-07)

Fixed

  • Issue when rule save wrong data if message starts from variable
  • Condition "Coupon used is no" does not work in spending rules
  • Js error on product page for custom product types
  • Points calculations on paypal preview checkout

Improvements

  • Moved rewards discount to totals
  • Compatibility with AwStoreCredit and AmastyGift extension
  • Compatibility with Magecomp Paymentfee v1.0.5
  • Added new api:
    • V1/rewards/product/points

2.2.34

(2019-02-07)

Fixed

  • Points calculations for bundle product with special price
  • Fixed points calculations for bundle product with special price
  • Added new api:
    • V1/rewards/:cartId/apply/:pointAmount

Improvements

  • Added ability to save "Logo" of Tier per storeview
  • Added ability to save "Front Name" of Spending Rule per storeview

2.2.33

(2019-02-06)

Fixed

  • Disable coupon show success message after applying
  • Bundle description does not update when no product rule
  • Compatibility with Amasty Free Gift
  • Product amount in minicart does not update correctly
  • Added new api:
    • V1/rewards/transactions
    • V1/rewards/purchase/:orderId
    • V1/rewards/balances
    • V1/rewards/balances/:customerId
    • V1/rewards/mine/purchase/:orderId

2.2.32

(2019-01-23)

Fixed

  • Update Facebook Like script

2.2.30

(2019-01-22)

Fixed

  • Encoding in field min/max for spending rule(percent amount applies as a number)
  • Validation of min/max for spending rule

2.2.29

(2018-12-26)

Fixed

  • Error when session stores in Redis and rewards notification returns error message
  • Points calculations for earning rule 100:100
  • Tier points calculates incorrect on Magento 2.2.7
  • Compatibility with Reward Points, Magecomp Surcharge and Aheadworks Store Credit

Improvements

  • Added ability to upload logo to tier
  • Moved rewards shipping discount from item to address shipping discount

2.2.28

(2018-12-12)

Fixed

  • Error on cart page "Cannot read property 'replace' of undefined"
  • Compilation error on Magento 2.1.x
  • Images in tier description

2.2.27

(2018-12-10)

Fixed

  • Customer created from checkout get points(Product Rule) for order
  • Points calculations for tax based on "Unit Price"
  • Reward notification display wrong amount of earned points
  • Related products on product page have the same amount of points as main product
  • Issue when points do not show for product with price less $1 and qty more then 1
  • HTML tags in earning message on cart page

Improvements

  • Added translation for earning rule "Display Name"

2.2.26

(2018-12-04)

Fixed

  • Some minicarts do not update products amount when product was removed from cart page
  • Wrong number of referrals on account page
  • Missing earning rule conditions
  • Compatibility with Reward Points, Magecomp Surcharge and Aheadworks Store Credit
  • Issue when Cart rule condition "Total Items Quantity" does not work
  • Unable to export customer grid with tiers

2.2.25

(2018-11-29)

Fixed

  • Issue when tier calculation process includes spend points
  • Compatibility with Magento 2.3.0

2.2.24

(2018-11-27)

Fixed

  • Unable to use "Zero Subtotal Checkout" with Reward Points(started from 2.2.20 version)
  • Earned points do not cancel on order cancellation
  • Email translation variables
  • Issue "tier submenu Delete does not work"
  • Issue when reward points do not calculate correct for configurable product options with minimum qty greater then 1
  • Issue when points do not change on catalog page for different options

Improvements

  • Added ability to translate product rule notification

2.2.23

(2018-11-22)

Fixed

  • Issue when rewards discount does not apply to totals
  • Issue with the incorrect points calculating for the configurable product options on the catalog page

2.2.22

(2018-11-21)

Fixed

  • Points calculations on product page when tier and special prices are set
  • Points calculations on product page when catalog price rule price displays

2.2.21

(2018-11-19)

Fixed

  • Tier update events triggered only for the first update
  • Points calculation on product page after update qty amount
  • Fixed error "Exception message: Notice: Undefined index: 1.0000" during customer registration

Improvements

  • Compatibility with MageComp Surcharge
  • Compatibility with Aheadwords Store Credit

2.2.20

(2018-11-13)

Fixed

  • Notice: Undefined offset ... Rewards/Observer/BundlePriceConfig.php
  • Compatibility with Faonni_Price
  • Unnecessary loading of Facebook script on product page
  • Incorrect transaction amount for expiration emails.
  • Wrong amount of points for product tier price on product page
  • Option "based on sum of spend $" does not take into consideration value of option "take into account only last"

Improvements

  • Added calculation options for tier upgrade process based on spend amount of $
  • Compatibility with Amasty Gift Cart. Wrong max allowed points.
  • Added events to behavior rule: "Customer tier up" and "Customer tier down"

2.2.19

(2018-10-30)

Fixed

  • Compatibility with Faonni_Price extension
  • Error "fjs does not exist"
  • Tax calculation for bundle products

Improvements

  • API. Added "created_at" field to transactions response
  • API. Added min/max points information to totals info

2.2.18

(2018-10-29)

Fixed

  • Points calculation when rule limited with maximum
  • Added option "Show social Button block on category page"
  • Fatal error for out of stock configurable products

2.2.17

(2018-10-26)

Fixed

  • Compatibility with some 3rd party extensions, mini-cart is not updated with main cart
  • API. Added rewards information to totals

2.2.16

(2018-10-25)

Fixed

  • Points calculations for webapi
  • Calculation points for simple product's options

2.2.15

(2018-10-23)

Fixed

  • Points calculations on product page for advanced prices
  • "Application ID" does not display after save

Improvements

  • Added new API:
    • GET /V1/rewards/mine/balance
    • GET /V1/rewards/mine/transactions
    • POST /V1/rewards/mine/apply

2.2.14

(2018-10-17)

Fixed

  • Rounding for Earning points

2.2.13

(2018-10-12)

Fixed

  • ReferenceError: rewardsFacebookApiVersion is not defined
  • "Subtotal" condition in rules
  • Points calculation for multi currency store for bundle and configurable products
  • Fixed earning points calculations for option "Apply Customer Tax"
  • Amasty Shipping Rates do not show in backed during order creation
  • Error "Missing argument 1 for Mirasvit\Rewards\Model\Spending\Rule::getSpendPoints()"
  • Tier description and emails for storeview
  • Tier description for storeview

2.2.11

(2018-09-26)

Improvements

  • Added ability to switch between tiers based on sum of spent $
  • Added option "After login to account redirect a customer to My Reward Points section"
  • Added validation for block modifications
  • Added condition "payment method" to 2.2.6(Magento removed it from conditions)

Fixed

  • Points on product page displays according to current currency instead of base currency

2.2.10

(2018-09-11)

Fixed

  • Installation
  • Styles for option "Force to apply styles"
  • Compatibility with Ebizmarts_SagePaySuite
  • Error "Call to a member function getID() on null in Service/Customer/Tier.php:169"

2.2.9

(2018-08-31)

Fixed

  • Fatal error: Uncaught Error: Cannot instantiate interface Mirasvit\Rewards\Api\Repository\TierRepositoryInterface ..."

2.2.8

(2018-08-29)

Fixed

  • Newsletter unsubscribe does not deduct points
  • Displaying of Share and Referral tabs in account

Improvements

  • Added social buttons on category page

2.2.6

(2018-08-28)

Fixed

  • Sending multiple emails using the TransportBuilder class causes an Zend_Mail exception
  • Update FB API version to 3.1
  • Points spending style "Fixed"
  • Points calculations when earn points approved on status "Pending" and spend points less then "For each spent X points"
  • Actions of Cart Rules

Improvements

  • Added FB API version number to config
  • Added "All Groups" to rule settings

2.2.5

(2018-08-17)

Fixed

  • Displaying of Rule's history message for multiple store view

2.2.4

(2018-08-16)

Fixed

  • Ability to save history and email messages for Behavior Rules for store view
  • Product review message
  • Social buttons
  • Backend create order error - "Warning: Division by zero"
  • Tax excluded twice on product page

2.2.3

(2018-08-08)

Fixed

  • Issue with newsletter subscription by cron tier

2.2.2

(2018-08-01)

Fixed

  • Compilation error
  • Customer attribute "Rewards Tier" is required

2.2.0

(2018-07-31)

Feature

  • Tiers

Fixed

  • Issue when "Minimum Order Amount" was ignoring
  • Issue when rule "Display Name" showing for all groups

2.1.34

(2018-07-20)

Fixed

  • Added points for the order when customer created an account at the end of checkout

2.1.33

(2018-07-09)

Fixed

  • Displaying points for bundle product
  • Guest address is not saving in checkout

2.1.32

(2018-07-03)

Fixed

  • Points calculations for Newsletter Subscription
  • Points for tier price on product page
  • Compatibility with other Twitter plugins

2.1.31

(2018-06-07)

Fixed

  • Product page error "Uncaught SyntaxError: Unexpected end of JSON input"
  • Expiration email sending
  • Points calculations for multi currency stores

2.1.30

(2018-05-18)

Improvements

  • Added api for transactions

2.1.29

(2018-05-04)

Fixed

  • Cached social block does not display "Pin it" button
  • Compatibility with Aheadworks_OneStepCheckout
  • Referral link for stores in subfolder

Improvements

  • Added option that allows to display pending rewards transactions
  • Added Prices to product rule
  • Added "Lifetime Spent Points" condition to behavior rules

2.1.28

(2018-04-26)

Fixed

  • Compilation error

2.1.27

(2018-04-25)

Fixed

  • Date filter does not work in transaction grid
  • Unable to add points in backend to several customers
  • Call to a member function getEntityId() on null

2.1.26

(2018-04-13)

Fixed

  • Issue when inactive pariod does not save
  • Error with message "There is no information about associated entity type "customer_group""
  • Color does not change on product page
  • Unnecessary calculations for bundle products

Improvements

  • Added option that adds Rewards style to pages if theme ignore it

2.1.25

(2018-04-03)

Fixed

  • Behavior rules with order conditions

2.1.24

(2018-03-16)

Fixed

  • Calculation of minimum points
  • Calculation of earning points for virtual cart
  • Calculation of spending points for option "Include tax for Spending rules"
  • Compatibility with Swissup Firecheckout

2.1.23

(2018-03-16)

Fixed

  • Report Plugin

2.1.22

(2018-03-12)

Fixed

  • Uncaught TypeError: Argument 1 passed to Magento\Quote\Model\Cart\Totals::setExtensionAttributes() must be an instance of Magento\Quote\Api\Data\TotalsExtensionInterface, instance of ...

2.1.21

(2018-03-07)

Fixed

  • Miltiorders for one cart

2.1.20

(2018-03-07)

Fixed

  • Fixed issue with incorrect email sender in multistore configuration

2.1.19

(2018-03-06)

Fixed

  • DI Compile (reports module)

2.1.18

(2018-03-05)

Improvements

  • Allow to earn points for joining affiliate program (Mirasvit_Affiliate)

2.1.17

(2018-03-01)

Fixed

  • Miltiorders for one cart
  • Compatibility with Taxjar SalesTax module
  • Points are not assigned by "sign up" rule for Magento 2.2.2

2.1.16

(2018-02-20)

Fixed

  • Fix error during setup:di:compile

2.1.15

(2018-02-19)

Fixed

  • Incorrect calculation of base discount (Grand Total (Base) and Grand Total (Purchased) are different)
  • Add customer conditions to cart and product earning rules

2.1.14

(2018-02-09)

Fixed

  • issue with wrong report version requirement

2.1.11

(2018-02-09)

Fixed

  • Error "Cannot read property 'sectionLoadUrl' of undefined" that appear on slow connection in checkout
  • Compatibility with Amasty checkout
  • Error "The requested Payment Method is not available" for checkout with Grand Total equal to zero
  • Fixed magento 2.2.2 issue 'Argument 1 passed to Magento\Quote\Model\Cart\Totals::setExtensionAttributes() must be an instance of Magento\Quote\Api\Data\TotalsExtensionInterface, instance of Magento\Quote\Api\Data\AddressExtension given'
  • Added a formkey and max number of allowed invites to referal invitaion form

2.1.10

(2018-01-31)

Fixed

  • Points are not calculating correctly when changing shipping in cart

2.1.9

(2018-01-23)

Fixed

  • In some cases, incorrect reward points discount calculation. Module rounds discount amount to integer and does not allow to have a fractional discount amount. Affects versions from 2.1.6.
  • Registration rule is triggered on customer saving. If customer was created before registration rule and customer does not have transaction for this rule he takes points for registration rule on reset password
  • In some cases Twitter returns "Connection timed out"

2.1.8

(2018-01-05)

Fixed

  • Issue when rewards section was updated twice

2.1.6

(2017-12-27)

Fixed

  • Social buttons on the account page were incorrectly displayed
  • In some cases, when coupon and points were used at the same time, order total was negative

Improvements

  • Integration with Plumrocket SocialLoginPro

2.1.5

(2017-12-20)

Fixed

  • Fixed an issue with slow category page load time. If a category page has a lot of configurable products with many sub-products, it took a long time to load the page.

2.1.4

(2017-12-19)

Fixed

  • In Magento 2.2.2, if customer attempts to register, he sees the error "PHP Fatal error: Uncaught Error: Call to a member function getId() on null in .../app/code/Mirasvit/Rewards/Observer/BehaviorCustomerRegisterSuccess.php:64"

2.1.2

(2017-11-30)

Improvements

  • Compatibility with Magento 2.2.1

2.1.1

(2017-11-28)

Improvements

  • Compatibility with Aheadworks onepagecheckout

2.1.0

(2017-11-20)

Fixed

  • Points calculation on the bundle product page
  • Code improvements
  • Translation

2.0.18

(2017-11-15)

Fixed

  • Transaction grid
  • Earning points for sign up events
  • Styles for social buttons

2.0.17

(2017-11-02)

Fixed

  • Issue with bundled price observer

2.0.16

(2017-10-25)

Improvements

  • Added Base Price, Final Price and Special Price to spending rules
  • Added condition "Discount Used" to spending rules

Fixed

  • Rules assigning to website

2.0.15

(2017-10-18)

Improvements

  • Added referral group to behavior rule condition for event "Customer signs up in store"

Fixed

  • Rules assigning to websites

2.0.14

(2017-10-13)

Fixed

  • Fixed twitter url
  • Translation

2.0.12

(2017-10-10)

Improvements

  • Social button

2.0.11

(2017-10-09)

Fixed

  • Date validation
  • Points for "Not Visible Individually" products
  • Tax calculation
  • Acl for "Transaction"

2.0.10

(2017-09-28)

Improvements

  • Magento 2.2 Compatibility Fix
  • Allowed to change Customer's Group on Behaviour Rule triggering
  • Added Is Referee condition to Behaviour Rule
  • Improved documentation

2.0.9

(2017-09-25)

Improvements

  • Added earning rule of behavior type for subscription on push notification

Fixed

  • Fixed an issue with actions rule

2.0.8

(2017-09-21)

Fixed

  • Bugs

2.0.7

(2017-09-19)

Improvements

  • Rewritten documentation

2.0.6

(2017-09-18)

Improvements

  • Added conditions "Coupon Used" and "Coupon Code" to Spending Rule and Cart Earning Rule

Fixed

  • Solved XSS issue
  • Reward Points for Shipping Tax

2.0.5

(2017-09-11)

Fixed

  • Single spending rule with payment method
  • Compatibility with Magento 2.2.0rc

2.0.4

(2017-09-06)

Fixed

  • Points displaying on product page

2.0.3

(2017-08-31)

Fixed

  • "Customer signs up in store" for checkout
  • Points for orders mass actions
  • Rule saving for multistore
  • Fixed loading of unnecessary social scripts

2.0.2

(2017-08-21)

Fixed

  • Fixed referral sender for multistore

2.0.1

(2017-08-18)

Fixed

  • Notification rule saving

2.0.0

(2017-08-16)

Improvements

  • Refactoring

1.1.49

(2017-08-16)

Final version for Magento 2.0.x


1.1.46

(2017-08-03)

Fixed

  • Referral sign up event

1.1.45

(2017-07-21)

Fixed

  • Updating of Reward points on product view page

1.1.44

(2017-07-18)

Fixed

  • Behavior rules event "Customer signs up in store"
  • Translation

1.1.43

(2017-07-12)

Fixed

  • Different issues with Behavior Rules

Improvements

  • Added option that allows to include/exclude discount from Earning rules
  • Added rewards variables (getRewardsEarnedPoints(), getRewardsSpentPoints(), getRewardsSpentAmount()) to email templates of order, invoice, creditmemo

1.1.42

(2017-06-30)

Fixed

  • Different issues with Earning Rules

1.1.40

(2017-06-26)

Fixed

  • Calculation of points for Spending Rules with "Spend minimum"

1.1.37

(2017-06-14)

Fixed

  • Prevent errors during refresh statistic

1.1.36

(2017-06-13)

Fixed

  • Rule conditions

1.1.35

(2017-06-12)

Fixed

  • Displaying of Reward points for grouped products

Improvements

  • Displaying of spending points in order in backend

1.1.34

(2017-06-07)

Fixed

  • Rule conditions
  • Points cancelation in backend order
  • Translation for transaction's auto comments.

Improvements

  • Added option that allows to control how to round earning points

1.1.33

(2017-05-25)

Fixed

  • Calculation of used points
  • Compatibility with Mageplaza one step checkout
  • Calculation of Earning Product Rule for discount

Improvements

  • Added option that allows to display the highest possible amount of points for configurable product

1.1.32

(2017-05-06)

Fixed

  • Composer php

1.1.31

(2017-05-03)

Fixed

  • Default value for "Subscription to Points Expiring Notification"

1.1.30

(2017-04-18)

Improvements

  • Added ability to unsbcribe from points expiring notification
  • Added "Points spending style" option to Spending Rule
  • Allow to use percent in "Customer receive Y discount" field in spending rule

1.1.29

(2017-04-06)

Improvements

  • Compatibility with PSP MultiSafepay

Fixed

  • "Sign Up for Newsletter" rule for guest

1.1.28

(2017-03-17)

Fixed

  • Multi store support for email templates

1.1.27

(2017-03-09)

Fixed

  • Reports

1.1.25

(2017-03-06)

Improvements

  • Reports

1.1.24

(2017-02-20)

Fixed

  • Moved "Display options" settings from global to store view settings
  • Renamed option "Show rewards points on frontend" to "Show rewards points on category page"
  • Added option "Show rewards points menu on frontend"
  • Fixed share messages

1.1.23

(2017-02-10)

Features

  • Added Facebook share button
  • Added option to hide rewards menu from frontend
  • Added new condition "Is Rewards Points used" to earning cart rule
  • Added abitily to import/export rewards transactions
  • Added options to configure include/exclude tax for Earning and Spending rules
  • Added ability to add notification to product earning rule

Fixed

  • Socail urls for multistores
  • Category condition's operator "is" for product rule
  • Replaced old Facebook tag with valid html5 tag
  • SmartWave Porto theme compatibility
  • An issue when "Product's earning points do not display on Home page "
  • UTF characters in "Point Unit Name"
  • "Customer is not active for long time" condition
  • Minicart's total and item number do not update correctly
  • Actions for cart Earning Rules
  • An issue when "Product points as currency equivalent" displays in checkout
  • Points for Payment rule method
  • Compatibility with theme Infortis Ultimo
  • Included Fixed Product Tax in rewards spending points
  • Compatibility with MageCheckout Onestepcheckout v2

1.1.22

(2016-12-05)

Fixed

  • Cart rule condition "Payment method"
  • Wrong calculation for Spending rules' "Spend minimum"

1.1.21

(2016-11-29)

Fixed

  • Displaying of Rewards points for grouped and bundle products

Features

  • Added earning behavior rule event "Customer places an order"
  • Allowed display on Product pages points as money equivalent

1.1.20

(2016-11-18)

Fixed

  • Calculation of Spending rules

1.1.19

(2016-11-08)

Fixed

  • Tables formatting for small screen or cell phone

1.1.18

(2016-11-08)

Features

  • Added Rewards block to admin create order form

Fixed

  • minor bugs

1.1.17

(2016-11-04)

Fixed

  • Minicart total and item number do not update correctly
  • Social js are not loading deferred

1.1.16

(2016-10-24)

Features

  • Added ability to show AddThis buttons in Rewards social block

Fixed

  • trigger_recollect caused infinite loop

1.1.15

(2016-10-13)

Fixed

  • Compatibility with Bss/DeferJS
  • Compatibility with onestepcheckout
  • Earning rule conditions do not display all attributes
  • Magento page cache js error
  • Conflict with Amasty Rules
  • Undefined variable in social buttons block
  • Integration with MageCheckout Onestepcheckout v2

Features

  • Added Rewards block to checkout page
  • Added integration with AddThis
  • Added ability to create custom behavior rules

1.1.14

(2016-09-09)

Fixed

  • Conflict with Amasty Rules

1.1.13

(2016-09-07)

Fixed

  • Conflict with Amasty Rules
  • Issue when js error appears, when social buttons are disabled

1.1.12

(2016-09-05)

Fixed

  • Issue when cart rules with "Fixed Amount Discount for Whole Cart" show error in cart

1.1.11

(2016-08-31)

Improvements

  • Compatibility with 2.1.1

1.1.10

(2016-08-05)

Features

  • Added settings "Show number of points on the product page"

1.1.9

(2016-08-03)

Fixed

  • Issue when reward points are not being deducted after using them through Paypal
  • Issue when earning rule not working for referral

Features

  • Added integration with MageCheckout Onestepcheckout

1.1.8

(2016-07-06)

Features

  • Added integration with MageStore Onestepcheckout

1.1.7

(2016-07-06)

Improvements

  • Added new conditions "Is referral"
  • Added variables for Notification Rule message

1.1.6

(2016-06-24)

Improvements

  • Support of Magento 2.1.0

1.1.5

(2016-06-21)

Fixed

  • Issue during discount coupon codes apply

1.1.4

(2016-06-13)

Features

  • Show message about product rule points for grouped products

1.1.3

(2016-06-08)

Fixed

  • Incorrect points calculation when we remove items from the cart
  • Incorrect URL in spending rules grid (effects from 1.0.13)

1.1.2

(2016-06-02)

Fixed

  • Customer sign up earning rule does not allow save customer in backend
  • If a rule is disabled in Earning Rules/Spending Rules, you have no way to find it back
  • Error when we give points for newsletter subscription

1.1.1

(2016-06-01)

Fixed

  • Styles for reward points on home page

1.1.0

(2016-05-31)

Improvements

  • Show the amount of points able to earn in the product listing page

1.0.13

(2016-05-30)

Improvements

  • Ability to filter grids by website

1.0.12

(2016-05-27)

Improvements

  • Added website column to spending/earning/notification grid

1.0.11

(2016-05-17)

Improvements

  • Improved twitter script loading

1.0.10

(2016-05-10)

Fixed

  • Fixed formatting of referral invitation

1.0.9

(2016-05-06)

Improvements

  • Improved notification rules messages for different currencies

Fixed

  • Fixed "Pin It" button

1.0.8

(2016-04-26)

Fixed

  • Fixed rules conditions issus
  • Fixed currency conversion

1.0.7

(2016-04-11)

Improvements

  • Show current rewards points in my account dropdown

Fixed

  • Issue with menu
  • Fixed issue with saving of rules if magento use custom locale

1.0.6

(2016-04-04)

Improvements

  • Improved referral link

Fixed

  • Fixed issue with rewards for tweets.

1.0.5

(2016-03-28)

Improvements

  • Styles at shopping cart page

1.0.4

(2016-03-24)

Fixed

  • Issue for not working condition "total items quantity"
  • Add protection from devision on zero error
  • JS bug on in the social buttons

1.0.3

(2016-03-21)

Fixed

  • When admin creates a new transaction in backend, he must be required to select a customer
  • Dont show message when 0 points are earned
  • Issue with saving of Conditions in Spending Rules

1.0.2

(2016-03-14)

Fixed

  • Solved issues with notification emails

1.0.1

(2016-03-01)

Fixed

  • Issues with PHP 7