I have pretty much narrowed down the time of day that shopping of any kind doesn't work for my kids. As somebody above posted, when they're feeling hungry or tired or haven't had enough one on one contact time with me during the day so their a little (ahem) more sensitive.
If I do find myself in the store during one of their bouts of misbehavior, I make no qualms about putting things back that we've already started shopping for and leaving the store.
That's only if it gets really bad.
To curve it from getting to that point I tone my voice down. I find that going within myself to that place of inner peace really allows me to connect with them. Asking them for help is amazing, too. My 5 year old can't read, but he knows what we get. I ask him to help me by picking out his own fruits (if we're grocery shopping), or toilet paper, or whatever object is familiar to him. I'll also try to find something entertaining for him in the store right off the bat. A toy for the hour or so.
Also bringing along a snack for mine to eat while shopping works well. This way they're distracted, sitting calmly in the cart, eating, being happy, and with my engagement we can usually make any shopping experience a pleasant one.
I don't know if you deal with bribery, but if you told him that if he can make it through the shopping trip, maybe you could take him to the pet store, or a book store to read a book with him or something.
We all have or have had or will have kids that can get out of hand during a shopping endeavor. Just breath, remain calm and don't worry about what the people around you are thinking about what you all are doing. Everybody is going to have a comment, both positive and negative, but it's not their child, shopping trip or life.
Good luck. In a couple years or even months, this will be a thing of the past, and you'll wish you had to worry about a small child acting up in the store!!!