=== DreamFox Role & Wholesale Pricing for WooCommerce ===
Contributors: dreamfox
Tags: woocommerce, role based pricing, wholesale, b2b, dynamic pricing
Requires at least: 6.0
Tested up to: 7.0.4
Requires PHP: 7.4
WC requires at least: 7.0
WC tested up to: 11.0.1
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Set WooCommerce product prices and discounts per user role. Wholesale, B2B and customer-specific pricing made easy.

== Description ==

**DreamFox Role & Wholesale Pricing for WooCommerce** lets you charge different prices to different types of customers. Give wholesale buyers a storewide discount, set exact per-product prices for B2B accounts, hide prices from guests, and much more.

Works with both the classic checkout shortcode and the new WooCommerce Block Cart & Checkout: role-based pricing, tax display, payment gateway restrictions, shipping method restrictions and order limits all apply the same way regardless of which checkout your theme uses.

= Free features =

* **Global role discounts** – percentage or fixed discount (or markup) per user role, applied storewide.
* **Per-product role pricing** – set a fixed price, percentage discount/markup or fixed discount/markup per role on any simple product.
* **Hide prices for guests** – replace prices with a customizable "Log in to see prices" message and disable purchasing for visitors who are not logged in.
* **Sale price behavior** – choose whether role discounts apply on top of the sale price or the regular price.
* **Price display options** – strikethrough original prices and an optional "You save X%" badge.
* **Guest pseudo-role** – target visitors who are not logged in with their own pricing rules.
* **Request a Quote mode** – replace price and add-to-cart with a quote request form for selected roles.
* **Order limits per role** – minimum/maximum cart quantity and order amount per role.
* **Role based tax display** – show prices including VAT to consumers and excluding VAT to business roles.
* **Payment and shipping restrictions** – limit payment gateways and shipping methods per role.
* **CSV import/export** – move all pricing rules between sites in seconds.

= Premium features =

* **Variable products** – per-variation role pricing rules.
* **Category and tag rules** – price whole categories or tags per role, with smart priority resolution (customer > product > variation > category > tag > global).
* **Tiered quantity pricing** – bulk discounts per role (e.g. 10+ units get an extra 5% off).
* **Customer-specific pricing** – individual price overrides per customer, on top of role rules.
* **Scheduled rules** – give every rule a start and end date/time, perfect for B2B promo weeks.
* **Multiple roles strategy** – lowest price, highest price or first match for users with several roles.
* **Role analytics** – revenue, orders and discount totals per role.
* **REST API and WP-CLI** – manage pricing rules programmatically.

Built by [DreamFox Media](https://dreamfoxmedia.com).

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/dreamfox-role-wholesale-pricing`, or install through the WordPress plugins screen.
2. Activate the plugin through the 'Plugins' screen.
3. Go to **WooCommerce → Role Based Pricing** to configure your pricing rules.

== Frequently Asked Questions ==

= Does this work with variable products? =

Per-variation pricing rules are a premium feature. In the free version, rules set on the parent product are used.

= Can I hide prices from visitors who are not logged in? =

Yes. Enable "Hide prices for guests" on the Display tab and optionally customize the message shown instead of the price.

= What happens when a user has multiple roles? =

By default the first matching rule is used. The premium version lets you choose: lowest price, highest price or first match.

= Is the plugin compatible with HPOS (High-Performance Order Storage)? =

Yes, the plugin declares full HPOS compatibility.

= Does this work with the new WooCommerce Block Checkout? =

Yes. Role-based pricing, tax display, payment gateway restrictions, shipping method restrictions and cart order limits have all been verified against the WooCommerce Block Cart & Checkout, in addition to the classic `[woocommerce_checkout]` shortcode. The plugin declares `cart_checkout_blocks` compatibility.

= Does the plugin collect any data about my site? =

Only if you agree to it. Nothing is sent to us or to any third party unless you accept the opt-in screen shown after activation, which you are free to skip. See the "External services" section for exactly what is sent, and only after which action.

== External services ==

This plugin uses the Freemius service (Freemius, Inc.) for license activation, license verification and update delivery for the paid version, and for optional, opt-in usage diagnostics.

**Nothing is sent unless you agree to it.** After activation the plugin shows the standard Freemius opt-in screen. Until you press "Allow & Continue" on that screen, no data about you or your site is transmitted. The screen can be dismissed with "Skip", and you can also expand it and turn individual permissions off before agreeing. Skipping leaves the plugin fully functional and sends nothing.

Data is only transmitted after you actively perform one of the following actions:

* **You accept the opt-in** ("Allow & Continue" on the opt-in screen, or the "Opt In" link next to the plugin on the WordPress Plugins screen). Only then is data sent to Freemius: your WordPress admin name and email address, site URL, WordPress version, PHP version and, if you leave that permission enabled, the list of active plugins and themes. It is used for product analytics and to notify you about plugin updates and security notices. You can opt out again at any time with the "Opt Out" link in the same place, which stops all further transmissions.
* **You activate a premium license key.** Your license key, site URL, WordPress version and PHP version are then sent to Freemius to validate the license and to deliver updates to the paid version. This is required for the licensing service to work.
* **You open the plugin's pricing or checkout screen**, which loads the current plan and pricing data from Freemius.

Service provider: Freemius, Inc. — https://freemius.com
API endpoint contacted: https://api.freemius.com
Terms of service: https://freemius.com/terms/
Privacy policy: https://freemius.com/privacy/

The plugin itself makes no other outbound connections. Quote request emails are sent with the standard WordPress mailer to the shop address you configure.

== Screenshots ==

1. Global role rules.
2. Per-product role pricing.
3. Display settings.
4. Role analytics.

== Changelog ==

= 1.2.0 =
* New: declares compatibility with the WooCommerce Block Cart & Checkout (`cart_checkout_blocks`). Role-based pricing, tax display, payment gateway restrictions, shipping method restrictions and cart order limits were manually verified against a live WooCommerce Block Checkout.
* Fix: role analytics (premium) now records the customer role and the granted discount for orders placed via the Block Checkout too. It previously only did this for the classic checkout, because the Block Checkout builds orders through a different WooCommerce code path that never fires the classic `woocommerce_checkout_create_order` hook.
* Dev: WC tested up to 11.0.1; WP tested up to 7.0.4.

= 1.1.5 =
* Dev: the Freemius SDK is now bundled in `freemius/` and loaded through `freemius/start.php`, the integration Freemius recommends, instead of being installed through Composer.
* Change: the standard Freemius opt-in screen (Allow & Continue / Skip / partial permissions) is used as shipped, replacing the anonymous mode introduced in 1.1.4.

= 1.1.4 =
* Privacy: the free version now runs the Freemius SDK in anonymous mode. No remote calls are made and no opt-in prompt is shown until the user opts in themselves.
* Docs: added an "External services" section and a privacy FAQ documenting exactly which data is sent to Freemius, and after which user action.

= 1.1.3 =
* Maintenance release.

= 1.1.2 =
* New: renamed to "DreamFox Role & Wholesale Pricing for WooCommerce" for a distinctive, WordPress.org-compliant plugin name and slug.
* Dev: premium pricing features (per-user, per-variation, category/tag, scheduled, multi-role strategy and quantity tiers) refactored behind filters and moved into the premium-only module, so the free build ships without locked code.
* Fix: request-a-quote toggle script is now properly enqueued instead of printed inline.

= 1.0.8 =
* Fix: dev-only files (`.distignore`, `.gitattributes`, `wp-env.json`, etc.) no longer end up in the distributed plugin zip.
* Fix: corrected nonce-verification suppression comment placement for variation rule saving.
* Dev: renamed internal Freemius accessor globals to consistently use the `rbpw_` prefix.
* Dev: removed discouraged `load_plugin_textdomain()` call; WordPress.org auto-loads translations since 4.6.

= 1.0.7 =
* Fix: guard plugin constants against redefinition when the plugin file is loaded more than once.

= 1.0.6 =
* New: Information tab as the first settings menu item, with plugin overview, feature lists and helpful links.
* Improved: uninstall cleanup now runs through the Freemius after_uninstall hook instead of uninstall.php.
* Dev: added CLI smoke tests for free and premium feature gating.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.2.0 =
Verified and declared compatible with the WooCommerce Block Checkout; also fixes premium role analytics for orders placed through it.

= 1.1.5 =
Uses the Freemius SDK and its standard opt-in screen exactly as Freemius recommends. Nothing is sent unless you agree.

= 1.1.4 =
No tracking without consent: the free version now stays fully anonymous until you opt in yourself.

= 1.0.8 =
Cleans up the distributed plugin package and fixes WordPress Plugin Check warnings.

= 1.0.7 =
Fixes PHP warnings about already-defined constants when the plugin loads more than once.

= 1.0.6 =
Adds the Information settings tab and improves uninstall cleanup.

= 1.0.0 =
Initial release.
