EVERYTHING STOPS is the method that has worked with the greatest success. My daughter only needed it twice, both grocery store related and both during her two-year-old “No” period. Once when she was having a tantrum I picked her up and simply left the store with her, leaving the basket behind (I did tell one of the stock people where it was so they could get things put away).
The second time she was a bit older, almost three, and instead of having a tantrum she kept kicking my stomach as I pushed the cart. That time I asked her to stop, I told her to stop reminding her that it was the second time, and then I told her if she didn’t stop I would leave without her. When she persisted after the third warning, I walked around the corner into the next aisle leaving her securely buckled into the cart, staying where I could hear her. In a few minutes she said “Mommy, I’m sorry!” so I went back, discussed with her why kicking stomachs is unacceptable and we finished shopping.
She, however, is a relatively normal child (now a teenager who gets a little grumpy and is often forgetful but pretty nice overall).
My son, on the other hand, was a very different kettle of fish. He has been diagnosed with multiple psychological problems that resulted from brain damage at or before birth. When he was little, your child’s age up to about age 5 or so, the best thing to calm him down was to sit down in an isolated place, put him on my lap, and wrap my arms around him, holding him securely until he calmed down. Even at the age of 14 he still has tantrums but they are not as frequent as they used to be. He is physically too big for us to hold him so we still use the EVERYTHING STOPS method or variations thereof.
I have been known to pull the car over for as long as 45 minutes if he wouldn’t fasten his seatbelt even if it meant we would be late to see the latest superhero movie. We have left stores without what we went to buy, including things I was to buy for him. We have gotten as far as the parking lot of a restaurant and turned back to go home if he raises a stink about the choice of cusine (his most recent attempt was (edited for bad language) “I….don’t know why we are going to a…. Italian restaurant. We aren’t even…..Italian! And if….[Daddy] says he used to…...live there he’s…..lying!”) So we went home and I made spaghetti for dinner.
I have even made him get out of the truck and walk home when his anger was distracting me as the driver so our safety was an issue (usually only about 1/2 mile from the house). I explained it to him briefly at the time, and then we discussed it later after he was calm.
He has been hospitalized and there he has had to have been restrained a few times. Otherwise, putting him in a featureless room (the old “padded cell”) and locking him in works. A home variation of this for a two-year-old is the time out in a boring corner for 1 minute per year of age.
With the typical kid I agree with what others have said:
Do not shop during nap time.
Do not shop when he is hungry.
Do not shop if he is particularly out of sorts that day.
Get him to “help” you (should we buy this cereal or this cereal? Can you pick out two lemons for me? Please hold my shopping list. What color are those apples? and so on.)
Let him bring a special toy he only gets to have during shopping and then only if he is behaving.
Pretend the cart is a race car or a fire engine or whatever his interest is and make the full sound effects (yes, folks will think you are crazy but he will love it).
Tell him before you go in simple words what his reward will be for behaving and make sure he knows that a tantrum means he won’t get it.
Good luck! Enjoy him while he is small – it goes by very quickly.