WordPress filter hook

woocommerce_addons_add_price_to_name

Fired by 6 WordPress plugins, running on 160K+ sites between them.

How to use woocommerce_addons_add_price_to_name

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_addons_add_price_to_name', function( $value, $addon ) {
	// Change $value here.
	return $value;
}, 10, 2 );

Argument names come from CURCY's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

6 plugins that fire woocommerce_addons_add_price_to_name

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

  1. TI WooCommerce Wishlist icon TI WooCommerce Wishlist100,000+ installs apply_filters( 'woocommerce_addons_add_price_to_name', '__return_true' ) integrations/woocommerce-product-addons.php:168
  2. Booster for WooCommerce icon Booster for WooCommerce30,000+ installs apply_filters( 'woocommerce_addons_add_price_to_name', '__return_true' ) includes/class-wcj-multicurrency.php:1192
  3. CURCY icon CURCY20,000+ installs apply_filters( 'woocommerce_addons_add_price_to_name', true, $addon ) plugins/woocommerce_product_addons.php:76
  4. Currency Switcher for WooCommerce icon Currency Switcher for WooCommerce10,000+ installs apply_filters( 'woocommerce_addons_add_price_to_name', '__return_true' ) includes/class-alg-switcher-third-party-compatibility.php:570
  5. Frisbii Billing icon Frisbii Billing10+ installs apply_filters( 'woocommerce_addons_add_price_to_name', '__return_true' ) includes/WC_Reepay_Subscription_Addons.php:64
  6. Shop Currency Switcher for WooCommerce icon Shop Currency Switcher for WooCommerce10+ installs apply_filters( 'woocommerce_addons_add_price_to_name', '__return_true' ) includes/class-alg-switcher-third-party-compatibility.php:390

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.