WordPress filter hook
woocommerce_product_price_class
Defined by WooCommerce and fired by 14 plugins in total, running on 7.1M+ sites between them.
How to use woocommerce_product_price_class
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_product_price_class', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
14 plugins that fire woocommerce_product_price_class
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_product_price_class', 'price' )templates/single-product/price.php:25 -
ShopLentor80,000+ installs
apply_filters( 'woocommerce_product_price_class', 'price' )classes/class.default_data.php:276 -
Thim Elementor Kit20,000+ installs
apply_filters( 'woocommerce_product_price_class', 'thim-ekit-single-product__price price' )inc/elementor/widgets/single-product/product-price.php:129 -
MKL Product Configurator for WooCommerce2,000+ installs
apply_filters( 'woocommerce_product_price_class', 'price' )inc/frontend/product.php:196 -
Easy 3D Viewer1,000+ installs
apply_filters( 'woocommerce_product_price_class', 'price' )includes/woo3dv-product-single-compat.php:73 -
ShopPress600+ installs
apply_filters( 'woocommerce_product_price_class', 'price' )Elementor/widgets/loop/price/config.php:89 -
StoreBuild400+ installs
apply_filters( 'woocommerce_product_price_class', 'price' )public/class-pure-wc-shopbuild-compare.php:338 -
ShopMaker90+ installs
apply_filters( 'woocommerce_product_price_class', 'price' )classes/widgets/sm-single-product-price.php:182 -
WPSHARE247 Elementor Addons40+ installs
apply_filters( 'woocommerce_product_price_class', 'price' )includes/widgets/wpshare247_product_single_price_widget.php:371 -
Restaurant Menu / bulk order plugin for WooCommerce20+ installs
apply_filters( 'woocommerce_product_price_class', 'price' )single-product/price.php:27 -
Klassifieds for WooCommerce20+ installs
apply_filters( 'woocommerce_product_price_class', __( 'Upon request', 'klassifieds-for-woocommerce' ) )includes/klassifieds-helper-functions.php:192 -
Peleman Webshop Plugin10+ installs
apply_filters( 'woocommerce_product_price_class', 'price' )templates/woocommerce/price.php:33 -
InstaView for WooCommerceFewer than 10 installs
apply_filters( 'woocommerce_product_price_class', 'price' )includes/frontend/instaview/price.php:28 -
UnikForce Elementor WooCommerce BuilderFewer than 10 installs
apply_filters( 'woocommerce_product_price_class', 'price' )includes/woo-data.php:107
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.