How to insert discount code into URL so discount is auto-applied to all prices

Topic summary

The discussion centers on automatically applying discount codes via URL and displaying discounted prices throughout a Shopify store, not just at checkout.

Basic URL Method:

  • Standard approach: https://{shop_name}.myshopify.com/discount/{discount_code}
  • Can add redirects: ?redirect=/products/{product} to land on specific pages
  • Shareable links available in Shopify admin under Discounts > Promote

Key Limitations Identified:

  • Discount codes apply at checkout only, not during browsing
  • Cookies get cleared when using redirects, causing mobile/private browsing failures
  • No native Liquid/API method to display discounted prices on product pages
  • Cart page cannot accurately show applied discounts
  • Invalid codes are accepted in URLs but fail silently at checkout

Workarounds Discussed:

  • Custom JavaScript solutions to auto-apply codes (shared by HenryReith)
  • Manual cookie management for Plus customers
  • Third-party apps like Adsgun that display savings across all pages
  • Multiple discount codes now supported via cart permalinks (recent Shopify update)

Current Status:

  • The core request (showing discounted prices while browsing) remains unsolved natively
  • Community frustration noted over Shopify’s years-long lack of comprehensive solution
  • Various workarounds exist but require custom development or apps
Summarized with AI on November 2. AI used: claude-sonnet-4-5-20250929.

Hi Josh,

The discount code is stored in the cookie so you could have variables defined in your site script that can be cross referenced to apply a discount. It does mean you would need to define your codes twice but it’s better than not having the functionality at all.

You would still need to use the link that Lukasz pointed out above so that the code was stored in the first place, and it means you would need an obvisous notice so that users know why the store prices are changing in front of them.

As far as I’m aware there isn’t a way to do this through liquid.

If you need a hand with implementation I’m available through elliot@mandelbrotian.com

Cheers,

Elliott

1 Like