i have a 4.75yo, a 2.5yo and a 4mo.
dh was telling me that one of his co-workers does the "behave or we will leave" thing with his 2 daughters and he swears by it.
what i would do if my 2.5yo was misbehaving:
-first, find out the issue at hand. is your child tired or hungry? if they are, don't expect much from them and work on this problem FIRST. if i'm tired or hungry, even with all of my restraining abilities as an adult, i still can't function 100%. be sure to carry some juice/water and a snack for your toddler. also, try to plan shopping trips after your childs nap so that they are in a good mood and ready to go. if your child is not tired or hungry and you truely believe they are just testing limits (and you as thier mother would know more than anyone else), then imo it's time to be firm. sometimes my daughter would just throw a tantrum then and there because she simply did not want to do whatever we were doing - and she would freely say this. i'd pick her up, tell her in very few words that she needs to stop, that we are doing X and carry on with what i was doing. i'd carry her kicking and screaming like a maniac while i pushed the trolley with one hand. i don't tell her to stop or to quiet down, i just carry on with what i am doing. you do get a lot of stares and a few sympathetic smiles along the way. i don't see why the trip needs to be spoiled or we have to constantly start and stop because one person is acting up. the person that is acting up is the only person who should have thier behaivour reprimanded. after a while she gives up and decides to behave.
dh doesn't have the patience to hold her and carry on while she kicks and screams so he just tells her that she will have to go and sit with him in the car until i finish, if she doesn't behave. this works too, but obviously you need two adults here. for one adult, my method above works for dd. obviously you should not lose your cool. just be clear, be CALM but firm, carry on and be consistent.