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 [email removed] 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 [email removed] 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.