Add a make-an-offer button to WooCommerce products
Published Updated 3 min read
Antiques, second-hand gear, handmade work, commissions: plenty of WooCommerce stores sell things where the price is open to discussion. WooCommerce assumes it is not. You set a price, the customer adds to cart and pays. When the answer to 'will you take less?' is sometimes yes, the customer has to find a contact page and hope the message gets through.
Some themes, Astra among them, ship a Make an Offer button in their product templates. The button is there; nothing receives the offer, and the documentation points to paid add-ons. The missing backend is about forty lines of PHP: a button, an overlay form, an AJAX handler that validates and emails the offer, and a thank-you message. No database and no settings page.
Fixed prices all the way to checkout
Every part of WooCommerce's checkout assumes the price is settled: set a price, build a cart, pay the cart. Variations, sales and coupons change the number, but it is still fixed at the moment of purchase.
A negotiated price is not known until after a conversation, and most stores have that conversation by email or phone once the customer has left the product page. An offer form keeps them on the page and starts it straight away.
From the button to your inbox
The button hangs off woocommerce_after_add_to_cart_button, so it sits directly under Add to Cart on every single product page. It opens a full-screen overlay asking for name, email, offered price and an optional message.
The form posts over AJAX with a nonce. The handler checks the required fields, sanitises everything, and sends the offer with wp_mail to the admin address under Settings > General: subject 'New offer on [product name]', with the price, the customer's name, email and message, and a link to the product. The overlay then swaps the form for a thank-you message. Nothing is written to the database, and offers land in your inbox with everything else. Send yourself a test offer to confirm the email arrives.
Stores where the listed price is a starting point
Antiques and collectibles, where condition and provenance move the value. Vintage clothing, instruments and used camera gear. Handmade and custom work. Art and prints where editions and sizes vary. B2B stores where the price depends on volume.
It also suits consignment and resale, where the seller wants to hear what the market will pay before committing to a price. Put the button next to the listed price and see what comes in.
Counter-offers and offer records are bigger jobs
If you want the negotiation inside WordPress, with counter-offers and a pending-offer status on a WooCommerce order, YITH WooCommerce Make an Offer handles that flow. Here the email is the record, and the haggling happens outside.
If offers need storing for reporting or passing to a sales team, Gravity Forms keeps entries as well as sending notifications.
The button shows on every product and any number is accepted. A follow-up message can add a per-product checkbox to hide it and a minimum offer with an inline error, which stops low-ball offers before they reach you.
What you get
Included
- Make an Offer button on every WooCommerce single product page, placed after the Add to Cart button
- Overlay form collecting name, email, offered price, and an optional message from the visitor
- AJAX submission with nonce verification and server-side field validation before the email is sent
- Admin notification email with product name, product URL, offered price, and all customer-submitted fields
Not included
- Counter-offer workflow: the negotiation happens by email or phone after the offer arrives
- Offer history in WordPress: all records are in your email inbox, not the admin
- Per-product enable or disable: the button appears on all products by default
- Customer confirmation email: only the admin is notified when an offer is submitted
- Minimum offer threshold: any number the visitor enters is accepted as a valid submission
YITH WooCommerce Make an Offer does the things on the right. This build covers the part most sites use.
Questions
Does it work with variable products?
The button appears on variable products just as on simple ones, and the email includes the product name. It does not include the chosen variation; that would mean reading the variation ID from the hidden field WooCommerce's variation script fills in.
Can customers see the offers they have submitted?
No. They get a thank-you message and you get an email; there is no offer history in their account. If that matters, Gravity Forms with the User Submission addon is closer to what you need.
Will the button show up with my theme?
With any theme that uses WooCommerce's standard single product template. A theme that replaces the template entirely without calling woocommerce_after_add_to_cart_button will not show it. Most major themes call the hook.
Build it in Steem
The button opens the builder with this guide's prompt filled in, so you can change anything before it runs. Nothing is built, and nothing is charged, until you send it.
Read the prompt (293 words)
Build a WordPress plugin that adds a Make an Offer button to all WooCommerce single product pages. Hook into woocommerce_after_add_to_cart_button to render a button labelled 'Make an Offer'. When clicked, the button opens a full-screen overlay containing a form with four fields: Name (text input, required), Email (email input, required), Offered Price (number input, min 0.01, step 0.01, required), and Message (textarea, optional, placeholder 'Any questions or context about your offer'). Include a close button in the top-right corner of the overlay. On submit, use AJAX with a nonce created by wp_create_nonce to send the data to a PHP handler registered with wp_ajax_nopriv_submit_make_offer and wp_ajax_submit_make_offer. The handler verifies the nonce with wp_verify_nonce, checks that all required fields are present, sanitizes inputs with sanitize_text_field, sanitize_email, and floatval, retrieves the product title and permalink from the posted product ID, and sends a notification email to get_option('admin_email') using wp_mail. The email subject is 'New offer on [product title]'. The body is plain text with line breaks: 'Product: [title]', 'URL: [permalink]', 'Offered price: [price]', 'Name: [name]', 'Email: [email]', 'Message: [message]'. Return wp_send_json_success on success or wp_send_json_error with a message string on failure. On a success response, replace the form inside the overlay with the message 'Thank you. We have received your offer and will be in touch shortly.' and a Close button. On an error response, show the error message below the submit button without closing the overlay. Enqueue the JavaScript with wp_enqueue_script and add the overlay CSS with wp_add_inline_style. The overlay uses position fixed, covers the full viewport, has a semi-transparent dark background, and contains a centred white box with padding. Form fields are stacked with visible labels above each input. Do not write to the database. Do not add a settings page or admin menu.
Steem