Sorry if I haven't provided all the necessary information, I'm still new to Shopify. I am trying to create a form that will give discounts to university students if they complete the form when putting a product into their cart. This is difficult since I can't find forms that will only allow access to .edu email addresses nor can I find a way for a discount code to be generated from a form completion that is triggered at the time of adding the product into the cart. I've seen forms that block certain email addresses but none that only allow access to certain domains, i.e. .edu.
Here is the logic I'm trying to achieve:
Puts product into cart > Trigger button "Is this for academic research?" > No would just trigger it being added to cart, Yes would trigger the form popping up > If all required fields are filled out, give a randomly generated discount code > allow the discount to be applied to each product that they have put in their cart that they have applied a discount code to.