Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #249898

    Hi,

    We can’t provide prices for public so I have found a code that should remove/hide price and add to cart buttons:

    Pasted into functions-enfold.php not functions.php-I don’t know whether it’s correct.

    }
    add_filter(‘woocommerce_get_price_html’,’members_only_price’);

    function members_only_price($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 );
    remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_price’, 10 );
    return ‘Login or Register to view product prices.’;
    }

    }

    1. issue is that “Add to cart” is still visible for non logged user in sub category view just next to “show details” so he/she can add product to cart and obviously see the price next to “show details”
    It does apparently disappear when customers clicks on “show details” but it’s still visible on subcategory.
    2. Message ” Login or Register..” is shown only for the very first product on our online store below of short description, for the rest of the products, short description is shown..

    How to rectify these issues?

    #250144

    Hi asecco!

    You will need to hire a freelance developer to customize the output for the shop and products so that the plugin is integrated in fully. The theme uses some custom wrappers for some of the elements which may or may not need to be modified in addition to what the above code already does.

    Also to note is that new functions should go in functions.php.

    Best regards,
    Devin

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.