Discount Code applied based on email address within checkout

ThomasP1
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 @ xxx.com 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 @ xxx.com 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.

0 Likes
gina-gregory
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.

https://apps.shopify.com/script-editor

https://help.shopify.com/en/manual/checkout-settings/script-editor/shopify-scripts

0 Likes