For me the way to not overspend at a farmer's market is to take a certain amount of cash and to know what I am looking for. I also do bulk purchases so I ask vendors how much they charge for a bushel of beans or how much they charger per dozen ears of corn if I buy at least 10 dozen. Sometimes the prices there are high so know what the going rate is. It will usually be more expensive than the grocery stores but the produce is so much better that it is worth it to spend a little more.
Those are just my tips! What do you get at the farmer's market? Any strategies you use?