Displaying points on the checkout page

Show customers the point that they will earn for their order on the checkout page.

When customers have added products to their cart and are on the checkout page, it is a great idea to them to know that they will earn loyalty rewards points for completing the order. This achieves two objectives - helps improve the conversion rate and also increases awareness about the program.

We have built a Javascript API that takes a set of products and returns the total number of points that will be earned for that set of products.

The Javascript function to be used on product pages is: zrl_mi.get_potential_points(product_array)

Where product array contains the list of products.

Example Code:

zrl_mi.get_potential_points([
     {"product_id" : "product_five", "price": 20, "quantity": "1", "category": "cups"},
     {"product_id" : "product_six", "price": 20.00, "quantity": "3", "category": "butter"}
     ])

The function comes with success and failure handlers. If the product details are captured correctly and the points earning opportunity calculated by Zinrelo, the code to display the points can be written in the success handler.

Sample Code:

zrl_mi.get_potential_points_success_handler = function(){

element = document.getElementById("potential_product_points"); /* div or span by the name potential_product_points should exist at product page */

element.innerText = potential_points; // showing potential points
}
        }

In case of a failure, the code to handle the failure can be written in the failure handler function.

zrl_mi.get_potential_points_failure_handler = function(){
         //Write code to handle the error here.
      }