Skip to content

For developers

Developer Documentation

Architecture, data model, PHP API, hooks & filters, templates, JavaScript events and REST endpoints for extending the Tiered Pricing Table plugin.

On this page

Introduction

This page is for developers who want to adjust or extend Tiered Pricing Table for WooCommerce with code: read and change prices, override templates, hook into the JavaScript, use the REST API, and — most importantly — the complete list of actions and filters. Store-owner documentation lives in the User Guide.

Conventions

Code lives in the TierPricingTable\ namespace (src/), templates in views/. Every hook is prefixed with tiered_pricing_table/ and uses / as a separator, e.g. tiered_pricing_table/price/pricing_rule. Settings are options prefixed with tier_pricing_table_. Most filters can be hooked from a theme or plugin at any time; the three boot-time filters addons/list, integrations/plugins and integrations/themes run while the plugin file is included and must be hooked from a must-use plugin or a plugin loading before tier-pricing-table.

Prices and rules

Read the effective rule and price

use TierPricingTable\PriceManager;

$rule = PriceManager::getPricingRule( $product_id );   // TierPricingTable\PricingRule — product meta + role/customer/global rules applied

$rule->getRules();            // [ 5 => 9.5, 10 => 8.0 ] (fixed) or [ 5 => 10, 10 => 20 ] (percentage)
$rule->getType();             // 'fixed' | 'percentage'
$rule->getMinimum();          // ?int
$rule->provider;              // 'product' | 'role-based' | 'user-based' | 'global-rules' | …
$rule->providerData;          // e.g. [ 'rule_id' => 42, 'applying_type' => 'cross' ] or [ 'role' => 'wholesale' ]
$rule->data;                  // 'maximum_quantity', 'group_of_quantity', 'tier_labels', …
$rule->pricingData;           // base-price overrides: regular_price, sale_price, discount, discount_type, pricing_type, tax_status, tax_class

$unit = $rule->getTierPrice( 12 );                 // display price for qty 12 (false if below the first tier)
$unit = $rule->getTierPrice( 12, false, 'cart' );  // raw price, cart context

$has = ! empty( $rule->getRules() );
$has = \TierPricingTable\PricingTable::getInstance()->productHasPricingRules( $product ); // variable products too

Change the rule for any product

tiered_pricing_table/price/pricing_rule receives the PricingRule after product meta was read. Built-in providers use these priorities — pick yours relative to them: quantity limits 1, category rules 10, role-based 20, customer-based 25, global rules 30, request-a-quote 99, currency conversion 9999.

add_filter( 'tiered_pricing_table/price/pricing_rule', function ( \TierPricingTable\PricingRule $rule, int $productId ) {
    if ( has_term( 'clearance', 'product_cat', $productId ) ) {
        $rule->setType( 'percentage' );
        $rule->setRules( [ 3 => 15, 6 => 25 ] );      // 15 % off from 3 units, 25 % from 6
        $rule->logPricingModification( 'Clearance tiers applied by my-plugin' ); // shown in Debug mode
    }
    return $rule;
}, 40, 2 );

Other useful filters: …/price/price_by_rules (final unit price for a quantity), …/price/round_price / …/price/round_precision, …/cart/product_cart_price (price set on a cart item), …/cart/total_product_count (quantity used to pick the tier in the cart), …/cart/need_price_recalculation (skip an item), …/services/regular_pricing/price (adjusted regular/sale price for the current user), …/global_pricing/matched_pricing_rule (which global rule applies).

Write rules programmatically

Meta key (product / variation)Value
_fixed_price_rulesarray<int qty, string price> — e.g. [5 => '9.50', 10 => '8.00']
_percentage_price_rulesarray<int qty, string percent>
_tiered_price_rules_typefixed | percentage
_tiered_price_minimum_qtyint > 1
_tiered_pricing_maximum_quantity, _tiered_pricing_group_of_quantityint (maximum, step)
_tiered_price_mix_and_match_minimumyes | no (variable parent)
_tiered_pricing_template, _tiered_pricing_base_unit_namelayout slug; ['singular' => …, 'plural' => …]
_{role}_fixed_price_rules, _{role}_percentage_price_rules, _{role}_tiered_price_rules_type, _{role}_tiered_price_minimum_qty, _{role}_tiered_price_pricing_type, _{role}_tiered_price_regular_price, _{role}_tiered_price_sale_price, _{role}_tiered_price_discount, _{role}_tiered_price_discount_typerole-based rules ({role} = role slug); customer rules use _user_{userId}_…
// Product-level
update_post_meta( 123, '_fixed_price_rules', [ 5 => '9.50', 10 => '8.00' ] );
update_post_meta( 123, '_tiered_price_rules_type', 'fixed' );
\TierPricingTable\PriceManager::updateProductMinimumQuantity( 123, 5 );

// Role-based
\TierPricingTable\Addons\RoleBasedPricing\RoleBasedPricingRule::buildFromArray( 123, 'wholesale', [
    'pricing_type' => 'flat', 'regular_price' => 20, 'sale_price' => 18,
    'tiered_pricing_type' => 'fixed', 'fixed_tiered_pricing_rules' => [ 10 => 17, 50 => 15 ],
    'minimum_order_quantity' => 5,
] )->save();

// Global rule (post type tpt-global-rule)
use TierPricingTable\Addons\GlobalTieredPricing\CPT\GlobalTieredPricingCPT;
use TierPricingTable\Addons\GlobalTieredPricing\GlobalPricingRule;

$ruleId = wp_insert_post( [ 'post_type' => GlobalTieredPricingCPT::SLUG, 'post_status' => 'publish', 'post_title' => 'Wholesale tiers' ] );
$rule   = GlobalPricingRule::fromArray( [ 'tiered_pricing_type' => 'fixed', 'fixed_rules' => [ 10 => 9.5, 50 => 8 ], 'minimum' => 5, 'applying_type' => 'individual' ] );
$rule->setId( $ruleId );
$rule->setIncludedProductCategories( [ 15 ] );
$rule->setIncludedUsersRole( [ 'wholesale' ] );
$rule->save();

\TierPricingTable\Core\ServiceContainer::getInstance()->getCache()->purge();

Templates

Render the table yourself

ob_start();
\TierPricingTable\PricingTable::getInstance()->renderPricingTable( $product_id, null, [ 'display' => true, 'display_type' => 'blocks', 'title' => 'Volume pricing' ] );
$html = ob_get_clean();

Settings keys you can pass: display_type (table, blocks, options, dropdown, horizontal-table, plain-text, tooltip), title, quantity_column_title, price_column_title, discount_column_title, quantity_type (range \| static), show_discount_column, clickable_rows, active_tier_color, table_style, blocks_style, options_style, compact_layout, options_show_total, options_show_original_product_price, options_show_default_option, options_option_text, plain_text_option_text, update_price_on_product_page, show_total_price, quantity_measurement_singular, quantity_measurement_plural. The same keys work as shortcode attributes. Use tiered_pricing_table/should_render_pricing_table to suppress the automatic output and tiered_pricing_table/display_settings to change settings on the fly.

Override templates from a theme

Copy any file from the plugin’s views/frontend/ folder (tiered-pricing-table.php, tiered-pricing-blocks-style-3.php, summary-table.php, …) to **wp-content/themes/{your-theme}/tiered-pricing-table/** and edit it there. tiered_pricing_table/template/location lets a plugin redirect a template.

Theme override folder

Variables in layout templates: $pricing_rule (PricingRule), $price_rules, $pricing_type, $minimum, $product, $product_id, $settings, $id.

Keep the markup contract

The JavaScript reads the markup: keep the root element’s id, data-product-id, data-price-rules, data-minimum, data-regular-price, data-sale-price, data-price, data-product-price-suffix, one element per tier with data-tiered-quantity / data-tiered-price / data-tiered-price-exclude-taxes / data-tiered-price-include-taxes, the base row with data-tiered-quantity="{minimum}" and class tiered-pricing--active, and the helper functions tptParseOptionText() / tptParsePlainText().

Inject content into layouts

// Extra column in the table layouts
add_action( 'tiered_pricing_table/tiered_pricing/header_columns', fn() => print '<th>Total</th>' );
add_action( 'tiered_pricing_table/tiered_pricing/row_columns', function ( \TierPricingTable\PricingRule $rule, $qty ) {
    $qty   = $qty ?: max( 1, (int) $rule->getMinimum() ); // null = base row
    $price = $rule->getTierPrice( $qty );
    echo '<td>' . ( $price ? wc_price( $price * $qty ) : '—' ) . '</td>';
}, 10, 2 );

// Badge next to a tier in every layout
foreach ( [ 'table', 'horizontal-table', 'blocks', 'options', 'dropdown', 'plain-text' ] as $layout ) {
    add_action( "tiered_pricing_table/{$layout}/label", function ( $rule, $qty ) {
        if ( 50 === (int) $qty ) { echo '<span class="my-badge">Best value</span>'; }
    }, 10, 2 );
}

// "100 or more" instead of "100+"
add_filter( 'tiered_pricing_table/tiered_pricing/last_tier_postfix', fn() => ' or more' );

All layout hooks are listed under Template hooks.

JavaScript

The frontend engine (tiered-pricing-table-front-js, jQuery) exposes document.__tieredPricing:

// Point the plugin at a custom quantity input / price container
document.__tieredPricing = document.__tieredPricing || { overrides: {} };
document.__tieredPricing.overrides.$getQuantityField  = ( parentId ) => jQuery( '#my-qty-' + parentId );
document.__tieredPricing.overrides.$getPriceContainer = ( productId, parentId ) => jQuery( '#my-price-' + parentId );

// React to quantity changes
jQuery( document ).on( 'tiered_price_update', '.tpt__tiered-pricing', function ( event, data ) {
    // data.quantity, data.price, data.price_excl_tax, data.productId, data.parentId,
    // data.pricing = { price, price_excl_tax, price_incl_tax, priceHtml, tieredQuantity, eventQuantity }
} );

// Set the quantity
jQuery( '.quantity-input-product-123' ).val( 10 ).trigger( 'change' );

// Initialise tables inserted after page load (quick view, AJAX)
document.querySelectorAll( '.tpt__tiered-pricing' ).forEach( function ( el ) {
    if ( ! el.__tptInit ) { el.__tptInit = true; document.__tieredPricing.initFunction( el ); }
} );

The live product price is WooCommerce’s price HTML wrapped in <span class="tiered-pricing-dynamic-price-wrapper" data-price-type="dynamic|static|no-rules">; return static from tiered_pricing_table/frontend/default_price_behaviour_type to keep WooCommerce’s price, or false from …/frontend/wrap_price to skip the wrapper. Styling hooks: .tpt__tiered-pricing, .tiered-pricing--active, .tiered-pricing-table, .tiered-pricing-block, .tiered-pricing-option, .tiered-pricing-dropdown, .tier-pricing-summary-table, .tiered-pricing-you-save, .tiered-pricing-tier-label.

Shortcodes, block & widget

Integration pointDetails
[tiered-pricing-table]product_id (current post by default) plus any settings key from Render the table yourself — e.g. [tiered-pricing-table product_id="123" display_type="blocks" title="Volume pricing"]
[tiered_price_you_save]product_id, color, template, consider_sale_price
Block tiered-pricing-table/tiered-pricing-blockdisplayType, title, activeTierColor, showDiscountColumn, column titles
Elementor widget tiered-pricing-tableproduct_id, display_type, title, active_tier_color, column titles, options/measurement settings

REST API

The WooCommerce product and variation endpoints (/wp-json/wc/v3/products/{id}, /products/{id}/variations/{vid}) read and write these fields:

FieldValue
tiered_pricing_typefixed | percentage
tiered_pricing_fixed_rules, tiered_pricing_percentage_rules{ "<qty>": <price|percent> }
tiered_pricing_minimum_quantityinteger or null
tiered_pricing_roles_data{ "<role>": { pricing_type, regular_price, sale_price, discount, discount_type, tiered_pricing_type, fixed_rules, percentage_rules, minimum, tax_status, tax_class } } — writing replaces all role data; send tiers and minimum as fixed_tiered_pricing_rules, percentage_tiered_pricing_rules, minimum_order_quantity
tiered_pricing_product_settings{ "layout": "default"|<layout>, "base_unit_name": { "singular", "plural" }, "default_variation": <id> }
PUT /wp-json/wc/v3/products/123
{
  "tiered_pricing_type": "percentage",
  "tiered_pricing_percentage_rules": { "10": 5, "50": 12.5 },
  "tiered_pricing_minimum_quantity": 5,
  "tiered_pricing_roles_data": { "wholesale": { "pricing_type": "percentage", "discount": 15, "tiered_pricing_type": "fixed", "fixed_tiered_pricing_rules": { "10": 7.5 }, "minimum_order_quantity": 4 } }
}

Add your own field by extending TierPricingTable\Services\API\ProductFields\ProductField and appending the class with tiered_pricing_table/api/product_fields. Plugin routes: tier-pricing-table/v1/quote-request (POST, public), /quote-forms, /quote-settings, /tax-settings, tier-pricing-table/features/tier-labels/v1/labels, …/custom-columns/v1/columns, …/tools/v1/*. WooCommerce CSV import/export columns: tiered_price_fixed, tiered_price_percentage (qty:value,…), tiered_price_type, tiered_price_minimum and per-role {role}_tiered_price_*.

Extending the admin

// A setting in the General tab (option tier_pricing_table_my_hide_for_guests, 'yes' | 'no')
add_filter( 'tiered_pricing_table/settings/general_settings', function ( array $fields ) {
    $fields[] = [
        'title'   => 'Hide table for guests',
        'id'      => \TierPricingTable\Settings\Settings::SETTINGS_PREFIX . 'my_hide_for_guests',
        'type'    => \TierPricingTable\Settings\CustomOptions\TPTSwitchOption::FIELD_TYPE,
        'default' => 'no',
    ];
    return $fields;
} );

// An integration with its own on/off toggle under Settings → Integrations (boot-time filter)
class My_Integration extends \TierPricingTable\Integrations\Plugins\PluginIntegrationAbstract {
    public function getTitle(): string       { return 'My Plugin'; }
    public function getDescription(): string { return 'Adds option costs to tiered prices.'; }
    public function getSlug(): string        { return 'my-plugin'; }
    public function run() { add_filter( 'tiered_pricing_table/cart/product_cart_price', [ $this, 'addOptionsCost' ], 20, 2 ); }
}
add_filter( 'tiered_pricing_table/integrations/plugins', fn( array $list ) => array_merge( $list, [ My_Integration::class ] ) );
  • Settings tabs and fields: tiered_pricing_table/settings/sections, …/general_settings, …/general_subsections, …/calculation_logic, …/advanced_settings. Field types: tpt_switch_option, tpt_display_type, tpt_text_template, tpt_link_button.
  • Product editor: render fields on tiered_pricing_table/admin/pricing_tab_begin|after_minimum_order_quantity_field|advance_product_options|pricing_tab_end ($postId) and inside the rules form (…/admin/tiered_pricing_rules_form/form_begin|inputs|form_end); save on woocommerce_process_product_meta / woocommerce_save_product_variation. Name fields with TierPricingTable\Forms\Form::getFieldName( $base, $role, $loop ).
  • Role / customer rules: render on …/admin/role_based_rules/after_tiered_pricing_rules_field (and user_based_rules), save on …/role_based_rules/save_role_based_rules (and user_based_rules/save_user_based_rules).
  • Global rules: add a tab with tiered_pricing_table/global_pricing/form_tabs (extend CPT\Form\FormTab), save in …/global_pricing/before_updating, read your meta in …/global_pricing/after_built_rule, add list columns with …/global_pricing/columns.
  • Custom table columns: extend Addons\CustomColumns\Columns\AbstractCustomColumn and register it with tiered_pricing_table/custom_columns/available_columns_types + …/custom_columns/columns_handlers.
  • Addons: extend Addons\AbstractAddon and add it with tiered_pricing_table/addons/list (boot-time filter); it gets a toggle on the Modules tab.

Debugging

  • Debug mode (Settings → Modules → Debug) prints the resolved rule under each cart item and inside the pricing table, including the log written with PricingRule::logPricingModification().
  • Cache: catalog price HTML is cached in the tpt_product_data transient — purge from Settings → Modules → Cache or with ServiceContainer::getInstance()->getCache()->purge().
  • $GLOBALS['tpt_current_user_id'] makes every price calculation run for that user (manual orders use it).

Hooks reference

Every filter and action fired by the plugin, grouped by topic. Type is F (filter — return the first parameter) or A (action). Parameters are listed in order; the first parameter of a filter is the value to return. Every row is deep-linkable (the row id is hook- + the hook name with non-alphanumerics replaced by -). All names are prefixed with tiered_pricing_table/ unless shown in full.

Bootstrap & services

HookTypeParametersDescription
tpt_fs_loadedAFreemius SDK initialised (tpt_fs() available).
tiered_pricing_table/container/service_instanceFstring $classNameClass name instantiated by ServiceContainer::initService() — return a subclass to replace a service.
tiered_pricing_table/addons/listFarray<string,AbstractAddon> $addonsAddon instances keyed by class, before run() — add, remove or replace addons.
tiered_pricing_table/supported_simple_product_typesFstring[] $typesDefault simple, variation, subscription, subscription-variation.
tiered_pricing_table/supported_variable_product_typesFstring[] $typesDefault variable, variable-subscription.
tiered_pricing_table/supported_variation_product_typesFstring[] $typesDefault variation, subscription-variation.
tiered_pricing_table/pricing_layoutsFarray<string,string> $layoutsLayout slug ⇒ label (table, blocks, options, dropdown, horizontal-table, plain-text, tooltip).
tiered_pricing_table/current_userFWP_User $userThe user prices are calculated for (default: current user, or $GLOBALS['tpt_current_user_id']).
tiered_pricing_table/current_user_rolesFstring[] $roles, int $userIdRoles used for role-based pricing and cache keys.
tiered_pricing_table/rules_separatorFstring $separatorSeparator for qty:price lists in CSV import/export (default ,).
tiered_pricing_table/template/locationFstring $absolutePath, string $templateFinal path of any template (frontend/…, admin/…, addons/…).
tiered_pricing_table/template/before_renderAstring $absolutePath, array $variablesBefore a template is included.
tiered_pricing_table/template/after_renderAstring $absolutePath, array $variablesAfter a template is included.
tiered_pricing_table/assets/js/urlFstring $url, string $fileURL of a plugin JS asset.
tiered_pricing_table/assets/css/urlFstring $url, string $fileURL of a plugin CSS asset.

Price calculation

HookTypeParametersDescription
tiered_pricing_table/price/pricing_ruleFPricingRule $rule, int $productIdMain extension point. The effective rule for a product after product-level meta was read; providers (category 10, role 20, customer 25, global 30, quote 99) modify it here. Cached per request.
tiered_pricing_table/price/product_price_rulesFarray $rules, int $productId, string $typeProduct-level rules read from meta (view context only).
tiered_pricing_table/price/price_by_rulesFfloat|false $price, int $quantity, int $productId, string $context, string $place, PricingRule $ruleFinal unit price for a quantity (false = no tier matched).
tiered_pricing_table/price/round_priceFbool $roundWhether to round tier prices (default: Round price option).
tiered_pricing_table/price/round_precisionFint $decimalsRounding precision (default max(2, wc_get_price_decimals())).
tiered_pricing_table/price/typeFstring $type, int $productIdProduct-level pricing type (fixed | percentage).
tiered_pricing_table/price/minimumF?int $minimum, int $productIdProduct-level minimum order quantity.
tiered_pricing_table/services/pricing_service_enabledFbool $enabledReturn true to activate RegularPricingService (WC price filters). Global/role/customer addons do this.
tiered_pricing_table/services/regular_pricing/priceF?float $newPrice, ?WC_Product $product, ?string $specific ('regular'|'sale'|null), $originalPriceAdjusted regular/sale/current price for the current user (null keeps WooCommerce’s value).
tiered_pricing_table/services/pricing/override_zero_pricesFbool $overrideWhether zero-priced products get their price overridden (default true).
tiered_pricing_table/advanced_quantity/get_maximumF?int $value, int $productId, string|false $roleMaximum quantity for a product; role-specific values are applied here.
tiered_pricing_table/advanced_quantity/get_group_ofF?int $value, int $productId, string|false $roleQuantity step for a product.
tiered_pricing_table/addons/category_tier_pricing_skip_categoryFbool $skip, int $productId, WC_Product $productSkip legacy category-level rules for a product.
tiered_pricing_table/check_if_variable_product_has_rulesFbool $check, WC_Product $productReturn true to make productHasPricingRules() scan variations instead of assuming a variable product has rules.

Cart & checkout

HookTypeParametersDescription
tiered_pricing_table/cart/need_price_recalculationFbool $recalculate, array $cartItem, WC_Cart $cartReturn false to leave an item’s price to WooCommerce (coupons addon uses this at 999).
tiered_pricing_table/cart/product_cart_priceFfloat|false $price, array $cartItem, string $cartItemKey, int $totalQuantityUnit price set on the cart item.
tiered_pricing_table/cart/total_product_countFint $count, array $cartItemQuantity used to pick the tier for an item (sum of variations when Summarize variations is on; global cross rules sum matched items).
tiered_pricing_table/cart/need_price_recalculation/itemFbool $recalculate, array $cartItemSame as above, for the displayed item price.
tiered_pricing_table/cart/product_cart_price/itemFfloat|false $price, array $cartItemDisplayed unit price.
tiered_pricing_table/cart/product_cart_old_priceFfloat $oldPrice, array $cartItemCrossed-out price shown next to the discounted price.
tiered_pricing_table/cart/item/consider_sale_price_as_discountFbool $consider, array $cartItemShow the sale price as a discount in the cart item price.
tiered_pricing_table/cart/recalculate_cart_item_subtotalFbool $recalculate, array $cartItem, string $key, string $subtotalHtmlWhether the subtotal cell is rewritten as old/new.
tiered_pricing_table/cart/subtotal/consider_sale_price_as_discountFbool $consider, array $cartItem, string $keySame for the subtotal (default: option).
tiered_pricing_table/minimum_quantity/control_cart_quantity_fieldFbool $control, WC_Product $productLet the minimum-quantity addon set min on the cart quantity field.
tiered_pricing_table/minimum_quantity/item_quantityFint $quantity, int $productIdQuantity compared against the minimum.
tiered_pricing_table/manual_created_orders/modify_item_priceFbool $modify, WC_Order_Item_Product $itemSkip an item when recalculating a manual order with tiered pricing.

Product page, dynamic price & catalog

HookTypeParametersDescription
tiered_pricing_table/should_render_pricing_tableFbool $render, int $parentProductId, ?int $variationId, array $settingsReturn false to suppress the whole widget.
tiered_pricing_table/display_settingsFarray $settings, int $productIdFinal render settings (product id is the variation when resolved).
tiered_pricing_table/ajax_variations_thresholdFint $thresholdVariations above this count load via AJAX instead of being pre-rendered (default 10).
tiered_pricing_table/before_rendering_tiered_pricingAWC_Product $parentProduct, ?int $variationId, array $settingsBefore the wrapper.
tiered_pricing_table/before_rendering_tiered_pricing/innerAPricingRule $rule, WC_Product $product, array $settingsBefore a layout template is included (also for each pre-rendered/AJAX variation). Debug mode prints here.
tiered_pricing_table/product/default_variationF?WC_Product_Variation $variation, int $productIdVariation shown by default for a variable product.
tiered_pricing_table/frontend/wrap_priceFbool $wrap, WC_Product $product, string $priceHtmlWrap the price HTML in the dynamic-price span.
tiered_pricing_table/frontend/wrap_variable_priceFbool $wrap, WC_Product $productSame for variable products.
tiered_pricing_table/frontend/default_price_behaviour_typeFstring $type ('dynamic'), WC_Product $product, string $priceHtml, string $contextdynamic (JS rewrites the price), static (leave it), no-rules. $context is product-page or shop-loop.
tiered_pricing_table/frontend/modify_price_suffixFbool $modify, string $suffix, WC_Product $product, $price, $qtyWrap {price_including_tax} / {price_excluding_tax} in spans the JS can update.
tiered_pricing_table/frontend/variation_render_settingsFarray $settings, int $variationId, string $displayContextSettings for variation tables loaded over AJAX.
tiered_pricing_table/frontend/load_variation/verify_nonceFbool $verify, string $nonce, string $actionEnable nonce verification on the get_pricing_table AJAX endpoint (default false).
tiered_pricing_table/catalog_pricing/price_htmlFstring $newHtml, string $defaultHtml, WC_Product $productCatalog price HTML (lowest / range / custom).
tiered_pricing_table/catalog_pricing/format_variation_priceFbool $format, string $defaultHtml, WC_Product $variationAlso format variation prices in the catalog (default false).
tiered_pricing_table/text_template_variablesFarray $variablesPlaceholders offered in text-template settings (tp_quantity, tp_discount, tp_rounded_discount, tp_price, tp_base_unit_name, tp_required_quantity, tp_next_price, tp_next_discount, tp_actual_discount, tp_ys_price, tp_ys_total_price, tp_ys_percentage_discount).

Template hooks

Fired inside the layout templates in views/frontend/. $args for label actions is ['id' => $id, 'style' => '<style>']; $qty is null for the base (minimum) row in row_columns.

HookTypeParametersDescription
tiered_pricing_table/tiered_pricing/beforeAPricingRule $ruleBefore the table (table styles, horizontal table).
tiered_pricing_table/tiered_pricing/header_columnsAPricingRule $ruleEcho extra <th> header cells (table styles, horizontal table).
tiered_pricing_table/tiered_pricing/row_columnsAPricingRule $rule, ?int $qtyEcho extra <td> cells per row.
tiered_pricing_table/tiered_pricing/rowsAPricingRule $rule, array $settings, string $templateNameExtra rows at the end of <tbody>.
tiered_pricing_table/table/tfootAPricingRule $rule, array $settings, string $templateNameTable footer.
tiered_pricing_table/tiered_pricing/afterAPricingRule $rule, int $productIdAfter the table (horizontal table passes only $rule).
tiered_pricing_table/tiered_pricing/last_tier_postfixFstring $postfix ('+'), int $qty, PricingRule $rule, string $layout ('table'|'blocks')Suffix of the last tier quantity (e.g. 100+).
tiered_pricing_table/table/labelAPricingRule $rule, int $qty, array $argsBadge next to a quantity in table layouts.
tiered_pricing_table/horizontal-table/labelAPricingRule $rule, int $qty, array $argsBadge in the horizontal table.
tiered_pricing_table/blocks/labelAPricingRule $rule, int $qty, array $argsBadge in blocks layouts.
tiered_pricing_table/options/labelAPricingRule $rule, int $qty, array $argsBadge in options layouts.
tiered_pricing_table/dropdown/labelAPricingRule $rule, int $qty, array $argsBadge in the dropdown.
tiered_pricing_table/plain-text/labelAPricingRule $rule, int $qty, array $argsBadge in plain text lines.
tiered_pricing_table/horizontal-table/after_columnsAPricingRule $rule, array $settingsExtra columns in the horizontal grid.
tiered_pricing_table/blocks/blocksAPricingRule $rule, array $settingsExtra blocks inside .tiered-pricing-blocks.
tiered_pricing_table/blocks/after_blocksAPricingRule $ruleAfter the blocks container.
tiered_pricing_table/options/optionsAPricingRule $rule, array $settingsExtra options.
tiered_pricing_table/options/after_optionsAPricingRule $ruleAfter the options.
tiered_pricing_table/dropdown/optionsAPricingRule $ruleExtra <li> options.
tiered_pricing_table/dropdown/after_optionsAPricingRule $ruleAfter the dropdown list.
tiered_pricing_table/plain-text/lineAPricingRule $rule, array $settingsExtra lines.
tiered_pricing_table/plain-text/after_linesAPricingRule $rule, array $settingsAfter the list.
tiered_pricing_table/product_page/before_table_summaryAstring $totalLabel, string $eachLabelAround the totals summary (table & detailed).
tiered_pricing_table/summary/before_inline_summaryAstring $totalLabel, string $eachLabelBefore the inline summary.
tiered_pricing_table/summary/after_inline_summaryAstring $totalLabel, string $eachLabelAfter the inline summary.

Tier labels & custom columns

HookTypeParametersDescription
tiered_pricing_table/addons/tier_labels/label_htmlFstring $html, TierLabel $labelRendered label markup.
tiered_pricing_table/custom_columns/available_columns_typesFarray<string,string> $typesRegister a column type (type ⇒ label).
tiered_pricing_table/custom_columns/available_data_typesFarray $typesprice, number, text.
tiered_pricing_table/custom_columns/columns_handlersFarray<string,string> $handlersColumn type ⇒ handler class (extends AbstractCustomColumn).
tiered_pricing_table/custom_columns/show_custom_columnFbool $visible, AbstractCustomColumn $columnHide/show a column.
tiered_pricing_table/custom_columns/nameFstring $name, AbstractCustomColumn $columnColumn header text.
tiered_pricing_table/custom_columns/valueFmixed $value, PricingRule $rule, ?int $qty, AbstractCustomColumn $columnCell value.

Global pricing rules

HookTypeParametersDescription
tiered_pricing_table/global_pricing/matched_pricing_ruleF?GlobalPricingRule $rule, WC_Product $product, WP_User $userThe rule chosen for a product/user — implement custom arbitration here.
tiered_pricing_table/global_pricing/match_requirementsFbool $matched, GlobalPricingRule $rule, WP_User $user, WC_Product $productResult of a rule’s matching logic.
tiered_pricing_table/global_pricing/after_built_ruleFGlobalPricingRule $ruleRule built from post meta — read your own meta into $rule->data.
tiered_pricing_table/global_pricing/validationFbool $valid, GlobalPricingRule $ruleWhether a rule is considered valid (has pricing).
tiered_pricing_table/global_pricing/before_adjusting_pricing_ruleFPricingRule $rule, GlobalPricingRule $globalRule, int $productId, string $priorityBefore a matched rule is applied ($priority: flexible | prefer-product | override).
tiered_pricing_table/global_pricing/after_adjusting_pricing_ruleFPricingRule $rule, GlobalPricingRule $globalRule, int $productId, string $priorityAfter it was applied.
tiered_pricing_table/global_pricing/form_tabsFFormTab[] $tabs, Form $formTabs of the rule editor.
tiered_pricing_table/global_pricing/form/tab_endAFormTab $tab, GlobalPricingRule $ruleEnd of each tab.
tiered_pricing_table/global_pricing/after_minimum_order_quantity_fieldAint $ruleId, GlobalPricingRule $ruleQuantity tab, after the minimum field.
tiered_pricing_table/global_pricing/before_updatingAGlobalPricingRule $rule, int $ruleIdOn save, before $rule->save() — persist custom fields.
tiered_pricing_table/global_pricing/columnsFarray $columnsList-table columns (objects with getName()/render()).
tiered_pricing_table/global_pricing/table/after_tab_renderAstring $column, GlobalPricingRule $ruleAfter a list-table cell is rendered.

Role-based pricing

HookTypeParametersDescription
tiered_pricing_table/role_based_rules/rule_exists_metaFstring[] $metaSuffixes, string $roleMeta suffixes whose existence means “role has rules” (default _tiered_price_rules_type, _tiered_price_pricing_type).
tiered_pricing_table/role_based_rules/price/product_price_rulesFarray $rules, int $productId, string $typeRole tier rules read from meta.
tiered_pricing_table/role_based_rules/price/typeFstring $type, string $role, int $productIdfixed | percentage.
tiered_pricing_table/role_based_rules/price/minimumF?int $minimum, string $role, int $productIdRole minimum quantity.
tiered_pricing_table/role_based_rules/price/regular_priceF?float $price, string $role, int $productIdRole regular price.
tiered_pricing_table/role_based_rules/price/sale_priceF?float $price, string $role, int $productIdRole sale price.
tiered_pricing_table/role_based_rules/price/discountF?float $discount, string $role, int $productIdRole percentage discount.
tiered_pricing_table/role_based_rules/price/discount_typeFstring $type, string $role, int $productIdsale_price | regular_price.
tiered_pricing_table/role_based_rules/price/pricing_typeFstring $type, string $role, int $productIdflat | percentage.
tiered_pricing_table/role_based_rules/price/tax_statusFstring $status, string $role, int $productIdRole tax status override.
tiered_pricing_table/role_based_rules/price/tax_classFstring $class, string $role, int $productIdRole tax class override.
tiered_pricing_table/role_based_rules/delete_role_ruleAint $productId, string $roleAfter a role’s rules were deleted from a product.
tiered_pricing_table/role_based_rules/save_role_based_rulesAint $productId, array $postData, string $role, ?int $loopAfter a role’s rules were saved from the product editor.
tiered_pricing_table/role_based_pricing/after_adjusting_pricing_ruleAPricingRule $rule, RoleBasedPricingRule $roleRule, int $productIdAfter the role rule was applied to the product’s PricingRule.
tiered_pricing_table/role_based/after_built_ruleFRoleBasedPricingRule $ruleRule built from meta.
tiered_pricing_table/role_based/after_built_rule_from_arrayFRoleBasedPricingRule $rule, string $role, array $dataRule built from an array (import).
tiered_pricing_table/role_based_rules/import_export_disabled_rolesFstring[] $rolesRoles excluded from CSV import/export (default editor, author, contributor, shop_manager).

Customer-based pricing

HookTypeParametersDescription
tiered_pricing_table/user_based_rules/rule_exists_metaFstring[] $metaSuffixes, int $userIdSame as the role equivalent.
tiered_pricing_table/user_based_rules/price/product_price_rulesFarray $rules, int $productId, string $typeCustomer tier rules.
tiered_pricing_table/user_based_rules/price/typeFstring $type, int $userId, int $productIdfixed | percentage.
tiered_pricing_table/user_based_rules/price/minimumF?int $minimum, int $userId, int $productIdCustomer minimum.
tiered_pricing_table/user_based_rules/price/regular_priceF?float $price, int $userId, int $productIdCustomer regular price.
tiered_pricing_table/user_based_rules/price/sale_priceF?float $price, int $userId, int $productIdCustomer sale price.
tiered_pricing_table/user_based_rules/price/discountF?float $discount, int $userId, int $productIdCustomer discount.
tiered_pricing_table/user_based_rules/price/discount_typeFstring $type, int $userId, int $productIdsale_price | regular_price.
tiered_pricing_table/user_based_rules/price/pricing_typeFstring $type, int $userId, int $productIdflat | percentage.
tiered_pricing_table/user_based_rules/price/tax_statusFstring $status, int $userId, int $productIdTax status override.
tiered_pricing_table/user_based_rules/price/tax_classFstring $class, int $userId, int $productIdTax class override.
tiered_pricing_table/user_based_rules/delete_user_ruleAint $productId, int $userIdAfter a customer’s rules were deleted.
tiered_pricing_table/user_based_rules/save_user_based_rulesAint $productId, array $postData, int $userId, ?int $loopAfter a customer’s rules were saved.
tiered_pricing_table/user_based_pricing/after_adjusting_pricing_ruleAPricingRule $rule, UserBasedPricingRule $userRule, int $productIdAfter the customer rule was applied.
tiered_pricing_table/user_based/after_built_ruleFUserBasedPricingRule $ruleRule built from meta.
tiered_pricing_table/user_based/after_built_rule_from_arrayFUserBasedPricingRule $rule, int $userId, array $dataRule built from an array.

Admin product editor

HookTypeParametersDescription
tiered_pricing_table/admin/pricing_tab_beginAint $postIdTop of the Tiered Pricing tab.
tiered_pricing_table/admin/after_minimum_order_quantity_fieldAint $productId, ?int $loopAfter the minimum field (product tab and each variation).
tiered_pricing_table/admin/before_advance_product_optionsAint $postIdBefore the Additional options group.
tiered_pricing_table/admin/advance_product_optionsAint $postIdInside Additional options.
tiered_pricing_table/admin/pricing_tab_endAint $postIdBottom of the tab.
tiered_pricing_table/admin/role_customer_pricing_tab_activeFbool $activeShow the Role & Customer Pricing tab.
tiered_pricing_table/admin/role_customer_pricing_tab_beginAint $postIdTop of that tab.
tiered_pricing_table/admin/role_customer_pricing_tab_contentAint $postIdTab content (role block 99, customer block 100).
tiered_pricing_table/admin/role_customer_pricing_tab_endAint $postIdBottom of that tab.
tiered_pricing_table/admin/tiered_pricing_rules_form/form_beginA$entityId, ?string $role, ?int $loop, string $customPrefixStart of the rules form component.
tiered_pricing_table/admin/tiered_pricing_rules_form/after_pricing_typeA$entityId, ?string $role, ?int $loop, string $customPrefixAfter the fixed/percentage selector.
tiered_pricing_table/admin/tiered_pricing_rules_form/inputsA$entityId, $amount, ?string $role, ?int $loop, string $customPrefix, string $typeInside each tier row.
tiered_pricing_table/admin/tiered_pricing_rules_form/form_endA$entityId, ?string $role, ?int $loop, string $customPrefixEnd of the component.
tiered_pricing_table/admin/tiered_pricing_rules_form/inputs_widthFint $percentWidth of the quantity/price inputs (default 50).
tiered_pricing_table/admin/components/tiered_pricing_rules_form/get_from_requestA$entityId, ?string $role, ?int $loop, string $customPrefix, array $data, array $requestAfter the rules form was parsed from $_POST.
tiered_pricing_table/admin/role_based_rules/after_minimum_order_quantity_fieldAint $productId, string $role, ?int $loopInside a role’s pricing form.
tiered_pricing_table/admin/role_based_rules/after_tiered_pricing_rules_fieldAint $productId, string $role, ?int $loopInside a role’s pricing form (tax selects render here).
tiered_pricing_table/admin/user_based_rules/after_minimum_order_quantity_fieldAint $productId, int $userId, ?int $loopInside a customer’s pricing form.
tiered_pricing_table/admin/user_based_rules/after_tiered_pricing_rules_fieldAint $productId, int $userId, ?int $loopInside a customer’s pricing form.
tiered_pricing_table/admin/tips/get_tip_by_slugF?Tip $tip, string $slugResolve a custom admin tip.

REST API, import & export

HookTypeParametersDescription
tiered_pricing_table/api/product_fieldsFstring[] $fieldClassesClasses (extending ProductField) registered as WooCommerce REST product fields.
tiered_pricing_table/api/supported_product_typesFstring[] $objectTypes, ProductField $fieldREST object types the field is added to (default product, product_variation).
tiered_pricing_table/import/woocommerce/import_columnsFarray $columnsColumns offered in the WooCommerce CSV importer mapping screen.
tiered_pricing_table/import/woocommerce/mapping_screen_columnsFarray $headerToKeyAuto-mapping of CSV headers to columns.
tiered_pricing_table/request_quote/quote_request_submittedAint $quoteRequestIdA quote request was saved (emails hook here).

Integrations

HookTypeParametersDescription
tiered_pricing_table/integrations/pluginsFstring[] $classesPlugin integration classes (boot-time — see note above).
tiered_pricing_table/integrations/themesFarray<string,string> $needleToClassTheme integrations keyed by a lower-case needle matched against the theme name/template (boot-time).
tiered_pricing_table/integrations/{slug}/variable_products_supportedFbool $supported, WC_Product $productWhether SEO schema enhancement runs for variable products; {slug} is yoast_seo, rank_math or seopress.

Settings

HookTypeParametersDescription
tiered_pricing_table/settings/sectionsFSectionAbstract[] $sectionsSettings tabs.
tiered_pricing_table/settings/general_settingsFarray $fieldsFields of the General tab (after subsections were merged).
tiered_pricing_table/settings/general_subsectionsFstring[] $subsectionClassesSubsections of the General tab.
tiered_pricing_table/settings/calculation_logicFarray $fieldsFields of the Calculations tab.
tiered_pricing_table/settings/advanced_settingsFarray $fieldsFields of the Modules tab (addon flags).
tiered_pricing_table/settings/integrations_settingsFarray $rowsIntegration toggle rows.
tiered_pricing_table/settings/integrations_categoriesFarray<string,array> $categoriesIntegration groups (id => ['title','description']).
tiered_pricing_table/settings/table_columns/after_fieldsAAfter the column-title inputs.
tiered_pricing_table/settings/table_columns/endAEnd of the column-titles field (custom columns UI mounts here).

Resources

  • User Guide — store-owner documentation for every feature.
  • Guides — how-to articles.
  • Contact us — missing hook or integration question? Let us know.