• Resolved dfcdev

    (@dfcdev)


    hello, i had the following code implemented onto my child-them which basically hid all prices for non-logged in users:

    // * BEGIN Hide prices

    add_action(‘after_setup_theme’,’activate_filter’) ;
    function activate_filter(){
    add_filter(‘woocommerce_get_price_html’, ‘show_price_logged’);
    }
    function show_price_logged($price){
    if(is_user_logged_in() ){
    return $price;
    }
    else
    {

    remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’ );
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 10 );
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_add_to_cart’, 30 );
    return ‘Login for Pricing‘;
    remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_price’, 10 );

    }
    }
    // * END Hide prices

    it does not seem to be working after i made the latest woocommerce update, can someone pls assist?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter dfcdev

    (@dfcdev)

    in other words, the “log in for pricing” link has now disappeared from all of my products…

    Hi @dfcdev

    The same code is working fine for me. I am using v3.5.2 of WooCommerce and Storefront theme. If you are using theme other than Storefront or default WordPress theme then try switching your theme to see if that helps to find the cause.

    Regards,
    Kartik Parmar

    Plugin Support Ryan Ray, a11n

    (@ryanr14)

    Hi there,

    Hopefully the advice from @kartikparmar is helpful here. It may be a theme issue or some out of date plugins. Let us know what you find.

    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘hiding prices for non-logged in users’ is closed to new replies.