Archived topic
woocommerce_product_get_price equals 0 in cart
1 reply · Started by Marinex on January 13, 2020
Viewing posts 1–2 of 2
Hi, I am trying to display a different price for logged in users but I cannot get it to work on the cart page and checkout. Any idea what I'm missing here?
Here's my code;
add_action( 'woocommerce_product_get_price', 'reseller_price', 10, 2 );
function reseller_price( $price ) {
if( is_user_logged_in() && ! is_admin() ){
$af_price = get_field( "af-pris" );
return $af_price;
}
return $price;
}
This archived topic is closed to new replies.