WordPress filter hook

woocommerce_variable_price_html

Defined by WooCommerce and fired by 13 plugins in total, running on 7.1M+ sites between them.

How to use woocommerce_variable_price_html

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'woocommerce_variable_price_html', function( $value, $product ) {
	// Change $value here.
	return $value;
}, 10, 2 );

Argument names come from Product Feed for Google Shopping, Microsoft Advertising and 40+ Channels for WooCommerce Merchant's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

13 plugins that fire woocommerce_variable_price_html

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_variable_price_html', $price . $this->get_price_suffix(), $this ) includes/class-wc-product-variable.php:203
  2. FOX icon FOX50,000+ installs apply_filters( 'woocommerce_variable_price_html', $price, $product ) classes/compatibility/woocommerce_subscriptions.php:144
  3. Product Feed for Google Shopping, Microsoft Advertising and 40+ Channels for WooCommerce Merchant icon Product Feed for Google Shopping, Microsoft Advertising and 40+ Channels for WooCommerce Merchant2,000+ installs apply_filters( 'woocommerce_variable_price_html', $price . $product->get_price_suffix(), $product ) helpers/helper.php:1019
  4. FooSales icon FooSales700+ installs apply_filters( 'woocommerce_variable_price_html', $price . $wc_product->get_price_suffix(), $wc_product ) admin/helpers/foosales-api-helper.php:215
  5. Milo Subscriptions icon Milo Subscriptions200+ installs apply_filters( 'woocommerce_variable_price_html', $price_html . $this->get_price_suffix(), $this ) includes/product/class-product-variable-subscription.php:181
  6. Pizza builder for WooCommerce icon Pizza builder for WooCommerce30+ installs apply_filters( 'woocommerce_variable_price_html', $price . $product_pizza->get_price_suffix(), $product ) includes/pizza-display.php:68
  7. OpenGraphiq Lite icon OpenGraphiq Lite20+ installs apply_filters( 'woocommerce_variable_price_html', $price . $product->get_price_suffix(), $product ) admin/class-opengraphiq-admin.php:1100
  8. Cryptocurrency Product for WooCommerce icon Cryptocurrency Product for WooCommerce20+ installs apply_filters( 'woocommerce_variable_price_html', $price . $product->get_price_suffix(), $product ) cryptocurrency-product-for-woocommerce.php:882
  9. Frisbii Billing icon Frisbii Billing20+ installs apply_filters( 'woocommerce_variable_price_html', $price . $this->get_price_suffix(), $this ) includes/WC_Product_Reepay_Variable_Subscription.php:56
  10. Mobile App for WooCommerce: ShopApper Mobile App Builder Service for WooCommerce icon Mobile App for WooCommerce: ShopApper Mobile App Builder Service for WooCommerce10+ installs apply_filters( 'woocommerce_variable_price_html', wc_format_price_range(0, $default_variation_price) . $object->get_price_suffix(), $this ) Controllers/ProductController.php:383
  11. Subscriptions & Recurring Payments for WooCommerce icon Subscriptions & Recurring Payments for WooCommerce10+ installs apply_filters( 'woocommerce_variable_price_html', $price, $this ) inc/classes/class-wc-product-variable-subscription.php:110
  12. Themex Currency Manager for WooCommerce icon Themex Currency Manager for WooCommerce10+ installs apply_filters( 'woocommerce_variable_price_html', $price . $product->get_price_suffix(), $product ) includes/class-wc-integration.php:447
  13. Bonus Plus for Woocommerce icon Bonus Plus for Woocommerce10+ installs apply_filters( 'woocommerce_variable_price_html', $price . $product->get_price_suffix(), $product ) includes/Actions/Product.php:96

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.