R.R.
The shopping part is easy to fix, the first time she strays you put her in the cart, the bigger she is the better, you want her to feel as if everyone will know she has misbehaved. When she complains tell her that's what she gets for not staying with you, that you have to protect her. Then put her in the cart when you enter the store a few times, always explaining this is a consequence of her behavior. After a few times give her the opportunity not to sit, and if she strays repeat a few times, etc., until she obeys and stays with you.
As far as when she sits on the couch and defies you, or does something you told her not to do, calmly stop what you're doing, walk over without a word and pick her up and carry her to her room, ignoring any tantrum. Put her on the bed or wherever you want her to sit, and tell her that you will let her know when she can come out, that she is to think about her behavior and talking back. When you decide she can come out tell her that when you tell her to do something you expect her to do it with no back talk, period. Be prepared to do this each and every time she defies you, consistency is the key, and defiant toddlers and preschoolers need to know you mean business. Do this with the sassy talk, too.
And if this doesn't work you can start taking away toys or privileges. Do what you have to do to get her attention, and be consistent, it's bad enough she will be doing this in her teens ; )