Appearance
Filters & hooks
Every configurable value is also a filter, so a theme or companion plugin can override it without touching the stored option.
Configuration
| Filter | Overrides |
|---|---|
wc_pricebook_tiers | Tier definitions |
wc_pricebook_rules | Rule → taxonomy bindings |
wc_pricebook_visibility_roles | Visibility role definitions |
Identity & membership
| Filter | Overrides |
|---|---|
wc_pricebook_pricing_user | Resolve the effective (parent) pricing user — see Multi-account |
wc_pricebook_is_manager | Whether a user is a pricing manager |
wc_pricebook_user_tier | Whether a user belongs to a given tier |
wc_pricebook_category_roles | A user's category → role mappings |
Meta keys
Point the plugin at a store's existing meta instead of its defaults:
| Filter | Overrides |
|---|---|
wc_pricebook_user_meta_keys | Per-user meta keys (My Products, include/exclude categories, category roles) |
wc_pricebook_user_pricing_meta | Per-customer product-price override meta key |
wc_pricebook_base_meta | MSRP / base price meta key |
wc_pricebook_bulk_pricing_meta | Quantity-break meta key |
Pricing
| Filter | Overrides |
|---|---|
wc_pricebook_tier_requires_explicit_sale_price | Require a tier's own sale price to be "on sale" (default: fall back to the MSRP sale price when lower) |
wc_pricebook_allow_zero_price | Keep a resolved $0 as a real price. Default false blanks it to "Call for Price" — see Price resolution |
Pricelist export
Used by the pricelist export:
| Filter | Overrides |
|---|---|
wc_pricebook_export_settings | Recipient / schedule / role filter |
wc_pricebook_export_product_ids | The product refs included in the export |
wc_pricebook_export_user_query | The WP_User_Query args used to gather users |
wc_pricebook_export_batch_rows | Target CSV rows per background (Action Scheduler) batch — default 5,000 |
Example
php
// Treat a custom capability as the "distributor" tier.
add_filter( 'wc_pricebook_user_tier', function ( $has, $user_id, $tier_key ) {
if ( 'distributor' === $tier_key ) {
return user_can( $user_id, 'b2b_customer' );
}
return $has;
}, 10, 3 );