Home Forums WoodMart support forum HIDE SIZE GUIDE TO GUEST USER Reply To: HIDE SIZE GUIDE TO GUEST USER

#74151

WebMpt
Participant

Is a usual code to hide price to guest user, but I need to hide size guide to guest user.
Link pasted before.

add_action (‘after_setup_theme’,’active_filter’);

function active_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’,’wooocommerce_template_loop_add_to_cart’);
remove_action (‘woocommerce_single_product_summary’,’wooocommerce_template_single_add_to_cart’, 30);
remove_action (‘woocommerce_single_variation’, ‘woocommerce_single_variation_add_to_cart_button’, 20 );
return ‘<span class=”login_price”>Login per visualizzare i prezzi</span>‘;
}
}