Well this is something we all have seen and always wonder why parents can't control their kids. I have been in the middle of a few in public and wanted to just lay a good swat on the bum to make my point but we all know that people frown on that. I have found that with my girls they do better with a talking to then a hit to the behind. I have tried that old "I'll give you something to cry about" but it never seems to pan out. Threats about losing privileges like movies and going to the park work sometimes but you have to let them know ahead of time of reward for good behaviour.
The last time one or both started to melt down we took them aside and got down to their level so we were looking eye to eye. Something funny about that is our girls are like dogs in the fact that they won't look you in the eye initially. It has something to do with dominance in dogs not looking you in the eye when you get down to their level and I have found that my kids are the same! Who knew? But getting them to look you in the eye and being at their level does work very well and the next part is up to you in how you approach the situation.
I usually start with a question such as "what is wrong? Why are you crying?" This gets them to stop crying and acting up and they try to put into words what is wrong. Let them speak and try to listen without cutting them of or getting upset. STAY CALM!! This is the biggest thing with our styles. Nicole (my wife) has a tendency to sometimes get angry or frustrated with the girls and they tend to feed off that. I had Zoey throwing a huge tantrum at a grocery store and I ignored her and put the food through and paid for it and remained calm even though I wanted to lose it on her. The cashier said I had the "patience of a saint" and I told her I was just trying to get the groceries and go home to deal with it later.
Once you can find out what the tantrum is about then you can address it however you like but don't give them what they want. This will lead to more and worse tantrums in the future. I have made that mistake once and never again. Once you can establish a bit of calm with them you can tell them that they can get what they wanted but at a later time because they were not behaving properly and that is no way to get things. I also offer another chance at a store before heading home even if I don't need to go in for anything. We will go to Canadian Tire and walk around looking at things and I will tell them as we are leaving they can have a little treat for being good and behaving properly. I will also try and get through that they are good they can ask for things and get rewards for being good but not all the time. I always use the magic point system and if they are good I tell them for the next week of being good they can go to see a movie or have a girls night and stay up late. Anything they like you can use as incentive and it will eventually sink in and they will be good without reward.
You are really training your child to be good in public and listen to your requests....commands....whatever you like. Once they listen and you can talk to them in simple sentences you can get on the same page and you can sense the frustration they are felling on you saying no but you can explain why and tell them to shoot for that bigger goal of a night out at the movies to see a new kids film instead of the tantrum over the chocolate bar. It won't happen overnight but you will see a change over time. It will get better but you have to stick with it and not give in. I am able to talk to the kids and tell them they are not going to get something because they were misbehaving. I tell them when and where and get them to acknowledge the incident so they can recall it and remember how they were acting. I'm hoping this will make them think about they way they behaved and they will learn from each time they act up and things are taken away.
Try it and hopefully you can fit this advice in your day to day trips to better help you train yourself to be a better parent for your child.