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:

functions.php
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.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_product_price_class', 'price' ) templates/single-product/price.php:25
  2. ShopLentor icon ShopLentor80,000+ installs apply_filters( 'woocommerce_product_price_class', 'price' ) classes/class.default_data.php:276
  3. Thim Elementor Kit icon 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
  4. MKL Product Configurator for WooCommerce icon MKL Product Configurator for WooCommerce2,000+ installs apply_filters( 'woocommerce_product_price_class', 'price' ) inc/frontend/product.php:196
  5. Easy 3D Viewer icon Easy 3D Viewer1,000+ installs apply_filters( 'woocommerce_product_price_class', 'price' ) includes/woo3dv-product-single-compat.php:73
  6. ShopPress icon ShopPress600+ installs apply_filters( 'woocommerce_product_price_class', 'price' ) Elementor/widgets/loop/price/config.php:89
  7. StoreBuild icon StoreBuild400+ installs apply_filters( 'woocommerce_product_price_class', 'price' ) public/class-pure-wc-shopbuild-compare.php:338
  8. ShopMaker icon ShopMaker90+ installs apply_filters( 'woocommerce_product_price_class', 'price' ) classes/widgets/sm-single-product-price.php:182
  9. WPSHARE247 Elementor Addons icon WPSHARE247 Elementor Addons40+ installs apply_filters( 'woocommerce_product_price_class', 'price' ) includes/widgets/wpshare247_product_single_price_widget.php:371
  10. Restaurant Menu / bulk order plugin for WooCommerce icon Restaurant Menu / bulk order plugin for WooCommerce20+ installs apply_filters( 'woocommerce_product_price_class', 'price' ) single-product/price.php:27
  11. Klassifieds for WooCommerce icon Klassifieds for WooCommerce20+ installs apply_filters( 'woocommerce_product_price_class', __( 'Upon request', 'klassifieds-for-woocommerce' ) ) includes/klassifieds-helper-functions.php:192
  12. Peleman Webshop Plugin icon Peleman Webshop Plugin10+ installs apply_filters( 'woocommerce_product_price_class', 'price' ) templates/woocommerce/price.php:33
  13. InstaView for WooCommerce icon InstaView for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_product_price_class', 'price' ) includes/frontend/instaview/price.php:28
  14. UnikForce Elementor WooCommerce Builder icon 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.