leave the cart full of groceries and remove your child from that environment where he is getting a lot of attention from you and the rest of the customers, and take him to the car, where you are able to ignore the crying and screaming, thus placing the behavior on extinction: no attention.
be sure that the tantrum is your child’s way to get attention. if your child is over stimulated by the environment, in pain, scared, hungry or tired, do not use time-out, do not ignore the behavior. your child needs your help.
and remember, you are there to help your child, not the other way around. 