It's her age. She is most likely very frustrated at her own lack of ability to communicate to you what she is feeling at the time. Is she bored? Hungry? Tired? That's usually what will lead to a meltdown.
Punishment or ignoring her will simply further her frustration and lead to more melt downs - leading to your further frustration as well.
Your first "defense" is avoidance in the first place. Make sure you have a snack and drink with you at all times, and make sure she has had a little nap before going. One thing I always did was keep a toy that mine only got to see every once in a long time, and give it to them in the cart. I had about 4 of these toys, and rotated them so that they were almost new to her whenever we went to the store. Those little mini doodle pros are one of the biggest hits with our kids. Any toy that keeps them busy for a long time works good, though - as long as it is new to them. (a friend goes to the toy section and gets a toy that her kid can play with from there every time, cause she could not afford to buy them, and this worked perfectly)
If she still has a meltdown, you can swaddle her and hold her and make the "shhhhh" sound very calmly for a while until she calms down. Then, encourage her to show you what is wrong, once she is okay again. I always held my kids and supported them through a meltdown, because it is terrifying for them as well. Their brains are not able to handle things as adults are, and the kids do not understand what is happening to them. They're too young to have the self control of an adult. You teach it to them by helping them calm down in a gentle and loving way. Doing this, my daughter (who has always been hyper active) only had meltdowns for about a year. My friend's kids were still having them at 5, while my daughter stopped before 3. She has amazing self control as a 6.5 year old.
One thing to remember is that punishing a child under the age of 5 is pointless. People do it all the time, but it does not work. The reason it does not work is because their brains have not developed the ability to understand that they are "judged" yet. Once they develop that ability, a switch goes on and they start gaining an amazing amount of self control, etc. (I learned this from Neurology) In order to help their brains develop these skills, you gently support them through that development and it will make a HUGE difference. Guiding them, redirecting them, and preparing them will work wonders now and in the future.
Best of luck!
Teri
ps, adding on:
At this age, they do not understand that they have the ability to "manipulate" you, so they are not trying to "push your buttons" or see how far they can go, etc. They are not doing this because they want attention, etc either. They do not have that ability yet. All they know is that something upset them and their body went out of control. I think of it as being similar to me crying at a sad movie. I do not intend to cry at a sad scene, and I am not doing it for attention. I wish I could stop it from happening, but I do not know how. She's still a baby. She relies on you to guide her and help her understand what is going on, and how to communicate. Not being able to communicate your needs is terribly frustrating. (imagine being in another country and not knowing the language, but needing to pee, or a drink, or food really bad. When you try to communicate this to people, they don't understand you. You have a need, but can't seem to figure out how to get it met. You finally just start crying because nobody seems to understand you. That's what your baby is feeling, and they don't have the power or knowledge yet to deal with it effectively.