WP Manifestindependent plugin directory
manifest / ecommerce / dahu-pricing

Dahu Pricing

Affichage des prix par rôle pour WooCommerce (niveaux professionnels, marges, switch Pro/Client, totaux composites/bundles) et correctifs de tarification des commandes admin pour le plugin Addify Role Based Pricing.

by Hugo Vial-Jaime · github.com/epilouptique/dahu-pricing · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/epilouptique/dahu-pricing/archive/refs/heads/main.zip

Role-based pricing display layer for WooCommerce: professional price tiers, margin display, a Pro/Client switch, and admin-order pricing fixes.

By Hugo Vial-Jaime — Dahu-Concept.

Description

Dahu Pricing adds everything customers and shop staff see around role-based pricing on a WooCommerce store. It is designed to run alongside a role-based pricing engine (such as Addify's "Role Based Pricing for WooCommerce"), which computes the actual prices — Dahu Pricing displays, labels and formats them, and fixes a few long-standing issues around admin-created orders.

Typical use case: a shop selling both to the public and to professional resellers ("Gold" / "Silver" tiers). Professionals see their net price and their margin; with one click they can switch the display to the public price to show the screen to their own customer without exposing the margin. The price actually charged is never affected by the display switch.

Features

  • Role → tier mapping, fully configurable: assign any WordPress role to a price tier; add a new professional role without touching the code.
  • Configurable price labels per tier (client price / professional price).
  • Margin display next to professional prices — percentage or multiplier coefficient — on simple, variable, composite and bundle product pages, and in the cart.
  • Pro/Client switch in the menu: purely visual, persisted per browser, never affects the amount charged.
  • Cart Block support: line totals and the estimated total follow the Pro/Client switch; total cart margin shown under the estimated total.
  • Role preview from the admin bar: browse the site with the real prices of any configured role, without logging out.
  • Product Bundles compatibility: applies role-based prices to fixed-price WooCommerce Product Bundles (not covered by the Addify engine itself).
  • Admin order fixes:
    • corrects a double-taxation bug where a tax-inclusive price was written into tax-exclusive order fields when adding products from the admin order screen;
    • applies role-based prices as soon as a customer is selected on a new order — before the order is saved — and recalculates existing lines when the customer changes.
  • Debug mode: window.DAHU_PRICING_DEBUG = true in the browser console enables diagnostic logging.

Installation

  1. Download the plugin zip (or clone this repository into wp-content/plugins/dahu-pricing).
  2. Upload it via Plugins → Add New → Upload Plugin, then activate it.
  3. Requirements: WordPress 6.0+, PHP 7.4+, WooCommerce 7.0+. A role-based pricing engine (Addify "Role Based Pricing for WooCommerce") is recommended — without it, the features that depend on computed role prices stay silently inactive.

Configuration

All settings are under WooCommerce → Tarification (a "Réglages" link is also available on the Plugins screen):

Setting Purpose
HT/TTC coefficient Derives the tax-free price shown to the relevant tier (default 1.2 = 20% VAT)
Apply to second tier Whether the coefficient also applies to the second tier
Role → tier mapping Assign any WordPress role to a price tier
Tool visibility roles Roles that see the switch and the role preview
Price labels Text shown before client / professional prices, per tier
Margin format Percentage (33.3 %), coefficient (×1.50), or hidden entirely

Changelog

1.3.3

  • Fix: composite components (WooCommerce Composite Products) were re-priced at their individual product price whenever an order was edited in the admin, losing the price set at configuration time (e.g. 0 for a warranty repair composite with a 100% discount). Their configured amounts are now preserved on any admin edit.

1.3.2

  • Fix: bundled items (WooCommerce Product Bundles components, priced via their parent bundle line) were re-priced at their individual product price whenever an order was edited in the admin. They now stay at 0, matching front-end orders — unless the component is configured as priced individually.

1.3.1

  • Plugins screen: version number shown before the "Réglages" action link; plugin row meta links now point to the Dahu-Concept website.

1.3.0

  • New margin display option "hide": the margin can now be hidden everywhere (product pages, composite/bundle panels, cart) via WooCommerce → Tarification → margin format.

1.2.1

  • Plugin metadata overhaul: GPL v2 or later license, GitHub plugin URI, standardized header, "Réglages" action link and custom row meta on the Plugins screen.
  • Documentation restructured (README.md / README.txt in English, RESUME_TECHNIQUE.md in French); removed the site-specific activation notice.

1.2.0

  • Role-based prices apply on admin order creation as soon as the customer is selected, without saving the order first; changing the customer recalculates all existing lines.

1.1.0

  • Project renamed to dahu-pricing. Double-taxation fix for admin-created order lines. Cart Block line totals follow the Pro/Client switch. Removed legacy admin-order buttons.

1.0.0

  • Margin display fixed on Bundle products. Cart Block estimated total follows the Pro/Client switch.

0.6.0

  • Role-based prices applied to fixed-price WooCommerce Product Bundles.

0.3.0 – 0.5.2

  • Configurable role/tier mapping and labels, Pro/Client switch, margin display, cart margin, role preview tool.

0.1.0 – 0.2.0

  • Initial consolidation of the pricing display layer; first version of the Pro/Client switch.

License

GPL v2 or later — see LICENSE or https://www.gnu.org/licenses/gpl-2.0.html.