Support » Plugins and Hacks » Hide Price for variations until a variation has been selected

  • iwednesday

    (@slicer74)


    Hi,

    Is there a way to hide the price until a variation has been selected?

    I have seen code to disable price unless the user is logged in .

    How could i modify such code?

    add_filter('woocommerce_get_price_html','members_only_price');
    function members_only_price($price){
    if(is_user_logged_in() ){
        return $price;
    }
    else return '<a href="' .get_permalink(woocommerce_get_page_id('myaccount')). '">Login</a> or <a href="'.site_url('/wp-login.php?action=register&redirect_to=' . get_permalink()).'">Register</a> to see price!';
    }

    Any help would be great thanks

  • The topic ‘Hide Price for variations until a variation has been selected’ is closed to new replies.