Points for cart

Use this component to display how many points a customer would earn for their entire cart.

Available on the Advanced plan and above.

Explanation

The attribute value should be the total server-side value of the current cart. If you’re using Shopify, you can get this value in Liquid using {{ cart.total_price }}.

Please note that:
  • The points shown by this component only includes points awarded for the purchase rule.

  • It does not factor in collection exclusions, point modifiers or bonus points.

  • The attribute value should be in cents, as the component divides the amount by 100 before applying the purchase rule multiplier. (This applies even for currencies without subunits, this component is not currency aware. If your currency doesn’t have subunits, please multiply amounts by 100.)

Code

Example for Shopify

<!-- points customer will earn for entire cart -->
<span data-lion-points-for="{{ cart.total_price }}"></span>
Please note that the {{ cart.total_price }} value is only set by Shopify on initial render on the server. If you use an ajax cart, or other functionality to dynamically update the DOM, please see the section on Live updating below

Example for custom value

<!-- points customer will earn for spending $125.00 -->
<span data-lion-points-for="12500"></span>

If you have a dynamic cart, a single page app, or otherwise may change the DOM containing loyaltylion UI components without a full page load, you might need to trigger a UI refresh in order for LoyaltyLion elements to refresh upon change.