1. WooCommerce Wholesale Pro
  2. Developer Documentation

Actions and Filters

WooCommerce Wholesale Pro comes with some filters which allow you to customize the plugin's behavior.

Please note that this code is aimed at developers and if you don't know how to use it then you should ask your developer.

We've partnered with Codeable to provide our customers with expert help if required.

Filters

wcwp_enable_wholesale_price_calculation

This filter allows you to disable the wholesale price calculation and output for specific conditions. In the example below we disable it for a user with a specific ID.

add_filter( 'wcwp_enable_wholesale_price_calculation', function( $enabled, $product, $user, $price ) {
    if ( $user->ID === 5 ) {
        $enabled = false;
    }
    return $enabled;
}, 10, 4 );

Related Articles

If searching the knowledge base hasn't answered your question, please contact support.