=== Zevvo Request a Quote ===
Contributors: zevvolabs
Tags: woocommerce, request a quote, quote, rfq, hide price
Requires at least: 6.3
Tested up to: 7.2
Stable tag: 1.0.0
Requires PHP: 7.4
WC tested up to: 11.3
WC requires at least: 8.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Hide prices, let customers request a quote, price it in the order editor, and turn accepted quotes into real WooCommerce orders. HPOS compatible.

== Description ==

**Zevvo Request a Quote** lets customers ask for a price instead of buying straight away. You price the request in the normal WooCommerce order editor, send the quote, and when the customer accepts it becomes a regular order they pay on the standard pay page. Nothing is locked behind a paid version.

Quotes are WooCommerce orders with their own statuses, so you get the order editor, emails, stock handling and payments you already know. Quotes are never counted as sales and never reduce stock before they are paid.

= Features =

* **Quote rules at three levels** — Turn quoting on for every product, for chosen categories, or per product. Product settings beat category settings, which beat the global setting.
* **Hide prices** — Replace the price with your own label (default "Price on request"), including variation prices and structured data.
* **Quote-only products** — Add to cart is hidden and refused on the server, while variable product selectors and quantity still work.
* **Add to quote button** — Works on single products and shop loops, with classic and block themes. Includes a `zevvo/quote-button` block for manual placement.
* **Quote list** — Guests and customers build a list, edit quantities and submit it with name, email, phone and a message.
* **Optional address step** — Collect billing, or billing and shipping, with the standard WooCommerce country and state fields.
* **Price in the order editor** — A Quote box lets you add a note, send the quote and copy the quote link. Quotes have their own menu under WooCommerce and stay out of your normal Orders list.
* **Customer quote page** — Customers view the quote with a private link, then accept or reject it (with an optional reason). Logged-in customers also find quotes under My Account.
* **Five editable emails** — New request, request received, quote ready, quote accepted, quote rejected, all under WooCommerce → Settings → Emails.
* **HPOS and block compatible** — Declares High-Performance Order Storage and Cart and Checkout blocks compatibility.
* **Clean analytics** — Quote statuses are excluded from WooCommerce Analytics.
* **Spam protection** — Honeypot field, field length limits, a nonce on submission and a per-IP rate limit, plus a filter for adding a CAPTCHA.
* **Developer friendly** — Stable actions and filters, plus template overrides.
* **Privacy first** — Your data is only removed on uninstall if you turn that setting on, and orders are never deleted.

= Requirements =

WordPress 6.3+, PHP 7.4+, WooCommerce 8.0+.

= Developer hooks =

* Actions: `zevvo_rq_loaded`, `zevvo_rq_quote_requested`, `zevvo_rq_quote_sent`, `zevvo_rq_quote_accepted`, `zevvo_rq_quote_rejected`
* Filters: `zevvo_rq_form_fields`, `zevvo_rq_is_quote_product`, `zevvo_rq_quote_statuses`, `zevvo_rq_quote_page_actions`, `zevvo_rq_settings_sections`, `zevvo_rq_validate_submission`, `zevvo_rq_rate_limit`, `zevvo_rq_client_ip`, `zevvo_rq_existing_quote_page_id`

== Installation ==

1. Make sure WooCommerce is installed and active.
2. Upload the plugin files to `/wp-content/plugins/zevvo-request-a-quote`, or install it from the Plugins screen.
3. Activate the plugin through the **Plugins** screen. A "Request a Quote" page is created for you.
4. Go to **WooCommerce → Settings → Quotes** and choose which products are quote products, whether to hide prices, and your labels.
5. Optionally enable quoting on single products from the **Product data** box (classic product editor), or per category from the Quotes settings.
6. Quote requests appear under **WooCommerce → Quotes**.

== Frequently Asked Questions ==

= How does a quote become an order? =

You open the request under WooCommerce → Quotes, set the prices with the standard item editor, add a note and click **Send quote**. The customer gets an email with a link to their quote page. When they click **Accept**, the order moves to Pending payment and they are sent to the normal WooCommerce pay page.

= Do customers have to log in? =

No. Guests can request quotes. Their quote page is protected by the private key in the link we email them. If the quote belongs to a registered customer and the person opening the link is logged out, they are asked to log in at the pay page.

= Why is my customer asked to confirm their email on the pay page? =

WooCommerce can ask guests to confirm the billing email before showing the pay page. The quote email was already sent to that address, so the customer simply types it in.

= Are quotes really orders? Will other plugins see them? =

Yes, quotes are WooCommerce orders with their own statuses: Quote requested, Quote sent and Quote rejected. WooCommerce still fires `woocommerce_new_order` when they are created, so integrations (CRM, accounting, shipping) hooked to that action may see quotes as orders. Quotes are excluded from Analytics, are not counted as paid and do not reduce stock.

= What happens to quotes if I deactivate the plugin? =

The quote statuses are registered by the plugin, so while it is deactivated WooCommerce does not know them and those orders will show an unknown status. Reactivate the plugin to see them normally again. Deactivating never deletes any orders.

= Why are there gaps in my order numbers? =

Quotes use normal order IDs. A rejected quote (or a quote that was never accepted) keeps its number, so the orders you actually sell can skip numbers.

= Can customers still see prices through the API? =

The public WooCommerce Store API products endpoint (`/wp-json/wc/store/v1/products`) still exposes prices. Hiding prices removes them from the storefront, structured data and cart, but is not an access control. Do not rely on it to keep prices secret from determined visitors.

= What does "quote-only" mean for products with a hidden price? =

Products whose price is hidden are quote-only: the Add to cart button is removed from the page (hidden and disabled in block themes, hidden by CSS in classic themes) and the server refuses add-to-cart requests for them. The product remains technically purchasable behind the scenes so variation selectors and the pay page keep working.

= How do the product, category and global rules work together? =

The product setting wins over the category setting, which wins over the global setting. If a product belongs to several categories, a rule on any enabled category applies. A rule on a parent category applies to its subcategories too.

= What does the "Collect address" setting do? =

It controls whether the quote form asks for an address: **Off**, **Billing**, or **Billing + shipping** (default). The pay page never asks for an address, so collect it here if you need it to calculate shipping or taxes.

= Will the quote page be cached? =

The quote page and the quote view send no-cache headers and set `DONOTCACHEPAGE`, so page caches do not serve stale nonces or quote lists. If your cache ignores those signals, exclude the "Request a Quote" page from caching.

= How are quote requests protected from spam? =

Every submission must pass a hidden honeypot field, field length limits (for example 200 characters for the name and 5,000 for the message) and a per-IP rate limit: 5 successful requests per IP every 10 minutes. Invalid submissions do not count towards the limit. Change the limit with the `zevvo_rq_rate_limit` filter, for example `add_filter( 'zevvo_rq_rate_limit', function () { return array( 'limit' => 10, 'window' => 3600 ); } );`.

= How do I add a CAPTCHA (e.g. Cloudflare Turnstile or reCAPTCHA)? =

Print the CAPTCHA widget in the form (for example through the `zevvo_rq_form_fields` filter or a template override) and verify its token with the `zevvo_rq_validate_submission` filter. It runs after the form is validated and before the quote is created, receives all submitted values, and refuses the request when you return a `WP_Error`, whose message is shown to the visitor:

`add_filter( 'zevvo_rq_validate_submission', function ( $valid, $posted ) { return my_captcha_ok( $posted ) ? $valid : new WP_Error( 'captcha', 'Please complete the CAPTCHA.' ); }, 10, 2 );`

= My site is behind a reverse proxy or CDN. Is the rate limit per visitor? =

By default the rate limit uses `REMOTE_ADDR`, because forwarded headers can be faked. Behind a trusted proxy or CDN every visitor may share the proxy's address, so return the real visitor IP with the `zevvo_rq_client_ip` filter, reading the header your proxy sets (for example `CF-Connecting-IP` on Cloudflare) only when the request really comes from the proxy.

= Where are the product quote settings? =

In the **Product data** box of the classic product editor (General tab). The new block-based product editor is not supported yet; quote rules set by category or globally apply to all products either way.

= Can I customise the templates? =

Yes. Copy a file from the plugin's `templates` folder to `yourtheme/zevvo-request-a-quote/` and edit it there.

= Can I change the email text? =

Yes. All five emails are listed under **WooCommerce → Settings → Emails**, where you can change recipients, subjects, headings and the email template.

= Is it compatible with HPOS and the block cart and checkout? =

Yes, both compatibility flags are declared. The Add to quote button works with classic themes and block themes.

= Which versions are supported? =

WordPress 6.3+, PHP 7.4+ and WooCommerce 8.0+. It is tested up to WooCommerce 11.3.

= What is removed when I delete the plugin? =

Nothing, unless you turn on **Remove data on uninstall** in WooCommerce → Settings → Quotes. If enabled, the Request a Quote page and the plugin's settings and cached data are deleted. Orders and quotes are never deleted.

== Screenshots ==

1. A quote product on the shop page: the price is replaced by "Price on request" and an "Add to quote" button.
2. The quote list: customers adjust quantities and send their request with name, email, phone and a message.
3. Quote requests under WooCommerce → Quotes, kept apart from your normal Orders list.
4. Pricing a request in the standard order editor, with the Quote box to add a note, send the quote and copy its link.
5. The "Your quote is ready" email the customer receives.
6. The customer's quote page with Accept and Reject buttons.
7. After accepting, the customer pays on the normal WooCommerce pay page with any of your payment methods.
8. Settings under WooCommerce → Settings → Quotes: global, category and label options.
9. Per-product quote settings in the Product data box.

== Changelog ==

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.0.0 =
Initial release of Zevvo Request a Quote.
