Your pet must drop the item in a non-store tile in order for you to be able to pick it up free of charge. Otherwise it's just like picking up the item from the store.


 +-----------+
 ¦···········¦
 ¦··········@@
 ¦···········¦
 ¦···········¦
 +-----------+

The two tiles denoted by @ are not considered part of the store. (Same goes for every tile outside of the store, of course.)

Further, every time your pet picks up an item, it becomes a little less trained. Feed pets to train them.

My preferred way of ripping off the storekeepers is to enter before my pet and close the door (lock it if possible). Then take all the items in the store and pile them in a corner far from the door. If any of the items are cursed, the pet won't go onto that tile at all. Then I drop all my money at a tile close to the door, and let the pet enter the shop. The pet will likely pick up the gold, at which point you can either blow a whistle, or step away from the shop and hope the pet follows you. The result is that you have as much credit with the storekeeper as the amount of money you dropped in his shop. You can then buy whatever items you want.


 +-----------+
 ¦···········¦
 ¦·········$@@f
 ¦···········¦
 ¦)··········¦
 +-----------+

When buying items, never pay cash. Rather, chat with the shopkeeper to find out how much your bill comes to, then drop that much money in the store. When you pay, the money will still be in the store, ready for future stealing by a pet or monster (which you then just need to kill outside the store).