=== Anka Quote Basket for WooCommerce ===
Contributors: hadilenya
Tags: catalog mode, hide price, enquiry, rfq, quote
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.1
WC requires at least: 8.0
WC tested up to: 11.0
Stable tag: 4.7.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Quote basket for WooCommerce: catalog mode, hide prices, multi-product RFQ requests, and priced replies by email.

== Description ==

Turn WooCommerce into a **request-for-quote** workflow. Shoppers add products to a quote basket, send one enquiry, and you reply from the admin — with optional priced PDF offers. Use it alone as catalog mode, or keep normal checkout for some products and quotes for others.

Ideal when you sell by project price, wholesale enquiry, or custom / industrial equipment — not only when every product has a fixed checkout price.

Suitable for:

* B2B and wholesale catalogs (enquiry instead of instant checkout)
* Catalog-mode stores that hide Add to cart and collect quote requests
* Industrial, engineering, and project-priced products
* Shops that keep checkout for some products and quotes for others

= What customers do =

* Add products to a quote basket from the product page or catalog (variable products included)
* Adjust quantities on the quote page
* Submit a short contact form as one quote request

= What you get =

* Incoming quote requests in WordPress admin (filter, search, CSV export)
* Email to your sales address, with editable templates and live preview
* Optional confirmation email to the customer
* Optional PDF attached to the admin email
* Reply with unit prices and email a priced PDF offer (Quoted status)
* Customer accept or decline from a signed link in the priced email (no account required)
* Optional quote expiry (off by default so existing quotes never expire on their own)
* After the customer accepts, create a WooCommerce order from the quote (manual; pending payment)
* Floating quote-basket button (can be turned off)
* Hide prices and/or Hide Add to cart, with role exemptions and optional category limits
* No tracking, no licence checks, and no data sent to third-party servers — quotes stay in your site and go out through WordPress mail

= Shortcodes =

* `[ankaquba_form]` — quote basket + form
* `[ankaquba_menu]` — quote basket link with item count

Put the form shortcode on a page, then choose that page under **Quote Requests → Settings**.

If you upgraded from an older version and a page still shows a raw shortcode, change it to one of the tags above. Common older tags are rewritten automatically when possible.

== Installation ==

1. Upload the `anka-quote-basket-for-woocommerce` folder to `/wp-content/plugins/`, or install the zip via Plugins → Add New → Upload.
2. Activate the plugin (WooCommerce must be active).
3. Open **Quote Requests → Settings**.
4. Confirm the quote page, recipient email, labels, and email templates.
5. (Optional) Turn on the floating menu button, hide prices, and/or hide Add to cart.

== Frequently Asked Questions ==

= Do I need to exclude the quote page from cache? =

No. Many quote forms break behind full-page cache because the security token on the page goes stale. This plugin refreshes that token right before submit, so you do not need a special cache exclusion for the quote page.

= Does this replace WooCommerce checkout? =

No. You can keep checkout and quotes together, or hide Add to cart for a quote-only catalog. When Add to cart is hidden, variation and quantity fields still work so variable products remain usable.

= Does the plugin hide prices? =

Yes. Under **Quote Requests → Settings** turn on **Hide price**. Shop managers still see prices; you can exempt other roles too. You can limit Hide price / Hide Add to Cart to selected categories (leave empty for all products), and optionally show replacement text such as “Request a quote”. Hide price is independent of Hide Add to Cart.

= Can I send a priced offer back to the customer? =

Yes. Open an incoming quote, enter unit prices, and send a priced email with PDF. The quote status becomes Quoted. When customer response is enabled (the default for new installs), that email includes a link to accept or decline. After they accept, you can create a WooCommerce order from the quote screen. Creating the order is a manual admin action, not automatic.

= Do priced quotes expire? =

Only if you set a number of days under Settings → Behavior. 0 days (the default) means no expiry. Quotes that have no valid-until date never expire.

= Does the plugin send data to other companies? =

No. There is no tracking and no licence phone-home. Quote requests are stored in your WordPress database and emailed to the address you set.

= Can I customize the emails? =

Yes. Under Settings → Email you can edit subjects and HTML bodies. Leave a body empty to use the built-in template. A live preview shows sample data.

= What PHP version is required? =

PHP 8.1 or higher.

= I used an older plugin folder or shortcode =

Activate **Anka Quote Basket for WooCommerce**. Your quotes and settings are kept. You can remove old folders such as `product-quote-list-for-woocommerce` or `woo-quote` after activating this one. If a page still shows a raw shortcode, use `[ankaquba_form]` or `[ankaquba_menu]`.

= Is a PDF library required? =

No. A PDF engine ships with the plugin for nicer PDFs. If it cannot load, a simple PDF fallback is used so quotes still send.

== Screenshots ==

1. Product page — Add to Quote List button on the product.
2. Quote page — multi-product basket, quantities, privacy consent, and the request form.
3. Incoming quotes — filter by status, search, and CSV export in WordPress admin.
4. Quote details — set unit prices, email a priced PDF offer, and after the customer accepts, create a WooCommerce order.
5. Catalog mode — hide prices and/or Add to cart, with role exemptions and category scope.
6. Email settings — accordion templates with live preview and Insert placeholder.
7. General settings — quote page, recipients, and floating button.
8. Behavior — menu nudge, duplicates, minimum quantity, and variable catalog mode.
9. Labels — custom button and message texts.
10. Appearance and data — accent color, Add to Quote button style, and data options.

== Changelog ==

= 4.7.0 =
* Quote lifecycle: the customer can accept or decline a priced offer from a signed link (no WordPress account). GET never records a decision; POST does, with a nonce.
* Optional validity period when you email a priced quote (0 days by default, so existing quotes do not expire). Expired is computed from the date — no WP-Cron.
* After Accepted, create a WooCommerce order from the quote details screen (pending payment, quoted unit prices). Manual only; blocked if store currency no longer matches the quote.
* Priced PDF, customer email, and the response page share one B2B document layout (your logo, accent colour, and PDF footer — not a hardcoded brand).
* Default priced-email template includes a Review and respond button when customer response is on. A saved custom priced-email body is not overwritten.

= 4.6.0 =
* Appearance: **Theme button** style matches your theme’s WooCommerce buttons (plugin chrome off). Accent / solid / outline modes unchanged for existing stores.
* Button placement: product page (after price, after add to cart, beside add to cart, near meta) and shop/list (after, before, or replace add to cart). Defaults match previous behaviour.
* Floating quote button: left or right side, adjustable edge spacing (mobile keeps the previous 12px inset when using the default offset).
* Settings Appearance: compact dropdowns with live hints (`render_select`), replacing tall choice cards for these options.
* Hardening: temp PDF `.htaccess` denies access on Apache 2.4 and 2.2; admin quote search logs when WordPress’s search SQL shape no longer matches.

= 4.5.2 =
* Compatibility: tested with WordPress 7.1 and WooCommerce 11.0. No functional changes.

= 4.5.1 =
* Hotfix: ship the missing `includes/class-product-meta.php` file that 4.5.0 required but did not include in the WordPress.org package (fatal error on update).

= 4.5.0 =
* Per-product catalog rule: a single control in the product editor's Advanced tab overrides the store-wide rules for one product — **Use store catalog rules** (default), **Force quote catalog**, or **Force normal purchase**.
* "Force normal purchase" also hides the Add to Quote button on that product, so a quote-only catalog can keep selling individual items normally.
* Variations follow their parent product; the rule is set once on the variable product.
* The default stays "Use store catalog rules", so existing stores behave exactly as before until a product is changed.
* New filter `ankaquba_product_catalog_mode` for resolving the rule in code.
* Quote form **privacy consent** (on by default): notice + required checkbox. Optionally pick a Consent page under Behavior; otherwise the WordPress privacy policy is used. Acceptance is recorded on the quote.
* Appearance: **Add to Quote style** (Button or Text link) and **Button look** (Solid or Outline). Defaults keep the previous solid dark pill.
* Settings: vertical sidebar with icons; footer actions for **Save settings** and **Reset to defaults**; toggle switches and choice cards styled with the plugin accent.
* Incoming quotes list and edit screens share the same admin design language as Settings (accent surfaces, rounded fields, status badges, accent primary actions).

= 4.4.0 =
* Catalog mode: **Hide price** (independent of Hide Add to Cart), optional replacement label, role exemptions, and product-category scope.
* Admin priced response: set unit prices on an incoming quote and email a priced PDF offer (status Quoted). No checkout/order conversion.
* Incoming quotes: filter by status, search by email/phone, sortable status, and CSV export (formula-injection safe).
* Email settings UX: accordion sections (admin / customer confirmation / priced quote / PDF) with Insert placeholder pickers.
* Assets split into core / catalog / form bundles; form CSS/JS load only on form pages (no FOUC).
* Catalog add-to-quote script also loads on the front page / home and on pages that embed product shortcodes or blocks (buttons were visible but clicks did nothing).
* Developer hook API (19 hooks): button, item data, rate limit, quote lifecycle, email/PDF filters, catalog/hide-price filters, priced-quote actions.
* Readme: catalog-mode / enquiry positioning for end users (display name and slug unchanged).

Older entries are kept in `changelog.txt`, bundled with the plugin.

== Upgrade Notice ==

= 4.7.0 =
Priced quotes can be accepted or declined by the customer, may expire if you set a validity period, and can be turned into a WooCommerce order after accept. Existing quotes and custom email bodies are unchanged. Stores using the default priced-email template will see a respond button.

= 4.6.0 =
Theme-matching quote buttons, placement controls, and floating-button position. Existing stores keep the previous look until you change Appearance settings.

= 4.5.2 =
Compatibility update: tested with WordPress 7.1 and WooCommerce 11.0.

= 4.5.1 =
Critical hotfix: restores the missing product-meta file that broke sites after updating to 4.5.0.

= 4.5.0 =
Per-product catalog rule, privacy consent, Add to Quote button styles, and a vertical settings sidebar. Existing stores keep previous look and catalog behaviour until you change a setting.

= 4.3.1 =
Catalog-mode fix for variable products and quantities, plus a cache-safe nonce refresh on quote submit.

= 4.3.0 =
All internal names moved to the ankaquba prefix. Settings, quotes and page shortcodes migrate automatically on the first load; check the admin notice if a page is listed as needing a manual edit. Custom CSS targeting .woo-quote-* classes needs renaming to .ankaquba-*.
