=== Faisal B2B Wholesale for WooCommerce ===
Contributors: faisal182250
Tags: woocommerce, b2b, wholesale, catalog mode, role-based pricing
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.0.0
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A comprehensive, object-oriented WordPress plugin that adds a full B2B/B2C dual-mode experience to any WooCommerce store.

== Description ==

Faisal B2B Wholesale for WooCommerce is a complete solution for store owners looking to cater to both standard retail (B2C) customers and wholesale (B2B) clients simultaneously. 

Key features include role-based pricing tiers, catalog mode for guests, quick reorder capabilities, custom registration/login forms, and built-in lead generation tools like WhatsApp & Email enquiries.

= Features =
* **Role-Based Access:** Guests and B2C users see enquiry buttons; approved B2B members see prices and can purchase.
* **Pricing Tiers:** Per-product Tier 1 / Tier 2 wholesale prices stored as post meta.
* **B2B Registration & Login:** Custom shortcode forms with a comprehensive pending-to-approved approval workflow.
* **Admin Approvals:** One-click approval (Tier 1 or Tier 2) or rejection panel under WooCommerce menu.
* **Modern B2B Dashboard:** Approved users get a responsive dashboard with profile editing and recent order insights.
* **Product Meta Display:** Displays SKU, Size/Spec, Packing Qty, MOQ, and Stock Status on single products.
* **WhatsApp & Email Enquiry:** Automated pre-filled messages for quick lead captures.
* **Quick Reorder:** One-click reorder from My Account dashboard and orders table.
* **Elementor Support:** Drag-and-drop B2B Product Grid widget with Quick Add and tier pricing support.
* **HPOS Compatible:** Fully supports WooCommerce High-Performance Order Storage.

== Installation ==

1. Upload the `faisal-b2b-wholesale-for-woocommerce/` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Navigate to **WooCommerce -> B2B Suite** to configure your setup.

== User Roles ==

* **b2b_pending:** Newly registered B2B user — prices hidden until approved.
* **b2b_tier1:** Approved B2B — Tier 1 wholesale pricing.
* **b2b_tier2:** Approved B2B — Tier 2 wholesale pricing (deeper discount).

== Shortcodes ==

* `[b2b_suite_faisal_register_form]` - Renders the B2B registration application form.
* `[b2b_suite_faisal_login_form]` - Renders the modern B2B login form.
* `[b2b_suite_faisal_popular_products limit="6" title="Popular Products"]` - Product grid sorted by popularity.

== Product Custom Fields ==

Configure these custom meta fields under **Product Data -> General**:
* `_b2b_price_tier1` : Wholesale Price (Tier 1)
* `_b2b_price_tier2` : Wholesale Price (Tier 2)
* `_b2b_size_spec` : Size / Spec
* `_b2b_packing_qty` : Packing Qty (Units per carton)
* `_b2b_moq` : Minimum Order Quantity (MOQ)

== Hooks & Filters ==

= Actions =
* `b2b_suite_faisal_user_registered` ($user_id) - Fires after a new B2B user registers.
* `b2b_suite_faisal_user_approved` ($user_id) - Fires after an admin approves a B2B account.

= Filters =
The plugin tightly integrates with standard WooCommerce price hooks:
* `woocommerce_get_price_html`
* `woocommerce_is_purchasable`
* `woocommerce_product_get_price`
* `woocommerce_add_to_cart_fragments`

== Screenshots ==

1. This is the main configuration dashboard under WooCommerce settings.
2. Custom B2B registration form rendered via shortcode.

== Changelog ==

= 1.0.0 =
* Initial release.