This is why I like the grocery store that I shop at. If I don't have my discount card, they don't need to go and look for a generic one, nor do I have to pay the non-discounted price. They can just enter my phone number in.
As someone who used to be a cashier, this cashier should have been trained not to walk away from a customer, even for a few seconds, unless you say why. Although, she should be able to figure it out without needing to be trained for it.