=== NBKB B2B Wholesale for WooCommerce – Wholesale Prices, Role Based Pricing & Registration ===
Contributors: nbkblabs
Tags: woocommerce-wholesale, wholesale-prices, b2b, role-based-pricing, wholesale-pricing
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.1.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

The complete B2B wholesale solution for WooCommerce. Add role-based wholesale prices, custom roles, tax exemption, and B2B registration.

== Description ==

**NBKB B2B Wholesale for WooCommerce** allows you to sell to wholesale and B2B buyers alongside regular retail customers on the same WooCommerce store, without duplicating products or slowing down your site.

Set dedicated wholesale prices for simple and variable products, create unlimited custom wholesale roles, configure global storewide role discounts, enforce minimum order quantities, offer automatic tax/VAT exemption, bulk manage prices with WooCommerce native CSV import/export, prevent retail coupon stacking, and register wholesale buyers through a dedicated B2B registration form.

---

### Why Choose NBKB B2B Wholesale

Easily manage wholesale pricing, custom roles, and minimum order quantities in WooCommerce without complicated configuration or heavy dependencies.

* **Unlimited Custom Roles:** Create as many customer tiers (VIP, Distributor, Trade Partner) as your business needs with custom role labels and global discounts.
* **Lightweight & Fast:** Built with native WooCommerce data structures and fully compatible with High-Performance Order Storage (HPOS).
* **Hybrid B2B & B2C:** Sell to regular retail shoppers and verified wholesale buyers from the exact same product catalog.
* **Privacy by Default:** Wholesale pricing is completely hidden from guests and retail shoppers until approved wholesale buyers log in.

---

### Key Features

* **Unlimited Custom Wholesale Roles:** Create, edit, and delete custom wholesale roles (such as VIP, Distributor, or Trade Partner) with standard WordPress role capabilities.
* **Global Storewide Role Discounts:** Set catalog-wide percentage discounts for specific wholesale roles from a single settings page.
* **Simple Product Wholesale Pricing:** Set dedicated wholesale prices and minimum order quantities (MOQ) on simple products.
* **Variable Product Wholesale Pricing:** Set independent wholesale prices and minimum order quantities for each product variation (size, color, etc.).
* **Automatic Tax & VAT Exemption:** Automatically exempt verified wholesale customers from sales tax and VAT at checkout with a simple 1-click admin toggle.
* **Native WooCommerce CSV Bulk Import & Export:** Bulk import and export wholesale prices and minimum quantities directly through standard WooCommerce CSV product tools.
* **Disable Retail Coupons for Wholesale:** Prevent wholesale buyers from stacking retail marketing coupons on top of already discounted wholesale rates.
* **Custom Wholesale Price Label:** Brand your wholesale price badge (e.g. "Trade Price", "VIP Price", "Wholesale") and optionally hide crossed-out regular retail prices.
* **Guest Wholesale Notice:** Display a subtle notice on product pages prompting retail visitors to log in or apply for a wholesale account.
* **Dedicated Wholesale Registration Form:** Register commercial buyers easily using the clean `[nbkb_b2b_registration]` shortcode.
* **Order Details & Savings:** View wholesale savings, customer role snapshots, and item pricing directly in WooCommerce order details.
* **High-Performance Order Storage (HPOS):** Native compatibility with WooCommerce custom order tables (`custom_order_tables`).
* **WooCommerce Cart & Checkout Blocks:** Full compatibility with modern block checkout and classic shortcode checkout.
* **Developer Friendly:** Clean hooks (`do_action` and `apply_filters`) for developers creating custom integrations.

---

### Free vs Pro Feature Comparison

| Feature | Free Core Plugin | Pro Enterprise Add-on |
| :--- | :---: | :---: |
| **Unlimited Custom Wholesale Roles** | ✅ **Included** | ✅ **Included** |
| **Global Storewide Role Discounts** | ✅ **Included** | ✅ **Included** |
| **Simple Product Wholesale Pricing** | ✅ **Included** | ✅ **Included** |
| **Variable Product Wholesale Pricing** | ✅ **Included** | ✅ **Included** |
| **Minimum Order Quantities (MOQ)** | ✅ **Included** | ✅ **Included** |
| **Automatic Tax & VAT Exemption** | ✅ **Included** | ✅ **Included** |
| **B2B Registration Form** | ✅ **Included** | ✅ **Included** |
| **Disable Retail Coupons on Wholesale** | ✅ **Included** | ✅ **Included** |
| **Custom Wholesale Price Label** | ✅ **Included** | ✅ **Included** |
| **Native WooCommerce CSV Import/Export** | ✅ **Included** | ✅ **Included** |
| **Hide Strikethrough Retail Prices** | ✅ **Included** | ✅ **Included** |
| **Dynamic Tiered Volume Pricing Tables** | ❌ Pro Only | ✅ **Included** |
| **Manual Admin Account Approval Queue** | ❌ Pro Only | ✅ **Included** |
| **B2B Request a Quote System** | ❌ Pro Only | ✅ **Included** |
| **Payment Gateway & Shipping Restrictions** | ❌ Pro Only | ✅ **Included** |
| **Role-Based Tier Quantity Breaks** | ❌ Pro Only | ✅ **Included** |

---

### NBKB B2B Wholesale Pro Add-on

If you need tiered quantity pricing, quote requests, or manual account approvals, **NBKB B2B Wholesale Pro** adds these capabilities:

* **Tiered Volume Pricing Tables:** Display tiered quantity pricing tables on product pages (e.g. Buy 10+ get 15% off, Buy 50+ get 25% off) with dynamic price recalculation.
* **Role-Specific Tier Pricing:** Set different volume discount breaks for specific customer roles (e.g. VIP roles get different tier rates than standard wholesale).
* **Manual Account Approval Queue:** Review wholesale customer registrations with company tax ID/VAT details before approving accounts.
* **Request a Quote:** Let buyers request price quotes from product pages and convert approved quotes into WooCommerce orders with one click.
* **Payment and Shipping Restrictions:** Restrict specific payment gateways (like BACS or invoice) and shipping methods to wholesale customer groups.

Learn more and view the live demo at [nbkblabs.com](https://nbkblabs.com/b2b-wholesale/?utm_source=wporg&utm_medium=readme&utm_campaign=lite_listing).

---

== Installation ==

1. Upload the `nbkb-b2b-wholesale` folder to the `/wp-content/plugins/` directory, or install directly via your WordPress Admin Plugins screen (`Plugins > Add New`).
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Navigate to **B2B Wholesale** (or **WooCommerce > B2B Wholesale**) to configure your settings.
4. Edit any Simple or Variable product in **Products > All Products** to set your wholesale prices.

== Frequently Asked Questions ==

= Does this plugin support variable products? =
Yes. You can configure independent wholesale prices and minimum order quantities for each product variation (size, color, etc.) directly in the product variation settings.

= How do customers become wholesale buyers? =
Customers can register directly using the `[nbkb_b2b_registration]` shortcode on any page, or store administrators can manually assign the "Wholesale Customer" role under **Users > All Users**.

= Can I import wholesale prices using WooCommerce CSV Import? =
Yes. NBKB B2B Wholesale integrates directly with WooCommerce's native Product CSV Importer and Exporter. You will see dedicated "Wholesale Price" and "Wholesale Min Quantity" columns in your CSV files.

= Does this plugin prevent wholesale customers from using retail coupons? =
Yes. Enable the "Disable Retail Coupons" toggle in **B2B Wholesale > Settings**. Wholesale buyers will be prevented from applying retail coupons at checkout.

= Can I change the "Wholesale Price" text to "Trade Price" or "VIP Rate"? =
Yes. You can set any custom label under **B2B Wholesale > Settings**. You can also choose to hide the original retail crossed-out price so wholesale customers only see the wholesale rate.

= Is this plugin compatible with WooCommerce HPOS? =
Yes, NBKB B2B Wholesale is built with native compatibility for High-Performance Order Storage (HPOS / Custom Order Tables) and WooCommerce Cart & Checkout Blocks.

== Screenshots ==

1. Custom Wholesale Roles Manager: Create unlimited custom customer roles and configure global storewide discounts (B2B Wholesale > Wholesale Roles).
2. Product Data Wholesale Pricing: Set dedicated wholesale prices and minimum order quantities (MOQ) on simple and variable products (Products > Edit Product).
3. General Wholesale Settings: Configure wholesale price labels, hide strikethrough retail prices, retail coupon blocker, and automatic tax exemption.
4. Order Management and Badges: High-Performance Order Storage (HPOS) order list with dedicated B2B Wholesale badges and company tags (WooCommerce > Orders).
5. B2B Wholesale Account Registration Form: Dedicated commercial customer registration form with company name, tax ID/VAT, and contact details ([nbkb_b2b_registration]).

== Changelog ==

= 1.2.1.3 =
* Enhancement: Updated in-app upgrade links to direct to the dedicated B2B Wholesale product page.
* Tweak: Refreshed plugin visual assets with centered, evergreen repository display banners.

= 1.2.1.2 =
* Enhancement: Added helpful storefront preview note for store administrators in the product pricing metabox.
* Fix: Synchronized catalog and cart pricing by basing role discounts on regular price to prevent double-discounting on retail sale prices.
* Optimization: Compacted directory short description to under 150 characters for clean display in WordPress search cards.

= 1.2.1.1 =
* Tweak: Streamlined "Upgrade to Pro" admin submenu with highlighted background styling and clean title (removed redundant PRO tag).
* Tweak: Polished post-activation welcome notice to use clean native WordPress notice markup with a direct settings link.
* Fix: Extended review request notice delay to a strict 14 days to ensure new store owners are never interrupted early.
* Tweak: Updated B2B Wholesale admin menu icon with a crisp, brand-matched monochrome vector monogram.

= 1.2.1 =
* Feature: Dedicated Top-Level Admin Menu - Added prominent "B2B Wholesale" main sidebar menu with custom NBKB brand icon for easy access.
* Feature: Dynamic Sidebar Submenus - Directly navigate to Settings, Wholesale Roles, and Pro modules from the WordPress sidebar.
* Feature: Post-Activation Onboarding Banner - Welcome notice with quick links to the B2B dashboard and wholesale roles manager.
* Enhancement: Retained backward-compatible menu access under WooCommerce > B2B Wholesale.

= 1.2.0 =
* Feature: Custom Wholesale Roles Manager - Create, edit, and delete unlimited custom wholesale customer roles (such as VIP, Distributor, or Trade Partner) from B2B Wholesale > Wholesale Roles.
* Feature: Global Storewide Role Discounts - Configure dedicated storewide percentage discounts across all catalog items for specific wholesale customer groups.
* Enhancement: Safe role deletion with automatic user reassignment to default wholesale customer role to ensure zero orphaned customer accounts.
* Performance: Optimized wholesale role runtime caching and filter bridges.

= 1.1.0 =
* Feature: Added coupon restriction option to disable retail coupons for wholesale buyers at checkout to prevent double discounting.
* Feature: Added custom Wholesale Price Label setting to personalize price badges (e.g. "Trade Price", "VIP Price", "Wholesale").
* Feature: Added toggle to hide crossed-out regular retail prices from wholesale customers.
* Feature: Added native WooCommerce CSV Product Import & Export integration for bulk wholesale pricing and minimum quantities.
* Feature: Added guest and retail wholesale availability notice on product pages with direct login and registration links.

= 1.0.1 =
* Fix: Resolved variation Wholesale Price label styling and alignment in admin product editor.
* Fix: Automatically update frontend quantity input to the variation's minimum wholesale order quantity upon variation selection.
* Fix: Enforced variation-level minimum order quantity during cart validation and add-to-cart process.

= 1.0.0 =
* Initial public release.
* Added role-based pricing for Simple and Variable products.
* Added automatic tax/VAT exemption for wholesale roles.
* Added [nbkb_b2b_registration] frontend registration shortcode.
* Added permanent B2B order metadata and line item savings tracking.
* Added full HPOS (Custom Order Tables) and Cart/Checkout Blocks compatibility.
