This will pass. It is his age. This is not something you should be ashamed of, we have all been there.
There are times, when you may not be able to take him to the store.. He is young enough that distractions, snacks, bribing, do not mean anything when he is is in a total different controlled environment like home. I always tried to plan the errands AFTER our daughter had breakfast and an hour of really active outside play. That energy was out and she could pay attention. Or after nap, a snack and outside play.
He is hungry, bored, He has lots of energy and may have the "I wants and gimmies". You may need to just leave him at home with your spouse or with a friend. Or you will need to judge your sons behaviors to see if he is going to be able to handle this outing.
The moment a child starts losing it, it is time, to pick them up and carry them out to the car and leave. It is not fair to him, to you and to the others around you.. ANYONE with a child will know exactly what is going on.
As he matures you can explain, "we are going to the store to buy...
You will be sitting in the basket and I will need you to help me find milk, diapers, blah, blah, blah...Remember we use our inside voices, we do not touch, we look with our eyes. If you cry or yell, we will leave the store."
"Pick out a snack because we do not buy snacks at the store."
"If you cry or yell we will leave and mommies feeling will be hurt."
Then at the store. "Thank you for sitting in the basket. Remember inside voices. We need fruit. Where is the fruit in this store? We need bread. The bag is blue, do you see our bread on the shelf? "
This si how you will keep him engaged. Thank him fr being a good helper. Thank him for using a inside voice.
Try it again in a few weeks with him, but remind him you will leave if he throws a fit. Then do it.