=== ShowPro Quote Request ===
Contributors: showpro
Tags: quote, request a quote, hide price, catalog mode, b2b
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a Request a Quote button to WooCommerce products. Hide prices and manage quote requests from an admin inbox. B2B and wholesale ready.

== Description ==

**ShowPro Quote Request** replaces the WooCommerce Add to Cart button with a quote request form on any product. The frontend is built with vanilla JavaScript (no jQuery dependency), stores all data in your WordPress database, and connects to no external services.

Built for **B2B stores, wholesale suppliers, manufacturers, and service businesses** that negotiate pricing before checkout. Enable the quote button per product: some products can still use Add to Cart while others collect quote requests.

= What's included =

* **Vanilla JavaScript frontend** — the quote form is built in, no jQuery and no separate form plugin required
* **Self-contained** — all data stays in your WordPress database; no external API or service is used
* **Free** — all features are included; there is no paid tier
* **HPOS compatible** — WooCommerce High-Performance Order Storage supported
* **WordPress 7.0 tested** — works with current WordPress and WooCommerce

= Perfect for =

* **B2B and wholesale stores** — hide retail prices, accept custom pricing requests
* **Manufacturers and industrial suppliers** — products with variable pricing or minimum order quantities
* **Custom and made-to-order products** — jewellery, furniture, signage, print, apparel
* **High-ticket items** — luxury goods, industrial equipment, enterprise software licences
* **Service businesses** — agencies, consultants, and freelancers using WooCommerce
* **Catalog mode shops** — disable purchasing entirely, collect enquiries only

= How it works =

1. Edit a product → open the **Quote Settings** tab in WooCommerce product data.
2. Check **Enable quote request**. Optionally check **Hide price**.
3. On the frontend, the Add to Cart button is replaced by a **"Request a Quote"** button — on the shop page and the single product page.
4. Customers click the button, fill in an accessible modal form, and submit.
5. You receive an **email notification** with all their details and a dashboard link.
6. The customer receives a **confirmation email** automatically.
7. Manage everything from **ShowPro → Quote Requests** — your clean admin inbox.

= Features =

**Quote button control**

* Enable the quote request button per product — other products are completely unchanged
* Optionally hide the product price on shop listings and the single product page
* Customise the button label from Settings (default: "Request a Quote")
* Set button alignment: Left, Center, or Right

**Accessible quote form**

* Opens in a modal — no page reload, no redirect
* Accessible: focus trap, ESC to close, ARIA labels on all fields
* `aria-live` regions announce errors and the success message to screen readers
* Honeypot spam protection — no CAPTCHA required
* Optional form fields: phone number, company name, quantity (toggle in Settings)
* Works at 320 px — tested on the narrowest common phone viewport

**Admin inbox**

* Clean custom list table: Date, Customer, Email, Product, Status at a glance
* Filter by status: **New**, **Replied**, **Closed** — with counts per tab
* Search quotes by customer name or email address
* Change status inline from the list — no page reload needed
* Bulk delete

**Quote detail view**

* All customer info and the product they enquired about
* Direct link to the product
* Internal notes field — private, never shown to the customer
* Status dropdown — update and save in one click
* Back to Quotes link for fast navigation

**Email notifications**

* Admin notification email — HTML template with all customer details and a direct dashboard link
* Customer confirmation email — HTML template with a summary of what they requested
* Both templates are **overridable by your theme** by copying them to `{theme}/showpro-quote-request/`
* Plugin updates never overwrite your custom templates

**Settings page**

* Recipient email address for admin notifications
* Button text
* Button alignment (Left / Center / Right)
* Success message shown in the modal after submission
* Toggle optional form fields: phone, company name, quantity

**Developer-friendly architecture**

* Clean OOP PHP with namespaces — `ShowPro\QuoteRequest\`
* Vanilla JS on the frontend — zero jQuery dependency
* Shared **ShowPro** admin menu — future ShowPro plugins add their submenus automatically
* Documented action hook for third-party integration: `do_action( 'showpro_register_module', $args )`
* Translation-ready with the `showpro-quote-request` text domain

= Privacy and data handling =

* No data is sent to any external server or third-party service
* Quote submissions are stored in your WordPress database as a custom post type
* A partial IP address (last octet masked for IPv4) is stored per quote for basic audit purposes
* Plugin settings are deleted on uninstall; quote post data is **intentionally preserved** so you never lose request history

== Installation ==

= From WordPress.org (recommended) =

1. Go to **Plugins → Add New** in your WordPress admin.
2. Search for *ShowPro Request a Quote* or *Request a Quote WooCommerce*.
3. Click **Install Now**, then **Activate**.
4. WooCommerce must be active — the plugin will tell you if it is not.

= Manual installation =

1. Download the zip file and extract the `showpro-quote-request` folder.
2. Upload it to `/wp-content/plugins/` via FTP or the WordPress file manager.
3. Activate through **Plugins → Installed Plugins**.

= First-time setup (2 minutes) =

1. Go to **ShowPro → Settings** and confirm the recipient email address for quote notifications.
2. Optionally update the button text and success message.
3. Edit any WooCommerce product, open the **Quote Settings** tab, and check **Enable quote request**.
4. Visit the product on the frontend — the quote button should appear where Add to Cart was.

== Frequently Asked Questions ==

= Does this work with variable products? =

Yes. The quote button replaces the entire Add to Cart form for **all WooCommerce product types** — simple, variable, grouped, and external/affiliate.

= Can I use Add to Cart on most products and the quote button only on specific ones? =

Yes — the setting is per-product. Products without the quote option enabled behave exactly as they did before you installed the plugin.

= Can I hide the price on quote-enabled products? =

Yes. The **Hide price** checkbox in the product's Quote Settings tab removes the price from both the shop listing and the single product page. The price is hidden until you respond to the quote.

= Can I use this to run my WooCommerce store in catalog mode? =

Partially — you can enable the quote button and hide prices on all your products to prevent purchasing. For a full catalog mode (disable cart and checkout site-wide), you would combine this plugin with a catalog mode plugin.

= Can I change which fields appear in the quote form? =

Yes. Go to **ShowPro → Settings** and toggle phone number, company name, and quantity on or off. Name and email are always required.

= Can I change the position or alignment of the quote button? =

Yes. **ShowPro → Settings → Button Alignment** lets you choose Left, Center, or Right. The setting applies to both the shop loop and the single product page.

= How do I customise the email templates? =

Copy the template file from the plugin's `/templates/` folder into your theme directory:

* `{theme}/showpro-quote-request/email-admin.php` — admin notification
* `{theme}/showpro-quote-request/email-customer.php` — customer confirmation
* `{theme}/showpro-quote-request/modal.php` — the quote form modal

Your theme's copy takes priority over the plugin default. Plugin updates will never overwrite your customisations.

= Where are quote requests stored? =

In your WordPress database as a custom post type (`showpro_quote`). Quote data is never sent to any external service. You own your data completely.

= What happens to my quote data if I uninstall the plugin? =

Plugin settings (recipient email, button text, etc.) are deleted on uninstall. Quote post data is **intentionally preserved** — you will not lose your request history. If you want to remove the posts too, you can do so directly from the database.

= Is it compatible with WooCommerce High-Performance Order Storage (HPOS)? =

Yes. Compatibility is explicitly declared. The plugin uses its own custom post type for quotes and does not interact with WooCommerce orders at all.

= Does it work with WPML or Polylang? =

The plugin is fully translation-ready. All user-facing strings use the `showpro-quote-request` text domain. A `.pot` file can be generated with WP-CLI (`wp i18n make-pot`). Full WPML / Polylang testing is planned for v1.1.

= Is there a Pro version? =

The version on WordPress.org includes all of the features described above and is complete on its own. Additional features such as PDF quote generation may be offered separately in the future.

= Can other plugins add their own pages to the ShowPro admin menu? =

Yes. Any plugin (including future ShowPro plugins) can register a submenu using:

`do_action( 'showpro_register_module', [ 'menu_slug' => 'my-page', 'page_title' => 'My Page', 'menu_title' => 'My Page', 'capability' => 'manage_options', 'callback' => 'my_render_function', 'position' => 20 ] );`

Fire this on the `admin_menu` hook at priority < 10.

== Screenshots ==

1. The "Request a Quote" button replacing Add to Cart on a single product page.
2. The accessible quote request modal — mobile-friendly form with optional fields.
3. The ShowPro Quote Requests admin inbox — status filter tabs, search, and inline status change.
4. The single quote detail view — customer info, product link, internal notes, and status control.
5. The Quote Settings tab on the WooCommerce product editor — enable quote and hide price per product.
6. The ShowPro Settings page — button text, alignment, success message, and form field toggles.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release — no upgrade required.
