Skip to content

Instantly share code, notes, and snippets.

@wooexperte
Created November 16, 2018 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wooexperte/bca13068ccee520e59974a516a741c22 to your computer and use it in GitHub Desktop.
Save wooexperte/bca13068ccee520e59974a516a741c22 to your computer and use it in GitHub Desktop.
WooCommerce - Kostenlos statt 0 Euro
add_filter( 'woocommerce_get_price_html', 'wpglorify_price_free_zero_empty', 100, 2 );
function wpglorify_price_free_zero_empty( $price, $product ){
if ( '' === $product->get_price() || 0 == $product->get_price() ) {
$price = 'kostenlos!'; // Text anpassen
}
return $price;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment