Hmmm- toughie. In the past, what i have done is- Made eye contact. That often helps remind the parent that other people have seen your behavior.
Then, when one of my 5 invariably acts up, I make it a point to reprimand my child in a kind loving way- making SURE that parent hears me. I also make it a point to say to my child- "I know you're little, and shopping is not fun, but we will have fun soon at home, I love you sweetie" I just hope to heck that the slapping parent hears and learns by example. I KNOW what it feels like to have a whiney, crying, uncooperative child with me at the store. I certainly will admit to wanting to just spank the heck outta one when I'm frustrated beyond belief. I really understand. But I also remember that I am an adult. I try to remember that a child has only been on this planet a very short time, and has limited communication abilities.
I try to show them an alternative by example. A parent who will slap a child, in public,may not be afraid to slap me one for interfearing. My heart always breaks for any baby mistreated in my presence. In todays age of road rage and desperation due to economy, people are just worn thin, embarrassing them may make them lash out, at me, my kids, and their own children.
Sad, isnt it?