Dear sir
With this function we hide the prices for non login users
add_filter(‘woocommerce_get_price_html’, ‘bbloomer_show_price_logged’);
function bbloomer_show_price_logged($price){
if(is_user_logged_in() ){
return $price;
}
else
{
add_action( ‘woocommerce_product_meta_end’, ‘bbloomer_print_login_to_see2’, 31 );
add_action( ‘woocommerce_after_shop_loop_item’, ‘bbloomer_print_login_to_see’, 11 );
remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 10 );
remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 10 );
remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_add_to_cart’, 30 );
remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_price’, 10 );
}
}
function bbloomer_print_login_to_see() {
echo ‘‘ . __(‘Login to see prices’, ‘theme_name’) . ‘‘;
}
function bbloomer_print_login_to_see2() {
echo ‘‘ . __(‘ <h4 style=”background-color:rgba(26, 173, 163, 0.59)”>Login to see prices</h4>’, ‘theme_name’) . ‘‘;
}
I want to know if its posible to hide also the short description for non login users ?????????
Thank you