> ## Documentation Index
> Fetch the complete documentation index at: https://developers.loyaltylion.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Free product rewards

On Shopify stores, shoppers can redeem free product rewards. After redemption,
the target product is added to the cart and automatically discounted using a
Shopify Function.

A few things are needed to facilitate this flow through the LoyaltyLion WebView.

<Steps>
  <Step title="Listen for the sdkReady event and set the cart state">
    Listen for the [sdkReady](/sdk/webviews/advanced/webview-js-events#sdkready) event, which is fired when LoyaltyLion has finished loading in the WebView.

    Once you receive this event, you should pass the current Shopify cart state to
    the LoyaltyLion SDK, using the
    [setShopifyCartState](/sdk/webviews/advanced/webview-js-api#setshopifycartstate)
    method
  </Step>

  <Step title="Subscribe to the addCartLine event">
    When a free product reward has been successfully redeemed by the shopper, we'll
    fire the [addCartLine](/sdk/webviews/advanced/webview-js-events#addcartline) event with details of the item you need to add to the cart.
  </Step>

  <Step title="Subscribe to the removeCartLine event">
    Occasionally we'll need to remove a previously added item from the cart, for example
    if the shopper has cancelled the reward.

    We'll fire the [removeCartLine](/sdk/webviews/advanced/webview-js-events#removecartline) event when this happens, passing along the `id` of
    the cart line to remove from the cart.
  </Step>
</Steps>
