Skip to main content

Apply discount codes after submit

Apply one or more discount codes to the customer's cart automatically after they submit. Pairs well with newsletter signup, lead gen, and onboarding forms.

Setup

  1. First, create the discount codes you want to apply in your Shopify admin under Discounts.

  2. In the form editor, open the Actions card.

  3. Toggle on Add discount code.

  4. Search for and select the codes to apply.

  5. Save.

How customers see it

After a successful submit, the discount is seeded into the customer's session. They see it pre-applied when they reach checkout β€” no need to type or paste the code.

Showing the code in the success message

In the success message field, use the token {{ discount_codes }} β€” it renders as a mono-font badge with the code visible. Useful when you want the customer to also be able to share or note the code.

Did this answer your question?