S.R.
When I was shopping and had young toddlers, I went alone and dad stayed home. Always! He stopped at the store on his way home for those unexpected items. I planned much better back then. I didn't feel they "needed"to learn how to behave in a store at age 2. 3 was plausible. The negative outweighed the positive. As I recall, I was so offended by my oldest at age 2 and his behavior. I had always been able to control things and suddenly he wanted to be in charge. I felt like something was wrong. By 2nd and 3rd child I understood the growth pattern and was able to handle it with less insult.
I think a lot could depend on what's going on when both parents are there. It could be the opportunity to teach since 1 can follow through on discipline while the other gets things done. 2 is young, but state the expectations, firmly but lovingly, state the consequence, and follow through with no "warnings". In the store with you alone, you should always be willing to walk away from your cart and leave if his behavior gets too bad. The reference to Super Nanny, Jo Frost, is a good one. She has a book, too. There's a lot of good discipline books and I would recommend learning some techniques.