Hi,
before going out in public, let him know that he 's expected to behave in a certain way. It's good to make sure that he's not hungry or tired, because these will trigger meltdowns. If he's really bad you can just pick him up and say "we're going home". If you're grocery shopping, you can try getting him involved and give him jobs to do - like picking the apples and finding things. You can tell him if he's good the whole shopping trip, then he'll get a reward (like some gum/ chocolate/mini car toy etc). You could try making a rewards chart and everytime he does something good, he gets to put a sticker on the chart. Best of luck, I know it's hard. I have 2 myself 7 & 11 yrs.