Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    Please try this code in your functions.php

    add_action('init', 'remove_price_ifnotloggedin');
    function remove_price_ifnotloggedin() {
    	if ( !is_user_logged_in() ) {
    		remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
    		remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
    	}
    }

    Regards
    Safeer

    Thread Starter loro11

    (@loro11)

    Thanks 🙂 I think it will work

    Happy Holidays!

    What about for hiding the prices on the shopping cart/check out page?

    inside theme function.php?

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