Skip to content

Instantly share code, notes, and snippets.

@jorpdesigns
Created July 12, 2021 17:18
Show Gist options
  • Select an option

  • Save jorpdesigns/8d0464dbf504dee6e8e795c631a15d50 to your computer and use it in GitHub Desktop.

Select an option

Save jorpdesigns/8d0464dbf504dee6e8e795c631a15d50 to your computer and use it in GitHub Desktop.
Snippet to hide WooCommerce Product Addons option price if 0
<?php
add_filter( 'woocommerce_product_addons_option_price', 'filter_product_addons_option_price', 10, 4 );
function filter_product_addons_option_price( $price, $option, $i, $type ){
if ( $option['price'] == 0 ) {
$price = '';
}
return $price;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment