=== Triogency Quote Manager – B2B & Wholesale Price Requests for WooCommerce ===
Contributors: tanveerahmedy
Tags: woocommerce, quote, request a quote, b2b, wholesale pricing
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.7
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Full B2B & wholesale quote workflow for WooCommerce — customers request custom prices, admins quote per item, customers select and buy.

== Description ==

**Triogency Quote Manager** adds a complete, end-to-end quote request system built for B2B and wholesale WooCommerce stores. Instead of buying at listed prices, customers add products to their cart and request a custom price quote. You review the request, set your prices per item, and send the quote back. The customer selects which items to purchase and completes payment through WooCommerce checkout — all seamlessly on your store.

**Perfect for:**

* B2B and wholesale stores with negotiated or tiered pricing
* Stores selling custom, configurable, or high-value products
* Businesses that require a quote-before-purchase workflow
* Any WooCommerce store where "request a price" is needed before checkout

**How it works:**

1. Customer adds products to the WooCommerce cart as usual
2. A **"Request a Quote"** button appears on the cart page
3. Customer fills in a short form (name, email, phone, optional message) and submits
4. Admin receives an email notification and reviews the request under **WooCommerce → Quotes**
5. Admin sets a quoted price per item, adds an optional note, and clicks **Send Quote**
6. Customer receives a personalised quote email with a link to review their prices
7. Customer selects the items they want to purchase and accepts the quote
8. A WooCommerce order is created automatically — customer is redirected to checkout to pay

**Key features:**

* **Seamless WooCommerce integration** — lives under WooCommerce in your admin menu
* **Per-item quoted pricing** — set a different custom price for each line item
* **Partial acceptance** — B2B customers can choose a subset of quoted items to buy
* **Automatic order creation** — accepted quotes become WooCommerce orders instantly
* **Email notifications** — customers and admins are notified at every stage
* **Guest support** — no account required to submit a quote request
* **Configurable expiry** — set how many days a sent quote remains valid (default: 7)
* **Custom button label** — change the cart button text from the settings page
* **Woodmart theme compatible**
* **Translation ready** — full `.pot` file included

**Quote Statuses:**

* `Pending` — submitted by the customer, awaiting admin review
* `Reviewing` — admin has opened the quote
* `Quoted` — admin has sent prices to the customer
* `Accepted` — customer accepted (order created)
* `Declined` — customer declined
* `Ordered` — converted to a WooCommerce order
* `Expired` — quote validity period has passed

== Installation ==

**From WordPress Dashboard (recommended):**

1. Go to **Plugins → Add New**
2. Search for **Triogency Quote Manager**
3. Click **Install Now**, then **Activate**

**Manual installation:**

1. Download the plugin zip file
2. Go to **Plugins → Add New → Upload Plugin**
3. Upload the zip and click **Install Now**, then **Activate Plugin**

**After activation:**

1. Go to **WooCommerce → Quote Settings**
2. Set your admin notification email, quote expiry period, and cart button label
3. Create two WordPress pages:
   - **Quote Request** page — add the shortcode `[tqm_quote_form]`
   - **My Quotes** page — add the shortcode `[tqm_my_quotes]`
4. Assign these pages in **WooCommerce → Quote Settings**
5. You're ready to receive B2B quote requests!

== Frequently Asked Questions ==

= Does this work without WooCommerce? =

No. Triogency Quote Manager requires WooCommerce to be installed and active.

= Can guest customers (not logged in) request quotes? =

Yes. Guests enter their name and email when submitting the quote form.

= Can a B2B customer accept only some of the quoted items? =

Yes. On the quote view page, customers can tick the specific items they want to purchase.

= What happens when a quote is accepted? =

A WooCommerce order is created automatically with the quoted prices. The customer is redirected to the WooCommerce checkout payment page to complete payment.

= How do I display the quote request form? =

Add the shortcode `[tqm_quote_form]` to any WordPress page.

= How do I show customers their submitted quotes? =

Add the shortcode `[tqm_my_quotes]` to any WordPress page.

= Can I change the "Request a Quote" button text? =

Yes. Go to **WooCommerce → Quote Settings** and update the **Cart Button Label** field.

= Is the plugin compatible with Woodmart theme? =

Yes, Triogency Quote Manager is tested and compatible with the Woodmart WooCommerce theme.

= How long are quotes valid? =

By default, quotes expire 7 days after being sent. You can change this under **WooCommerce → Quote Settings → Quote Expiry (days)**.

= Will customers receive emails? =

Yes. Customers receive a confirmation when their request is submitted, and an email with their quote and a link to view and accept it. Admins receive a notification for every new quote submitted.

== Screenshots ==

1. **Quote request form** — customers fill in details and submit from the cart page
2. **Admin quotes list** — view and manage all incoming B2B quote requests
3. **Admin quote detail** — set per-item prices and send the quote to the customer
4. **Customer quote view** — customers review prices, select items, and accept or decline
5. **Quote settings** — configure notification email, expiry, and button label

== Changelog ==

= 1.0.7 =
* Fixed: explicit absint() cast on printf placeholder for quote ID display (escaping completeness)
* Fixed: prices array sanitized with map_deep() immediately on input
* Fixed: nonce value re-read using already-sanitized variable instead of raw $_POST

= 1.0.6 =
* Security: added access-token verification to quote view shortcode (was previously publicly viewable by ID)
* Fixed: all function, class, hook, option, post type, and asset names renamed from 'tqm' to 'trioquma' prefix to avoid collisions
* Fixed: renamed all plugin files to match the new prefix

= 1.0.5 =
* Fixed: Tested up to updated to WordPress 7.0

= 1.0.4 =
* Fixed: nonce sanitization in form submission handler
* Fixed: output escaping on date, product image, and wc_price outputs
* Fixed: _n_noop calls now use hardcoded string literals (no variables)
* Added: Requires Plugins header for WooCommerce dependency
* Updated: Tested up to WordPress 6.9
* Updated: Contributors list corrected to tanveerahmedy

= 1.0.0 =
* Initial release
* Full B2B quote request → price → accept → order workflow
* Per-item quoted pricing
* Partial item acceptance
* Automatic WooCommerce order creation
* Email notifications for customers and admins
* Guest customer support
* Configurable quote expiry
* Woodmart theme compatibility
* Translation-ready with `.pot` file

== Upgrade Notice ==

= 1.0.0 =
Initial release of Triogency Quote Manager.
