Display Shopify Discount Codes on Storefront Pages

Figure 1: Shopify Admin: Discount PROMO18 created
Figure 2: The left shopping cart page displays the discount code, the right page doesn’t display the code.

Solution:

JavaScript Snippet:

Chrom DevTools: Show Session Storage values in Application tab.

Access Discount Code from sessionStorage:

I ❤️ Shopify & Next.js. checkout-agency.com, Founder

I ❤️ Shopify & Next.js. checkout-agency.com, Founder