you would need to have the users login before they can checkout.
after login, the users ID will be stored in a session.
at checkout, store the users ID in the orders table.
after login, create a recordset to lookup the users ID in the orders table.
Set a session that stores the record count from the recordset in a session. If the user has not purchased, the record count will be 0.
set up the discount to trigger if the session is set and the session value is 0.