Skip to main content
Available on the Advanced plan and above.
Use this component to display how many points a customer earns for purchasing a particular product.

Explanation

To show the points that are gained for purchasing a particular product, two attributes are needed. The first, data-lion-price-for-product-id, must be added to an element whose text content is the price of the product. The value of this attribute should be equal to the ID of the product. The second attribute, data-lion-points-for-product-id, sets the innerHTML of its element to the computed points value of the matching data-lion-price-for-product-id attribute on the page.
The points shown are worked out the same way as the points for an order of this product at the price on the page, including the customer’s tier, collection exclusions, point modifiers, bonus points and running campaigns. Tax, shipping and discounts entered at checkout aren’t known yet, so they aren’t included.The component knows the product and its price on the page, not which variant the customer picks, whether they subscribe or whether the product is a gift card. Modifiers and bonus points set for one variant or SKU, or for subscriptions, aren’t included. Where your program gives points for spending gift cards rather than buying them, a gift card still shows the points an ordinary product would earn.A customer who isn’t signed in sees the points they’d earn on joining, at your default tier. Campaigns with a minimum spend aren’t included for them, and a change to your rules or campaigns can take up to an hour to show.

Code

Add the below snippet to an element whose text content is the price of the product:
Add this snippet on the product page to compute the points value of the product price:

Example for Shopify

Add data-lion-price-for-product-id to an element containing the price of the product.
Then, insert data-lion-points-for-product-id where you want to show how many points a customer earns for buying this product.