I second the idea to watch super nanny it is on tonight Wed late I think 8 or 9.
What it sounds like is that you have shown him routine If every time you go to the mall you give him candy out of the machine it is now a routine and he has more then the right to expect it (you have shown him it is routine just like he should expect every night that his teeth with be brushed) So I don't blame him that he throws a fit when all of a sudden he doesn't get one. So my suggestion would be to explain to him (he is old enough to understand) that he will not be getting a treat every time he goes to the mall from now on.
In our house we are very big into time out. in fact it is to the point where my daughter will do something wrong (she will be three in May) and she will put herself in timeout. We go off the the Super Nanny's idea of timeout lasting as long as they are old so our daughter is in time out for 2.5 minutes. I think it works great!
We have noticed with our boy (just turned one) is a little harder to discipline then our daughter so we have already started time outs with him (he gets put in his highchair for time outs and is starting to learn very quickly not to do certain things. So if you see this problem arising with your younger son I would suggest starting earlier with him.
And having your older son having to go out in his jammies is not really a punishment at all (he has won he doesn't have to get in his real clothes) Now to tell him that he is either leaving this house naked and cold or dressed and worm and then bringing him out in just his diaper with spare clothes in tow where it is cold (and no it is not too cold out to where this is mean it is just a short trip to the car!) might get him to understand the rules. Our daughter tried fighting now wearing her shows when we go out and it only took one trip to the car with the cold ground for her to be begging for her shoes back!
these are just some thoughts but I do suggest you start nipping this in the butt before you have another little one on your hands and don't give in anymore that is what they are looking for they thrive on inconsistency!! I know it is hard we have all been there but I know you can do it and remember it will get better!!!