I find wearing any type of name tag at all just aggravates this dilemma, so when it isn't absolutely required I don't wear one ( or else I attach it to my work satchel sitting in the cart). Looking as much like a shopper as possible is the only true defense, but of course that still doesn't work. I mainly just smile and say "Sorry, I am not a store employee" then just turn back to my work and ignore them. Sometimes I do help, but you have to make it the rare occasion.
One time I did this however I felt so guilty that I chased after the customer (who was riding in an electric disabled cart) . I had actually directed him to the aisle that he needed but it dawned on me afterward that he probably couldn't get out of the chair well enough to reach the product. So I left my task and followed after him.
It turned out he was wanting to get a very specific canned item (that he knew was very inexpensive from his previous visit) but his eyesight was so poor he couldn't distinguish between the different brands.
He thanked me, shook my hand and introduced himself by name ( I reciprocated). He then chuckled that he probably needed to get some better glasses.
I helped him get one more item from off the shelves then went back to my work.
It really kind of made my day to help him out, but I almost didn't do it. Lesson learned.