I doubt the problem is solved that easily. Stores have been known to instruct cashiers to enter information about customers during the checkout process -- age, gender, race, etc. -- and combined with what you buy, there is probably enough information to identify you or to distinguish you from the set of all shoppers. Some stores print coupons with your receipt; it is not all that unlikely that the profile they are building of you as a customer, even without the use of a customer loyalty card, is used in deciding which coupons to print.
In the future, they might even use their security cameras to add some extra data points. Never mind facial recognition; I bet they would only need to track your walking pattern as you move through the store. Some people like to browse. Some people enter knowing exactly what they are looking for. Some people store by going left, others by going right. Maybe the first thing you do is go to the produce section.
Chances are that this sort of data, combined with other data, can be used to identify you even if you never explicitly gave Walmart any identifying information. If Walmart can distinguish but not identify you, they might make more money just selling your profile to an advertiser, who can combine it with data gathered from other sources to figure out who you are (then annoy you). Maybe it's already happening, but I think it will be a few more years before the technology is really that advanced (I have no doubt that this will happen in the near future, assuming no laws to stop it).