I only had one child, but when she started screaming because she wanted to leave, the very last thing I was going to do was let her have her way. A trip to the ladies room solved that rather quickly. After that, I only had to ask if she needed to visit the ladies room when she started to act up and she'd quit immediately.
As soon as she was old enough to realize that she was getting to go a lot of places that her friends weren't, she quit even thinking about behaving badly.
Good for you! Parents are to be parents, not buddies or bestest friends.
One of mine decided to sit and refuse to walk in the mall. We left him where he sat. He couldn't see me duck into a store to watch out for him. When he realized that we weren't going to put up with his tactics he stopped. We also had several grand parent age shoppers who encouraged us to keep doing what we were doing.
Done right, spanking is a last resort and done very sparingly. As you can attest, it can be very effective.