🎉 Happy 4th of July! Get 15% off GP Premium with the discount code: 4THOFJULY2020

[Resolved] woocommerce_product_get_price equals 0 in cart

Home Forums Support woocommerce_product_get_price equals 0 in cart

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1130436
    Marinex

    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;
    }

    #1130757
    David
    Staff
    Customer Support

    Hi there,

    maybe this Stack topic will provide some pointers:

    https://stackoverflow.com/a/47788626

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.