WordPress filter hook
woocommerce_product_get_price
Fired by 10 WordPress plugins, running on 363K+ sites between them.
How to use woocommerce_product_get_price
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:
add_filter( 'woocommerce_product_get_price', function( $price, $objInfo ) {
// Change $price here.
return $price;
}, 10, 2 );Argument names come from Unlimited Elements for Elementor's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
10 plugins that fire woocommerce_product_get_price
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Unlimited Elements for Elementor300,000+ installs
apply_filters( 'woocommerce_product_get_price', $price, $objInfo )provider/woocommerce_integrate.class.php:731 -
CURCY20,000+ installs
apply_filters( 'woocommerce_product_get_price', $display_price, $product )frontend/price.php:112 -
Wholesale Suite20,000+ installs
apply_filters( 'woocommerce_product_get_price', $price_arr['wholesale_price_raw'], $product )includes/class-wwp-wholesale-prices.php:477 -
WPC Composite Products for WooCommerce9,000+ installs
apply_filters( 'woocommerce_product_get_price', 0, $this )includes/class-product.php:44 -
YayCurrency7,000+ installs
apply_filters( 'woocommerce_product_get_price', $display_price, $product )includes/Engine/Compatibles/WooCommerceBookings.php:97 -
Product Bundle Builder for WooCommerce6,000+ installs
apply_filters( 'woocommerce_product_get_price', (string) $parent_price, $this )src/ProductBundle.php:493 -
Unlimited Elements Blocks Library500+ installs
apply_filters( 'woocommerce_product_get_price', $price, $objInfo )provider/woocommerce_integrate.class.php:731 -
BundleBoss90+ installs
apply_filters( 'woocommerce_product_get_price', $amount, $ref )includes/pricing.php:324 -
Stock Level Pricing10+ installs
apply_filters( 'woocommerce_product_get_price', $original_price, $product )includes/price-adjustment-handler.php:116 -
Yay Bulk Order for WooCommerceFewer than 10 installs
apply_filters( 'woocommerce_product_get_price', $raw_price, $product )includes/Services/PricingService.php:48
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.