What do I do when…?

A friend at church asked if I answered parenting questions on my blog. I thought about it and decided to  answer a her question today. 
Now, before I do this, I want you to know I am NOT an expert by any means. I will only be giving answers based on MY experience raising my seven children. I may be slightly biased, but I can assure you my children are well-behaved, though not perfect. 🙂
My friend asked me how to handle her daughter, who is 18 months old. When they go shopping, the little one screams and cries to get out of the cart. Mom complies, and the little one proceeds to run around the store. My friend wanted to know how I would handle the situation.
There are probably many ways to manage this, but here was my suggestion. Simply put, I told my friend to spank her daughter when she starts acting out.  I also warned her to be consistent. Every time her daughter threw a fit, she needed to tell her no and, even if she chose not to spank, not to let her out of the cart. 
This is for the safety of the child. A child of 18 months, or even older, has no sense of danger and there are so many perverted and selfish people out there waiting for an opportunity to do evil. I shudder to think of it.
(Note: I do not condone BEATING, but a single swat to the backside for an 18 month old gets the job done.)
So now I throw the question to you, my readers. How would you advise this mom to handle her daughter’s temper-tantrums?
And if you have a question you would like answered, I have set up an e-mail BedofRosesThornsIncluded[at]gmail.com. Please replace the [at] with the appropriate symbol.