Any form of discipline can be more difficult to do while you are in the supermarket.
Fortunately, 20 years ago in Australia when my children were little, it was still OK to smack a child in public, although some individuals made negative comments about it.
Something that did work (once the children were old enough to understand) was to say something like “if you keep misbehaving, you know what you’ll get when you get home. The longer this goes on the worse it will be for you.” Our children knew we carried through with these threats and so that worked well in stopping bad behaviour while we were out.