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

    I have been using the following for a long time in my child theme functions.php on my site to have
    Login or Register show instead of the price when a user is not logged in… but now since either the upgrade to Enfold 2.5.2 AND/OR the upgrade to WooCommerce 2.1.x nothing displays at all… I am not sure if it has to do with Enfold or Woo because I updated them at the same time… When logged in the price shows though…

    Can you please lend me a hand in getting it to work again… you guys rock…

    add_filter( 'woocommerce_sale_price_html','members_only_price' );
    add_filter( 'woocommerce_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="' .get_permalink(woocommerce_get_page_id('myaccount')). '">Register</a> to see price!';
    }
    • This topic was modified 10 years, 2 months ago by FLSouthPaw.
    #224802

    Hi Mark!

    Can you please give us a link to the website? I think it is the woocommerce update because I used the an older version of the plugin and it works. Please try to ask the woocommerce support team.

    Cheers!
    Ismael

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