Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jessepearson/49896ae022e65d8f24dbc8ac6799a2d9 to your computer and use it in GitHub Desktop.

Select an option

Save jessepearson/49896ae022e65d8f24dbc8ac6799a2d9 to your computer and use it in GitHub Desktop.
Remove 'Free!' as the price for grouped products
<?php // do not copy this line unless needed
/**
* Remove 'Free!' as the price for grouped products
*
* @param $price string The price
* @param $prod object The product
* @return string The original or modified price.
*/
function remove_free_as_grouped_product_price( $price, $prod ) {
if ( 'Free!' === $price ) {
$price = '';
}
return $price;
}
add_filter( 'woocommerce_grouped_free_price_html', 'remove_free_as_grouped_product_price', 100, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment