Skip to main content

Showing Discounted Price on Cart Page for Recurpay Checkout

Sinchain avatar
Written by Sinchain
Updated this week

This article helps developers display the discounted subscription price on the cart page for subscription items that go through Recurpay checkout.

Step-by-step guide to get started:

  1. Navigate to your theme files and open the Recurpay snippet named as "recurpay.liquid"
    ​

  2. Pass the subscription discount percentage into the cart line item properties when the product is added to cart. Recurpay by default adds the data-plan-discount attribute while selecting any of the plans on the storefront. Use that to pass dynamic value of selected discount on cart properties while calling Shopify add.js API.
    ​

  3. On the cart file (cart.liquid), loop cart items object read that property and compute the discounted price on the go via liquid itself. Render the discounted price next to (or instead of) the regular price.
    ​

  4. Save your changes and refresh the cart page to confirm the discounted subscription price appears correctly for each line item and in the subtotal.


Facing any issue with setting this up? Click the green chat button on Recurpay dashboard and we will get it done for you or write us at help@recurpay.com

Did this answer your question?