Home Forums Basel support forum Short description for logged users

Short description for logged users

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #26379

    WEBMAZE
    Participant

    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

    #26382

    Artem Temos
    Keymaster

    Hi,

    Could you please send us a screenshot of what do you want to hide?

    #26385

    WEBMAZE
    Participant

    SENT IMAGE
    Also how can I change the icon of Quick view and the word “Quick view” to something else?
    Thank you

    Attachments:
    You must be logged in to view attached files.
    #26388

    Artem Temos
    Keymaster

    Try to add the following code snippet to the Custom CSS area in Theme Settings to do this

    body:not(.logged-in) .product-excerpt {
    	display: none;
    }

    Quick view text can be edited with Loco Translate plugin. Unfortunately, there is no other icon options for it.

    #26391

    WEBMAZE
    Participant

    thank you sir its done..
    I use this for single product to hide “short description” page for non login people, and works …its ok?????????

    body:not(.logged-in) .woocommerce-product-details__short-description{
    display: none;
    }

    thank you

    #26396

    Artem Temos
    Keymaster

    Yes, it is correct.

Viewing 6 posts - 1 through 6 (of 6 total)