Taxonomy/Term and Role-based Discounts for WooCommerce 8.6 has 24 actions and 56 filters, read directly from its source code on Nov 18, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when Taxonomy/Term and Role-based Discounts for WooCommerce fires an action
add_action( 'qm/stop', function( $arg1 ) {
// Your code runs here.
}, 10, 1 );
// Change a value Taxonomy/Term and Role-based Discounts for WooCommerce is about to use
add_filter( 'tdw_on_calculate_totals_non_default_rule_discount_price', function( $value, $cart_item, $_product, $is_variation, $rule, $rule_key, $base_price, $display_price, $discount_price, $discount_display_price, $term_id, $variations, $product_id_base ) {
// Change $value here.
return $value;
}, 10, 13 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * The pro should return false or an array with: - discount_price - * discount_price_over_regular - filtered_discount_price - * discount_display_price - base_price - variations Or false if the rule is not * to be applied */ apply_filters( 'tdw_on_calculate_totals_non_default_rule_discount_price', false, $cart_item, $_product, $is_variation, $rule, $rule_key, $base_price, $display_price, $discount_price, $discount_display_price, $term_id, $variations, $product_id_base ); -
do_action( 'qm/stop', 'WC_Taxonomy_Discounts_Webdados::get_discount_rules' ); -
do_action( 'qm/lap', 'WC_Taxonomy_Discounts_Webdados::get_discount_rules' ); -
apply_filters( 'tdw_dev_mode', false ); -
apply_filters( 'tdw_on_get_price_discount_price', $discount_price, $discount_price_over_regular, $_product, $rule ); -
do_action( 'wpml_switch_language', $language['code'] ); -
apply_filters( 'tdw_recheck_get_product_applied_rule', true, $rule, $product_id, $product_id_base, $base_price, $discount_price, $_product->get_regular_price(), $discount_price_over_regular ); -
do_action( 'qm/start', 'WC_Taxonomy_Discounts_Webdados::get_discount_rules' ); -
do_action( 'tdw_admin_after_taxonomy_name', $tax, $taxonomy['taxonomy'] ); -
apply_filters( 'tdw_admin_show_pro_link', true ); -
apply_filters( 'tdw_discount_information', ob_get_clean(), $product, $rule, $location ); -
apply_filters( 'tdw_loop_disc_info_action', false ); -
apply_filters( 'tdw_loop_disc_info_prio', false ); -
apply_filters( 'tdw_on_calculate_totals_non_default_rule_applied_rule', false, $rule ); -
apply_filters( 'tdw_on_get_price_non_default_rule_discount_price', false, $rule, $base_price, $_product, $force_calculation, $qty ); -
apply_filters( 'tdw_product_is_on_sale', $is_on_sale, $product, $originally_on_sale ); -
apply_filters( 'tdw_rule_deletable', true, $rule ); -
apply_filters( 'tdw_rule_editable', true, $rule ); -
apply_filters( 'tdw_single_disc_info_action', false ); -
apply_filters( 'tdw_single_disc_info_prio', false ); -
apply_filters( 'tdw_x_for_y_qtt_discounted', floatval( $rule['y'] ) * $multiplier, $rule ); -
apply_filters( 'wpml_element_language_code', null, array( 'element_id' => (int) $term_id, 'element_type' => $taxonomy, ) ); -
do_action( 'qm/debug', 'WC_Taxonomy_Discounts_Webdados cache enabled: ' . ( $this->enable_cache ? 'yes' : 'no' ) ); -
apply_filters( 'tdw_admin_add_form_taxonomies_options', $add_taxonomy_options ); -
do_action( 'tdw_admin_after_add_terms_dropdown' ); -
do_action( 'tdw_admin_after_discount_add_form' ); -
do_action( 'tdw_admin_after_discount_rules_table' ); -
do_action( 'tdw_admin_after_discount_type_edit_form', $rule ); -
do_action( 'tdw_admin_after_title' ); -
do_action( 'tdw_admin_after_x_for_y_add_form' ); -
do_action( 'tdw_admin_after_x_for_y_edit_form', $rule ); -
apply_filters( 'tdw_admin_available_user_roles', $options ); -
do_action( 'tdw_admin_before_discount_rules_table' ); -
do_action( 'tdw_admin_before_rules_table' ); -
do_action( 'tdw_admin_before_submit_add_form' ); -
do_action( 'tdw_admin_discount_rules_table_after_discount_type_info', $rule ); -
do_action( 'tdw_admin_discount_rules_table_after_rule', $rule ); -
do_action( 'tdw_admin_discount_rules_table_before_rule', $rule ); -
apply_filters( 'tdw_admin_discount_type_disabled', false, $discount_type ); -
apply_filters( 'tdw_admin_js_localization', array( 'string_are_you_sure_delete_rule' => esc_html__( 'Are you sure you want to permanently delete this discount rule?', 'taxonomy-discounts-woocommerce' ), 'string_form_validation_error' => esc_html__( 'Please correct the highlighted fields before saving.', 'taxonomy-discounts-woocommerce' ), 'string_rule_added' => esc_html__( 'Discount rule added.', 'taxonomy-discounts-woocommerce' ), 'stri... ); -
do_action( 'tdw_admin_non_default_edit_form', $rule ); -
apply_filters( 'tdw_admin_rule_active_display', $rule['active'], $rule ); -
apply_filters( 'tdw_admin_user_role_name', '', $user_role ); -
apply_filters( 'tdw_cart_item_subtotal_information', false ); -
apply_filters( 'tdw_custom_product_loop', false ); -
apply_filters( 'tdw_disable_is_on_sale_filter', false ); -
apply_filters( "tdw_discount_information_{$product->get_id()}", apply_filters( 'tdw_discount_information', ob_get_clean(), $product, $rule, $location ), $product, $rule, $location ); -
apply_filters( 'tdw_discount_information_display', true, $product, $rule, $location ); -
apply_filters( 'tdw_discount_information_non_default_rule', '', $product, $rule, $location ); -
apply_filters( 'tdw_discount_rules_database_cache', false ); -
apply_filters( 'tdw_discount_types', array( 'percentage', 'x-for-y' ) ); -
apply_filters( 'tdw_edit_rule_x_for_y_info', sprintf( __( 'For each %1$s bought %2$s is free', 'taxonomy-discounts-woocommerce' ), '<strong>' . intval( $rule['x'] ) . '</strong>', '<strong>' . intval( $rule['y'] ) . '</strong>' ), $rule ); -
apply_filters( 'tdw_enable_cache', true ); -
apply_filters( 'tdw_form_add_data', $data, $_POST ); -
apply_filters( 'tdw_form_add_data_before_save', $data, $_POST ); -
apply_filters( 'tdw_form_edit_data', $data, $_POST ); -
apply_filters( 'tdw_form_edit_data_before_save', $data, $_POST ); -
apply_filters( 'tdw_get_discount_rules', $discount_rules ); -
apply_filters( 'tdw_get_product_applied_rule', $rule, $product ); -
apply_filters( 'tdw_has_term_or_valid', false, has_term( $term_id, $taxonomy, $product_id ), $term_id, $taxonomy, $product_id ); -
apply_filters( 'tdw_non_default_rule_type_description', '', $type ); -
apply_filters( 'tdw_non_default_rule_type_name', 'error', $type ); -
do_action( 'tdw_non_default_rule_type_table_info', $rule ); -
tdw_on_calculate_totals_non_default_rule_aggregate_variation_price
filter Copy link Customise this hookapply_filters( 'tdw_on_calculate_totals_non_default_rule_aggregate_variation_price', false, $rule, $base_price, $display_price ); -
apply_filters( 'tdw_perc_sale_badge', false ); -
apply_filters( "tdw_perc_sale_badge_{$product->get_id()}", true ); -
apply_filters( 'tdw_perc_sale_badge_html', $new_html, $product, $rule ); -
apply_filters( 'tdw_perc_sale_badge_replace', true, $product, $rule, $new_html ); -
apply_filters( 'tdw_recheck_cart_applied_rule', true, $applied_rule, $cart_item ); -
do_action( 'tdw_rule_add', intval( $add_term ), $data['taxonomy'], $data ); -
apply_filters( 'tdw_rule_allows_discount_to_zero', $allow_to_zero, $rule ); -
do_action( 'tdw_rule_delete', $term_id, $data['taxonomy'], $data ); -
do_action( 'tdw_rule_edit', intval( $_POST['tdw-form-edit-term'] ), $data['taxonomy'], $data, $old_data ); -
apply_filters( 'tdw_rule_not_editable_or_deletable_notice', '', $rule ); -
apply_filters( 'tdw_rules_aggregate_variations', array( 'percentage' ) ); -
apply_filters( 'tdw_text_for_each_x_bought_y_free', __( 'For each <span class="tdw_discount_information_qty_bought">%1$s</span> bought <span class="tdw_discount_information_qty_free">%2$s</span> is free', 'taxonomy-discounts-woocommerce' ), $location, $rule ); -
apply_filters( 'tdw_text_from_x_bought_y_discount', __( 'From <span class="tdw_discount_information_min_qty">%1$d</span> bought, <span class="tdw_discount_information_percentage">%2$s%%</span> discount', 'taxonomy-discounts-woocommerce' ), $location, $rule ); -
apply_filters( 'tdw_text_x_discount', __( '<span class="tdw_discount_information_percentage">%s%%</span> discount', 'taxonomy-discounts-woocommerce' ), $location, $rule ); -
apply_filters( 'tdw_valid_rule_user_role', $return, $rule ); -
apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
Generated from Taxonomy/Term and Role-based Discounts for WooCommerce's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: