Haggle Bot Documentation
By The WP Instinct Team · wpinstinct.com
Introduction
Haggle Bot adds a Make an Offer button to your WooCommerce product pages. When a customer clicks it, an AI sales assistant opens in a chat window and negotiates the price with them in real time. If they reach a deal, the customer checks out at the agreed price.
The one idea that makes this safe to run on a real store: the AI is the voice, PHP is the judge. The AI writes the conversation, but it has no power over your prices. Every price it proposes is checked by the plugin on your server against a floor you define, and every deal a customer accepts is validated again before checkout. A clever customer can talk to the bot all day; they cannot talk it below your floor, because the floor is not enforced by the AI at all.
The plugin works with three AI providers: Google Gemini, OpenAI, and Anthropic Claude. It runs on your own API key, so AI usage is billed directly to you by the provider you pick, with no middleman.
Requirements
| Requirement | Minimum |
|---|---|
| WordPress | 5.8 or newer |
| WooCommerce | 7.0 or newer |
| PHP | 7.4 or newer |
| HTTPS | Strongly recommended (protects negotiation traffic and your API key) |
| An AI API key | From Google Gemini (free tier available), OpenAI, or Anthropic Claude |
The plugin is multisite-aware but is sold and supported as a single-site plugin. Updates are delivered as manual downloads through CodeCanyon.
Installation & Setup Wizard
Installing
In your WordPress admin, go to Plugins → Add New → Upload Plugin, choose the haggle-bot.zip file from your CodeCanyon download, click Install Now, then Activate.
On activation the plugin creates three database tables (for deals, negotiations, and chat rounds) and opens the setup wizard automatically.
The setup wizard
The wizard gets you from zero to a working bot in three steps.
Step 1 - Connect AI. Paste your Google Gemini API key. The wizard uses Gemini because its free tier is the fastest way to try the plugin; you can switch to OpenAI or Claude at any time in Settings. If you do not have a key yet, see Getting an API Key below.

Step 2 - Set your rules. Choose your store-wide maximum discount and the bot's personality. Both can be changed later, and individual products can override the discount.

Step 3 - Finish. A summary with links to the settings page and your shop.

/wp-admin/admin.php?page=haggle-bot-setupGetting an API Key
Haggle Bot does not include AI usage. It connects to an AI provider using your own API key, and the provider bills you directly for what you use. This keeps your costs transparent and usually very low: negotiations are short conversations using small, fast models.
Google Gemini (recommended to start)
| Cost | Free tier available. No credit card required to start. |
|---|---|
| Get a key | Visit aistudio.google.com/apikey, sign in with a Google account, and click Create API key. Takes about a minute. |
| Good to know | The free tier has daily request caps. Fine for trying the plugin and for low-traffic stores; busy stores should enable billing for higher limits. |
OpenAI
| Cost | Paid. You need billing set up on your OpenAI account. |
|---|---|
| Get a key | Visit platform.openai.com/api-keys and create a key. Add a payment method under Billing if you have not already. |
| Good to know | Costs are per token (roughly, per word). A typical negotiation costs a fraction of a cent on the smaller models. |
Anthropic Claude
| Cost | Paid. You need billing set up on your Anthropic account. |
|---|---|
| Get a key | Visit console.anthropic.com/settings/keys and create a key. Add credit under Billing if you have not already. |
| Good to know | As with OpenAI, per-negotiation cost on the smaller models is a fraction of a cent. |
Settings Reference
All settings live under Haggle Bot → Settings in one tabbed page. Every option has a description next to it in the admin; this section adds the context that does not fit in one line.
AI Provider tab

| Setting | What it does |
|---|---|
| AI Provider | The service that powers negotiations: Gemini, OpenAI, or Claude. Usage is billed to you directly by the provider. |
| API Key | Your key for the chosen provider. Stored encrypted in your database. |
| Model | Which model the provider should use. The dropdown updates to match the selected provider. |
| Test Connection | Sends one tiny request to verify your key and model work together. Run this after any change here. |
Negotiation Rules tab

| Setting | What it does |
|---|---|
| Maximum Discount (%) | The store-wide default discount limit. 30 means the bot will not go below 70% of a product's price. Products, variations, and categories can set their own limit, which replaces this one. See The Floor System. |
| Max Rounds | How many offers a customer can make before the bot gives its final price and holds firm. Lower numbers protect margins and reduce AI cost. |
| Minimum Product Price | Products priced below this never show the offer button at all. For variable products this is checked per variation. |
| Negotiated Price Applies To | What happens if the customer changes the cart quantity after striking a deal. See The Deal Flow. |
| Personality | The tone the bot uses while haggling: Friendly Shopkeeper, Tough Negotiator, Playful Bargainer, or Luxury. This only changes how it talks, never the prices it may accept. |
Deal Expiry tab

| Setting | What it does |
|---|---|
| Deal Valid For (minutes) | How long a negotiated price stays redeemable. Default 1440 minutes (24 hours). Expired deals are removed from the cart with a notice; the customer can simply negotiate again. |
| Show Urgency Message | Lets the bot mention the time limit when a deal is struck, encouraging a faster checkout. |
| Urgency Message | The wording of that message. Use {time} where the remaining time should appear. |
Negotiation Scope tab

Controls which parts of your catalog can be negotiated. Covered in full in Where Negotiation Applies.
Display tab

One decision: where the Make an Offer button appears on product pages. Five in-page positions (around the price and cart form) plus two floating options that pin a sticky button to the left or right edge of the screen.
Text & Labels and Customer Notices tabs
Every customer-facing string is editable. Covered in Text & Notices.
The Floor System
The floor is the lowest price the bot may ever accept for a product. Everything else in the plugin exists to serve this number: the AI can charm, hold firm, or meet in the middle, but the floor is computed and enforced in PHP on your server, on every single offer.
Two ways to define a floor
Maximum Discount % is the usual way: "never sell more than 30% below the list price." Higher number = bigger possible discount. It adapts automatically when you change a product's price.
Fixed Floor Price is an absolute number: "never below $700, full stop." Available on products and variations only. Because a fixed number cannot adapt to different variation prices, the plugin warns against using it on variable products; use a percentage there instead. Categories can only use percentages, for the same reason.
The cascade: who wins when several floors are set
Floors can be set at four levels. The most specific level that has a value wins, and everything below it is ignored:
Specific beats general. The global Maximum Discount is a default, not a cap: a product set to 50% is allowed 50%, even if the global says 30%.



Worked example
Set a 15% limit on the product itself, and its floor becomes $850 - the product's own rule replaces the global one entirely.
Quantity Tiers
Quantity tiers let the bot go lower for bigger orders: "for 5 or more units, allow an extra 10% off." Tiers are set per product in the product's Haggle Bot metabox. Variations inherit the parent product's tiers.

How the math works
A tier's extra discount applies to the already discounted floor, not to the list price. This "compounding" behaviour means tiers can never push a price to zero, no matter what numbers are entered.
Two rules worth knowing
The best matching tier wins; tiers do not stack with each other. With tiers at 5+ (10%) and 10+ (40%), a customer buying 12 gets the single best match: 40%. They do not get 10% + 40%.
Tiers are thresholds, not exact matches. A "5+" tier applies at quantity 5, 6, 7, and so on - any quantity at or above the minimum.
Where Negotiation Applies
By default every product can be negotiated. The Scope tab plus per-product and per-category switches let you narrow that.
Global scope: products AND categories
The Scope tab has two independent rules - a products rule and a categories rule - and a product must pass both to be negotiable. Each rule offers the same three modes: all, all except selected, or only selected.
Per-product and per-category switches override everything
Each product (and each category) has its own Negotiation setting: Default, Enabled, or Disabled. These follow the same specific-beats-general cascade as floors:
| Setting | Effect |
|---|---|
| Product says Enabled | Negotiable, even if global scope would exclude it |
| Product says Disabled | Never negotiable, whatever else says |
| Product says Default | Category is checked next, then global scope |
Separately, the global Minimum Product Price hides the offer button on anything priced below it - handy for keeping low-value items out of negotiation without listing them one by one.
How Negotiation Works
Here is what happens when a customer clicks Make an Offer and starts haggling.


Rounds. Every customer message counts as one round. When the round limit (Max Rounds) is reached, the bot states its final price and holds firm: further messages get the same answer, and the customer can take the deal or leave it. The chat input is never locked, so there is no trap - but there is also no way to grind the bot down by persistence.
The floor, enforced twice. During the chat, every price the AI proposes passes through the server-side validator, which clamps anything below the floor. And when a deal is finally accepted, the plugin uses its own record of the last offer it approved - not a number supplied by the browser - so the deal price is always one the validator has already blessed.
What the AI knows. The AI is told the product, the list price, and how it should behave. It negotiates within the space the validator allows. What it is not given is any authority: it proposes, PHP disposes.
Quantity matters. The chat reads the quantity from the product page, so an offer for 5 units negotiates against the quantity-5 floor, including any tier discount.
Rate limiting. Each visitor is limited to 30 negotiation requests per hour (adjustable via a filter, see Developer Hooks). This keeps a bored visitor or a bot from running up your AI bill.
The Deal Flow
When the customer accepts, the deal becomes a record on your server and the customer is taken to the cart.

The token. Each deal is identified by an opaque token attached to the cart item. The browser never holds the deal data itself - price, product, quantity, and expiry all live server-side and are looked up by token. Tampering with the cart cannot change the agreed price.
Deals add to the cart. A negotiated item is added alongside whatever is already in the customer's cart; it never replaces or clears it.

What the customer sees. The cart, checkout, order confirmation, and order emails all show the same three lines for a negotiated item: Original Price, Negotiated Price, and You Saved - quantity-aware, so a 5-unit deal shows per-unit and total savings correctly.

Quantity changes after the deal. Governed by the "Negotiated Price Applies To" setting:
| Mode | If the customer changes cart quantity |
|---|---|
| Only the exact quantity negotiated | The deal is removed, with a notice explaining why and inviting a new offer |
| That quantity or fewer | Reducing is fine; increasing removes the deal with a notice |
| Any quantity, re-checked against the floor | The price is re-validated for the new quantity; it survives if it still respects the floor |
Expiry and safety nets. Deals expire after the configured time (default 24 hours) and are removed from the cart with a one-time notice. If the product's own price changes after the deal was struck, the deal is voided too - the customer is told why and can simply negotiate again. Nothing is ever removed silently.
Dashboard & System Status
Dashboard

The Haggle Bot dashboard shows how negotiation is performing: total negotiations, deals struck, conversion rate, revenue from deals, and average discount given. An activity chart tracks negotiations and deals over time, and a breakdown chart shows outcomes (deal, walked away, abandoned). A recent-negotiations table and a top-products panel round it out.
Everything on the page respects the date filter: last 7 days, last 30 days, or all time. A compact stats widget also appears on the main WordPress dashboard.
System Status

The System Status page runs the plugin's health checks in one place: WordPress, WooCommerce and PHP versions, whether an API key is configured, whether the AI connection works, whether the database tables exist, and whether HTTPS is on. Check it first whenever something seems off - it usually names the problem directly.
Text & Notices
Every string a customer can see is editable, in two groups.
Text & Labels tab: the chat interface

| String | Where the customer sees it |
|---|---|
| Button Label | The offer button on the product page ("Make an Offer") |
| Chat Greeting | The bot's first message when the chat opens |
| Deal Button Label | The button shown when a deal is reached ("Buy now at agreed price") |
| Send Button / Input Placeholder / Typing Indicator | The chat controls |
| Error Message | Shown in the chat if the connection fails |
Customer Notices tab: cart and checkout messages
Four notices explain why a deal was removed or interrupted. Each supports placeholders that are replaced automatically:

| Notice | Shown when | Placeholders |
|---|---|---|
| Deal Expired | The negotiated price ran out of time | - |
| Price Changed | The product's price changed since the deal | {product} |
| Quantity Changed | The cart quantity no longer matches the deal | {product}, {qty} |
| Chat Error | The AI response failed mid-conversation | - |
haggle-bot). Labels that are not settings - such as the Original Price / Negotiated Price / You Saved rows - are translatable through the normal WordPress translation workflow with tools like Loco Translate or Poedit.Developer Hooks
A few filters for developers who want to customize behaviour:
| Filter | Purpose |
|---|---|
hagglebot_setting_{key} | Override any single setting value at read time. For example, hagglebot_setting_persona filters the persona. |
hagglebot_error_message | Rewrite the error message returned to the chat. Receives the message and the error code (hagglebot_auth_error, hagglebot_rate_limit, hagglebot_request_error). |
hagglebot_rate_limit | Change the per-visitor hourly request cap (default 30). |
hagglebot_settings_fields | Modify the settings schema itself. |
// Example: raise the rate limit to 60 requests per hour.
add_filter ( 'hagglebot_rate_limit', function () {
return 60;
} );
Troubleshooting
Error messages and what they actually mean
| Message | Meaning | Fix |
|---|---|---|
| Invalid API key. Please check it and try again. | The provider rejected your key. This includes malformed Gemini keys, which Gemini reports in an unusual way - the plugin detects it correctly. | Re-copy the key from the provider's console into Settings → AI Provider, then run Test Connection. |
| Request rejected. Check your selected model. | The key works, but the chosen model was not accepted - usually a model your account cannot access. | Pick a different model in the Model dropdown and run Test Connection. |
| The shop assistant is very busy right now. | The provider returned a rate-limit or overload response (this is what your customers see instead of technical jargon). On a free Gemini key this usually means the daily quota is used up. | Wait, or move to a billed tier for higher limits. |
| Sorry, I had trouble there. Could you repeat your offer? | One AI response failed mid-chat; the conversation can continue. | Nothing, unless it repeats - then check System Status. |
Common situations
| Symptom | Likely cause |
|---|---|
| No offer button on a product | The product fails a scope rule, is priced below Minimum Product Price, or has its own Negotiation setting on Disabled. The System Status page confirms the plugin itself is healthy. |
| Offer button looks unstyled or misplaced | A theme's own button CSS is interfering. The plugin's styles are written to win against common themes; if your theme still overrides them, a small CSS snippet targeting .hb-offer-btn restores the intended look. |
| Deal disappeared from the cart | It expired, the product's price changed, or the quantity rule removed it. In every case a notice explains why - deals are never removed silently. |
| Bot will not go as low as expected | Check which floor actually applies: a variation or product override beats the global setting. The cascade in The Floor System shows the order. |
| Bot went lower than the global Maximum Discount | Almost always a quantity tier, or a product-level override. Both are designed to go past the global default. |
FAQ
Can a clever customer trick the AI into a crazy price?
They can trick the AI into saying anything, but not into selling at any price. Every proposed price is validated on your server against your floor, and the final deal price comes from the plugin's own record, not the browser. The AI has no authority over prices at all.
Do customers ever see my floor?
No. The floor lives on your server and is never sent to the browser. The bot negotiates toward it without revealing it.
How much will the AI cost me?
Typically very little. Negotiations are short and the recommended models are the small, fast ones - a complete haggle usually costs a fraction of a cent on paid tiers, and Gemini offers a free tier that suits low-traffic stores. The per-visitor rate limit keeps a single visitor from running up your bill.
Which provider should I choose?
Start with Gemini: the free tier means you can try everything at zero cost. All three providers negotiate well; your floors are enforced by the plugin regardless of the provider or model, so the choice affects tone and cost, never safety.
Does it work with variable products?
Fully. Each variation can carry its own floor, the chat follows the selected variation, and changing the variation mid-negotiation closes the chat so the deal always matches what is in front of the customer.
Is tax included in the negotiation?
Negotiation happens on the pre-tax price. Tax is then applied by WooCommerce as normal at checkout.
How do updates work?
Updates are published on CodeCanyon; download the new version and update the plugin from the WordPress admin. Your settings and deal history are preserved.