Skip to content

Instantly share code, notes, and snippets.

@stevenhoney
Created August 6, 2016 05:27
Show Gist options
  • Save stevenhoney/d82216edc85f997f700f23b59206a17d to your computer and use it in GitHub Desktop.
Save stevenhoney/d82216edc85f997f700f23b59206a17d to your computer and use it in GitHub Desktop.
add_filter('woocommerce_get_price','change_price', 10, 2);
add_filter('woocommerce_get_regular_price','change_price', 10, 2);
add_filter('woocommerce_get_sale_price','change_price', 10, 2);
function change_price( $price, $product_id ){
$front_prijs = get_field( 'front_prijs', $product_id );
$tekst_na_prijs = get_field( 'tekst_na_prijs', $product_id );
if( $front_prijs && $tekst_na_prijs ){
$price = '€' . $front_prijs . ' ' . $tekst_na_prijs;
}
return $price;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment