Shopify display Active discount codes on cart page (before checkout)

Shopify display Active discount codes on cart page (before checkout)

enthu
Shopify Partner
1 0 0

I'm trying to display discount codes that have been applied via the URL on the cart page in a Shopify theme prior to checkout.

Example URL would be store.com/discount/DISCOUNTCOUPON

I have verified the discount exists, and if I click on Checkout and proceed to Shopifys built in checkout process then I can see the automatic discount was in fact applied - it just will not display on the cart page. Discount type is a % that applies to entire cart.

I have tried the below snippet as per this guide: https://shopify.dev/themes/pricing-payments/discounts

I am using the Dawn theme also as per the guide. (And applying the code to a section within the cart object).

 

 

 

{% if cart.cart_level_discount_application.size > 0 %}
  Discounts:

  <ul>
    {% for discount_application in cart.cart_level_discount_applications %}
      <li>
        {{ discount_application.title }}-{{ discount_application.total_allocated_amount | money }}
      </li>
    {% endfor %}
  </ul>
{% endif %}

 

 

 

Nothing seems to work to display the discount.

Anybody come across this before and have any ideas why? Also for extra clarification I am not using Shopify Plus however I cant find anywhere that this is a requirement.

Reply 1 (1)

maxvogel
Tourist
6 0 2

I tried to solve this problem by using one of the available discount apps, but it was harder than expected to actually find one that works. Of the 6 apps I tested, only one worked with stacked discounts and free shipping discounts. You can find my detailed review of all of them here: https://appreviewhq.com/shopify-discount-app-review-2024. TLDR: the one app that worked was https://apps.shopify.com/discount-before-checkout