Discount Code applied based on email address within checkout

New Member
1 0 0

I need to apply a discount code in the checkout only to customers who enter a certain email domain. Once a customer has entered their email or they are logged in and they hit the checkout, this if they have a domain of @ then apply 40% discount code.

If the email address in the checkout changes at all - this discount then needs to be removed. This can not be done on customer groups as if the cusotmer checks out as a guest, if they have an @ domain entered in the email it should have the discount applied.

Is this possible with Shopify? I am on Shopify Plus so have access to checkout files.

Shopify Expert
710 47 168

This can be done with the Script Editor app. Set up your discount code, then in the Script Editor, you can create a script that will reject that code for anyone that does not have an email with the domain you're looking for.