Skip to content

Filters & hooks

Every configurable value is also a filter, so a theme or companion plugin can override it without touching the stored option.

Configuration

FilterOverrides
wc_pricebook_tiersTier definitions
wc_pricebook_rulesRule → taxonomy bindings
wc_pricebook_visibility_rolesVisibility role definitions

Identity & membership

FilterOverrides
wc_pricebook_pricing_userResolve the effective (parent) pricing user — see Multi-account
wc_pricebook_is_managerWhether a user is a pricing manager
wc_pricebook_user_tierWhether a user belongs to a given tier
wc_pricebook_category_rolesA user's category → role mappings

Meta keys

Point the plugin at a store's existing meta instead of its defaults:

FilterOverrides
wc_pricebook_user_meta_keysPer-user meta keys (My Products, include/exclude categories, category roles)
wc_pricebook_user_pricing_metaPer-customer product-price override meta key
wc_pricebook_base_metaMSRP / base price meta key
wc_pricebook_bulk_pricing_metaQuantity-break meta key

Pricing

FilterOverrides
wc_pricebook_tier_requires_explicit_sale_priceRequire a tier's own sale price to be "on sale" (default: fall back to the MSRP sale price when lower)
wc_pricebook_allow_zero_priceKeep 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:

FilterOverrides
wc_pricebook_export_settingsRecipient / schedule / role filter
wc_pricebook_export_product_idsThe product refs included in the export
wc_pricebook_export_user_queryThe WP_User_Query args used to gather users
wc_pricebook_export_batch_rowsTarget CSV rows per background (Action Scheduler) batch — default 5,000

Catalog export

Used by the catalog export. The module is off by defaultwc_pricebook_catalog_pdf_enabled opts in.

FilterOverrides
wc_pricebook_catalog_pdf_enabledRegister the shortcode + download endpoint (default false)
wc_pricebook_catalog_pdf_shortcodeThe buttons shortcode tag (default wc_pricebook_catalog)
wc_pricebook_catalog_pdf_url_shortcode / wc_pricebook_catalog_csv_url_shortcodeThe URL-only shortcode tags (default catalog_pdf_url / catalog_csv_url)
wc_pricebook_catalog_pdf_columnsFull-matrix columns — ordered [ tier_key => label ] (default MSRP + every tier)
wc_pricebook_catalog_pdf_show_full_matrixWhether a viewer sees the full matrix vs MSRP + their own price (default: managers)
wc_pricebook_catalog_pdf_excluded_categoriesProduct-category term IDs to leave out
wc_pricebook_catalog_pdf_skip_productPer-product skip flag ($skip, $product_id)
wc_pricebook_catalog_pdf_your_price_labelHeader for the customer's own-price column (default "Your Price")
wc_pricebook_catalog_pdf_button_label / wc_pricebook_catalog_csv_button_labelDownload button text
wc_pricebook_catalog_pdf_filename / wc_pricebook_catalog_csv_filenameDownloaded file names
wc_pricebook_catalog_pdf_mpdf_configmPDF constructor config (format, margins, tempDir)

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 );

Released under the GPL-2.0-or-later License.