=== Entrepo — B2B & Wholesale for WooCommerce ===
Contributors: abelcainrodriguezrodriguez, freemius
Tags: b2b, wholesale, woocommerce, vat, eu vat
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 0.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Wholesale prices per customer group for WooCommerce, with company registration, admin approval and rules for who may see prices.

== Description ==

Entrepo adds wholesale pricing to a WooCommerce store. You group your business
customers, give each group its own prices, and decide who is allowed to see
them.

This is what you get by installing the plugin from this page:

* B2B customer groups, as many as you need, each with its own discount percentage.
* The group's net price served in the shop, on the product page and in the cart, read from a table that is calculated when a product is saved rather than on every page load.
* Company registration with company name, VAT number and country. The account waits in a "pending approval" state until an administrator approves it and assigns a group from the WordPress Users list.
* Three visibility modes: prices for everyone, prices hidden from visitors who are not signed in, or prices restricted to customers who belong to a wholesale group. Guests see a sign-in notice and cannot add to cart.
* Spanish VAT rate classes (21/10/0%) created in one click.
* An admin panel for groups, customers and settings, on top of its own REST API.

Hiding prices covers WooCommerce's public Store API as well as the theme, so a
direct HTTP request returns empty amounts instead of the prices the store is
hiding. The authenticated REST API is left untouched on purpose, so an ERP
or a stock integration keeps working.

There is a paid Pro version that adds price overrides per product and
variation, a simulator that shows the exact price a given customer would pay,
and automatic VIES validation with the intra-Community exemption and the
Spanish equivalence surcharge. The section below lists the split in full.

== Installation ==

1. Upload the `entrepo` folder to `/wp-content/plugins/`.
2. Activate the plugin.
3. Go to Entrepo → Groups and create your first wholesale group with its discount.

== Free vs Pro ==

The free version runs a wholesale store on its own: groups, prices per group,
company registration with approval, and the visibility rules. Nothing in the
list below stops working after any period of time.

**Included in the free version:**

* Unlimited B2B groups, each with its own discount %.
* Net price per role served in store and cart.
* B2B registration (company name, VAT number, country) with manual admin approval.
* Hide prices and purchasing from guests or from all non-B2B customers.
* One-click Spanish VAT configurator.
* Automatic catalog recalculation when a group is created or its discount is
  edited, so the prices customers see always match the group settings.

**Exclusive to the Pro plan:**

* Price overrides per product/variation (Pricing editor).
* "What does this customer see?" simulator.
* Automatic VIES validation + intra-Community exemption + equivalence surcharge.
* Scheduled or on-demand recalculation of the full catalog (coming soon).

If a Pro subscription lapses, you stop receiving updates and priority support,
but nothing you already had configured switches off. The Pro gate applies to
activating and configuring new features, never to the running of what you had
already set up.

== Frequently Asked Questions ==

= Does the price-hiding feature cover the API? =

Yes, since 0.2.0. Both modes that hide prices, the one that hides them from
visitors who are not signed in and the one that restricts them to wholesale
customers, cover two surfaces:

* The **storefront**: shop archive, product page and cart.
* WooCommerce's **public Store API**, the one that needs no credentials: the
  product list, a single product, and the price range used by filter blocks.
  Amounts come back empty and the product is reported as not purchasable, so
  a direct HTTP request sees exactly what a browser would.

The rest of the product stays intact, including name, images and stock,
because hiding a price is not the same as unpublishing the catalogue.

Two deliberate limits, stated so nobody meets them by surprise:

* The authenticated REST API is **not** filtered. It needs API keys, so
  whoever calls it is the merchant or their own integration, such as an ERP or
  a stock sync, and hiding prices there would break legitimate tooling.
* Store administrators and shop managers are never affected, in any mode.
  They have to be able to review their own store.

In 0.1.0 the Store API was not covered. If you are on 0.1.0 and rely on price
hiding, update.

= What does uninstalling delete? =

Deactivating the plugin changes nothing: all your data stays intact. Only when
you DELETE it from the plugins list does it clean up every trace of itself:

* The precalculated pricing table it creates.
* The plugin's settings (B2B groups, schema version, tax and visibility
  settings, recalculation status).
* Each customer's B2B data (company name, VAT number, country, approval
  date, equivalence surcharge, and VIES validation history).
* Price overrides per product/variation.
* B2B group roles and the "pending approval" role (customers who had them
  become regular `customer`s).
* Any scheduled tasks of its own (bulk recalculation, VIES validation).

**Two things uninstalling NEVER deletes, on purpose:**

1. **The data on your ALREADY-ISSUED orders** (the intra-Community exemption
   legal notice, the VIES query proof and its date, the shipping-mismatch
   notice). These are part of the fiscal record of an already-issued
   invoice. You are required to keep them even if you uninstall the plugin,
   so Entrepo never touches them, not even on removal.
2. **The VAT classes and rates the configurator seeded** in your store
   (21/10/0% + equivalence surcharge). These are tax configuration that
   belongs to YOUR WooCommerce store, not to the plugin, and may still be in
   use by historical orders or existing products, and deleting them would break
   those.

== Screenshots ==

1. Wholesale groups, each with its discount and the number of customers assigned to it.
2. Company registrations waiting for approval, with the details submitted at sign-up.
3. Choosing who is allowed to see prices in the store.

== Changelog ==

= 0.2.1 =
* Removed a shortcut on the dashboard that pointed to a screen not included in this version and returned a permissions error when clicked.
* Rewrote the changelog for 0.1.0 in plain language and removed internal build notes that were not useful to store owners.

= 0.2.0 =
* B2B visibility now also covers WooCommerce's public Store API: product list, single product and the price-range aggregation return empty amounts and report the product as not purchasable. In 0.1.0 an unauthenticated HTTP client could still read prices the store meant to hide.
* The authenticated REST API is deliberately left untouched, so ERP and stock integrations keep working.

= 0.1.0 =
First public release.
* B2B customer groups, each with its own discount percentage, implemented as WordPress roles so the rest of your store treats them as ordinary customers.
* Net prices per group, resolved from a precalculated table so the storefront and cart never recalculate at runtime.
* Company registration with company name, VAT number and country, held for approval by an administrator from the WordPress Users list.
* Visibility modes: show prices to everyone, hide them from visitors who are not signed in, or restrict them to customers in a wholesale group.
* Admin panel with a dashboard, group management and the list of customers awaiting approval.
* One-click Spanish VAT setup: enables tax calculation and creates the 21/10/0% rate classes.
* Clean uninstall that removes the plugin's own data and always keeps the tax details recorded on issued orders and the store's VAT rates.
See the "Free vs Pro" section above for the features that require the Pro version.

== Translations ==

Entrepo is written in English and ships with a complete Spanish translation,
including the strings used by the admin panel. The legal notice for the
intra-Community exemption on invoices follows the language of the store: a
store set to Spanish gets the Spanish legal wording, any other language gets
the English one.
