I've been having the same problem with my daughter who is also three. I'm sure it's something to do with the age she is, but that doesn't make it any easier. We had a funny incident the other day, though. We just got a new kitten, and when the cat does something I don't want her to, I have a spray bottle with water that I can squirt at her. Well, my daughter was getting into something or other that she shouldn't have been, and ignoring me as usual, so in desperation I reached for the spray bottle and gave her a little spray. It worked! Not only did she pay attention, but she knew that it meant she was doing something she wasn't supposed to be. I have no idea if it will ever work again, but I intend to try it! :)
Of course something like that is much harder to do at the grocery store. I think we have all had a time when our kids have misbehaved in public to the point where we never want to go out with them again. I've learned that if my daughter can make my temper flare in public, it's a lot worse, and I feel more embarrassed. So I have been trying really hard not to lose my temper in public, no matter what happens. We have had times when we have had to leave a cart full of groceries in the middle of the store and go home (not very nice for the people at the store, but sometimes you get desperate). It's a pain to have to do the grocery shopping again another time, but she has realized that if she wants to stay in the store, she has to behave. But if I can manage to stay calm through it, I feel a lot less embarrassed, in spite of her performance. Lately, she's done really well in public, so maybe we're making some progress finally.
Anyway, I'm not sure if this helps, but if nothing else, know that you're not the only one going through this; we can feel your pain. Good luck!