I've posted this before, and I don't have the hard copy in front of me, so the numbers might not be exact. But anyway, IMC we came up with a haggling system that isn't as exploitable in those ways. It's a lot more rolling than the systems the other people here have suggested, so we end up Taking 10 a lot. I know it looks long, but most of the steps are optional or can be fudged by the DM to keep things flowing.
Here's the idea:
STEP 1: Figure out how much the item is worth. When you're buying from a merchant it's simple, he's done an Appraise check beforehand. When you're selling, he does a quickie Appraise check on the spot (with a higher DC for being rushed). Record the margin of success on the Appraise check for later use; if he failed it's zero. (For convenience, you can pretty much always assume the guy took 10 unless it's really expensive, in which case Take 20 might be more appropriate)
If you want to try to swindle the merchant, do an opposed Bluff vs. Sense Motive check to tweak the Appraise result. There are three outcomes:
A> You fail the opposed bluff check: this usually ends the deal immediately, since most people don't appreciate being blatantly lied to.
B> You succeed with your Bluff, but by less than the Appraise check margin: The price isn't changed. He's willing to believe he might be overcharging a bit, but he won't give you a break.
C> You succeed by more than the Appraise margin: each additional point lowers/raises the appraised price by 1% per point of margin (max 20%). Even if he doesn't sell to you, he now thinks the item is less valuable than it was before.
STEP 2: Take your CHA. Pretty easy, huh? Note this is CHA, not CHA Bonus.
STEP 3: If you want to haggle seriously, add the result of an opposed skill roll to Step 2. By default, this might be Diplomacy versus Diplomacy. Depending on the circumstances, the DM could allow either side to replace the skill needed with Bluff, Sense Motive, Innuendo, a Profession skill, a Craft skill, a Knowledge skill, or whatever the DM thinks is appropriate to the situation. But, Diplomacy ALWAYS is an option.
If you want to just do "casual" haggling, skip this step. Effectively this'd be like both sides Taking 10 on the whole thing. When you're shopping for groceries, you won't spend five minutes arguing about the minutae of the product.
STEP 4: Add some optional circumstance modifiers on a per-item basis. Skip this if you want.
If the merchant's race/class/social status conflicts with yours, add or subtract up to 5 points. If his race REALLY hates yours he could refuse service outright, but that's pretty rare.
If this merchant is someone you've bargained with repeatedly, add or subtract up to 2 points to reflect their earlier encounters. Add if it's been a fair relationship, subtract if either side has repeatedly swindled.
If the player actually roleplays out the haggling, give him a few extra points. No more than 2 or 3, though.
If the item is a really specialized item you could add or subtract a few points to reflect its marketability. For example, even though a +5 longsword is in theory worth the same as a +1 ghost touch keen sure striking flaming kukri, one is far easier to sell. Very generic items that everyone wants (Bag of Holding) add up to a +4, while very specific ones (that Kukri) could subtract up to 4.
STEP 5: If the total of steps 3&4 is below 5, he either won't deal with you at all (DM's choice) or he won't allow haggling at all. Buy at 150% of appraised price, sell at 50%.
STEP 6: Take 250% and divide it by the end result of Steps 3-5. This is the Margin. As DM you can feel free to round it to the nearest 5% or something, just for convenience's sake. You don't need to be exact.
When selling to a merchant, he'll pay 100% minus the Margin. When buying from a merchant, he'll charge you 100% plus the Margin.
For example, Bob is an average guy, so his CHA is 10. If all the other modifiers balance out, that means he buys swords at 125% of their "true" value and sells them at 75%. If he sold his new +2 sword (4000 gp) he'd only get 3k from a merchant, and if he wanted to buy it back it'd cost 5k. The remaining 2k is the merchant's profit, to cover storage fees, advertising, security, salesmen, appraisals/magical identification, whatever.
Now, if Bob lets his friend Fred the Paladin do the talking, the Margin might only be 10% (CHA 18 + much better Diplomacy skill puts the result in the 25 range easily, and 250%/25 = 10%). He'd buy at 110% and sell at 90%.
The important thing is the diminishing-returns aspect. Having a phenomenally high CHA won't allow you to sell an item for more than its market value or buy it for less, it'll just reduce the margin to the point where you're not paying much overhead. It also helps to have the high-CHA Diplomacy guy do your negotiating for you.