Table of Contents
This reference lists the PHP hooks and filters exposed by Price by Quantity & Bulk Quantity Discounts for WooCommerce so developers can customize pricing, tables and the quantity dropdown. Names are current as of Pro 4.1.0. Add your callbacks in a child theme’s functions.php or a small custom plugin.
Pricing and quantity filters #
| Filter | What it lets you change |
|---|---|
alg_wc_wholesale_pricing_get_levels_data |
The array of pricing levels resolved for a product. |
alg_wc_wholesale_pricing_get_discount_type |
The discount type used for a product and quantity. |
alg_wc_wholesale_pricing_get_total_quantity |
The total quantity counted towards levels (used by the grouping options). |
alg_wc_wholesale_pricing_get_placeholders |
The placeholder values available to templates. |
alg_wc_ppq_discount_by_quantity |
The computed discount for a given quantity. |
alg_wc_wholesale_pricing_is_enabled_per_term |
Whether per-term (category or tag) pricing is enabled for a product. |
alg_wc_wholesale_pricing_settings_per_item_get_options |
The per-product / per-term option definitions. |
Table and products-list filters #
| Filter | What it lets you change |
|---|---|
alg_wc_product_ppq_table_placeholders |
Placeholders available inside the product pricing table. |
alg_wc_product_ppq_table_rows |
The full set of rows before the table is rendered. |
alg_wc_product_wholesale_pricing_table_heading_format |
The heading format per level. |
alg_wc_ppq_products_list_query_args |
The wc_get_products() query args for the products-list shortcode. |
alg_wc_ppq_products_list_row |
Each product row in the products list. |
alg_wc_ppq_products_list_custom_column |
Output for a custom (unrecognized) column value. |
Quantity dropdown filters (Pro) #
| Filter | What it lets you change |
|---|---|
alg_wc_wholesale_pricing_dropdown_custom_levels |
The custom values used to build the dropdown. |
alg_wc_wholesale_pricing_dropdown_levels_data_raw |
The raw level data before filtering. |
alg_wc_wholesale_pricing_dropdown_levels_data |
The final level data after filtering. |
alg_wc_wholesale_pricing_dropdown_input_value |
The default selected value. |
alg_wc_wholesale_pricing_dropdown_option_label |
Each option’s label. |
alg_wc_wholesale_pricing_dropdown_option_style |
Each option’s inline style. |
alg_wc_wholesale_pricing_dropdown_option_class |
Each option’s CSS class. |
Real-time price display filters #
| Filter | What it lets you change |
|---|---|
alg_wc_ppq_price_display_by_qty_is_product |
Whether the real-time price display runs on the current page. |
alg_wc_ppq_price_display_by_qty_product_id |
The product id used for the real-time price display. |
Actions #
| Action | When it fires |
|---|---|
alg_wc_wholesale_pricing_core_loaded |
After the plugin core is loaded, passing the core instance. Use it to hook into pricing early. |
alg_wc_wholesale_pricing_settings_saved |
After the plugin’s settings are saved. |
Example #
Round every computed dropdown quantity label to add “pcs.”:
add_filter( 'alg_wc_wholesale_pricing_dropdown_option_label', function( $label, $qty ) {
return $label . ' pcs.';
}, 10, 2 );
Note: the internal alg_wc_wholesale_pricing_settings filter is used by the plugin itself to gate Pro-only options and is not intended for site code.
Need a hand? #
Our team answers every ticket on the Price by Quantity support forum.