Okay
  Public Ticket #3505674
Hide price for guests - how to disable sorting and filtering by price?
Closed

Comments

  •  2
    Niko started the conversation

    I am developing B2B store with B2C guest access. Hi, I was discussing the issue with store owner and I have been told that "hide price for guests (not logged in visitors) must not disclose the price in any way! Currently visitor can sort products by price and in this way get a clue on the price, or visitor can filter products by price ranges (i.e. from $100 to $120) and get idea of the price. This must not happen.

    Is it possible to remove these features for B2C (guest users) so that visitors (guests) shall not be able to sort by price nor filter by price??

    I am using SAVOY theme. The site is in the process of development.

    Thanx a lot !!!

  •  2,218
    WebWizards replied

    Hi Niko,

    I'd be happy to assist,

    My suggestion for resolving this would be to hide the price filtering areas through group-specific CSS. Through B2BKing you can apply CSS for only specific users, groups, logged out, b2b, b2c, etc. You can find more information on it here: https://woocommerce-b2b-plugin.com/docs/shortcode-to-restrict-content-to-b2b-b2c-user-groups-specific-users/


    I checked your site at https://e-lkn.com/ , I see

    3828232999.png

    To hide those for logged out users, you can add this CSS to your site:

    .b2bking_logged_out ul#nm-product-sorting li:nth-child(5), .b2bking_logged_out ul#nm-product-sorting li:nth-child(6) {
        display: none;
    }



    Is there any other area that you'd like removed? I couldn't find the price $100-$120 range that you mentioned - let me know where it is and I can help send you the correct CSS to hide that,


    Kind regards,

    Stefan

  •  2
    Niko replied

    I have added now 2 widgets for Price Filters
    These are from Savoy theme
    Thank you

  •  2,218
    WebWizards replied

    I checked the site now again and I can see the 2 price filters.

    To hide those for logged out users, please add this CSS to your site:

    .b2bking_logged_out #woocommerce_price_filter-2, .b2bking_logged_out #nm_woocommerce_price_filter-2{
        display:none !important;
    }

    Let me know if I can assist with anything,

  •   Niko replied privately
  •  2,218
    WebWizards replied

    Hi Niko,

    (2) Regarding the registration form:

    A quick thing you can do to add some fixes to that page is to add this PHP code snippet to your site:

    add_action('wp_head', function(){
        ?>
        <style type="text/css">
            .b2bking_checkbox_registration_field {
                margin-right: 10px;
            }
            h2.b2bking_b2bregistration_only_register_header {
                margin: 21px 0px;
            }
        </style>
        <script>
            jQuery(document).ready(function(){
                jQuery('input[name="b2bking_custom_field_2607"]').parent().parent().parent().find('.form-row:nth-child(1),.form-row:nth-child(2),.form-row:nth-child(3)').css('margin-bottom','5px');
                jQuery('label[for="b2bking_field_2617"]').parent().parent().find('.form-row:nth-child(1)').css('margin-bottom','5px');    
            });
        </script>
        <?php
    });
    

    A PHP snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/


    Regarding the shipping state, probably the best way to handle it is to configure it as a Select dropdown with each US state as an option:

    6713579495.png


    I can set it up for you if you'd like to share a backend login to the site, or to a staging clone site,


    (1) Here I see what you mean:

    Indeed these were developed at different times, originally the plugin had the conversations / subaccounts style, but over time we developed more features such as the cream order form and went with a different style there. Certainly there's an opportunity for us there to work on the design so these are a better match - this is definitely something we're looking at for future updates and thank you for the feedback,


    While I don't have a way to do a significant redesign right now, something I'd suggest that can be easily applied is probably going with some neutral / black / gray colors for the buttons instead of the default blue: some of it can be controlled here in B2BKing -> Settings -> Other -> Color:

    6521010890.png


    I can also try to set this up directly if it would help,


    Kind regards,

    Stefan