How can I apply and save a discount code on a product page?

Topic summary

A developer wants to automatically apply and save a discount code when customers visit a product page via a URL parameter (e.g., ?discount=Discount10). Their goals include:

Desired functionality:

  • Apply the discount to product price and save it in a cookie
  • Carry the discount through to cart overview and checkout

Current challenge:

  • Unable to retrieve discount information at the product page level

Proposed solutions:

  • This isn’t natively supported by Shopify themes
  • Two third-party apps were suggested: Avada Discount Code Generator and Coupon X Discount Codes
  • Alternatively, cart permalinks can achieve similar functionality by applying discounts at the cart level rather than product page level

The discussion remains open regarding whether a product-page-level implementation is possible with Shopify’s current discount features.

Summarized with AI on November 23. AI used: claude-sonnet-4-5-20250929.

Hi there,

Got a question regarding discounts & theme development.

Here’s what I try to accomplish:

  1. Create a new discount code at https://{SHOP}.myshopify.com/admin/discounts Discount10
  2. Share discount code with product url https://{SHOP}.com/products/test-product?discount=Discount10
  3. Apply discount to product price, save applied discount in a cookie (?)
  4. Apply discount to shopping cart overview & checkout (?)

Is this even possible with the current discount features?

I struggled to get the discount information on product page level for example.

Any help & advise welcome!

Hi @Aaron-me ,

This is not supported by the theme code, if you want you can just install or build the app. Refer apps:

Hope it helps!

Yes you can do this with cart permalinks.