• Hello!

    I need a professional advise.

    I need a simple function that will block&replace some WP-WooC database widely used data (as Site Name, User Name, Taxonomies, Products Attributes, etc) from unregistered users. For example authors names will shown for unregistered users as “Register to see”. So I want to make a function that will be like a low-level filter and will work with ALL OTHER plugins by blocking&replacing chosen info for them too.

    I hear opinion from one developer, that “WooCoomerce hooks” cannot guaranty that this function will work with all other plugins and custom pages etc. Also a working logic is a pile-jumble with extra work and maybe not secure because protected info will be replaced after retrieving. But I want to block even retrieving of this info for all Wp-WooC requests-plugins!

    What method you suggest? Does WP-WooC support low-level filters direct at MySQL DB?

    • This topic was modified 5 years, 6 months ago by justdude.
Viewing 2 replies - 1 through 2 (of 2 total)
  • calvin

    (@calvinorenda)

    Ummm, i am not familiar with storefront but i do know if you change the template file’s code on the line that shows the info by doing something like this you can achieve what you wanted,

    <?php
    if ( is_user_logged_in() ) {
    echo $the_original_data;
    } else {
    echo ‘Please register to view’;
    }
    ?>

    https://developer.www.ads-software.com/reference/functions/is_user_logged_in/

    Thread Starter justdude

    (@justdude)

    Thanks for an answer!

    But PHP code like: “” – will NOT work on a custom pages where it absent. So it must be added to each page?? It’s not elegant for sure.

    “WooCoomerce hooks” seems that will NOT work with all other and custom plugins and custom pages etc outside WooCoommerce itself.

    Also a working logic of both of them a pile-jumble with extra work and maybe not secure because protected info will be replaced after retrieving from DB. But I want to block this info for all Wp-WooC requests-plugins for sure!

    Does WP-WooC support low-level filters direct at MySQL DB? Does EACH query-select to DB have a USER_ID so it can be used for each query user right recognizing?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How restrict some data for some users?’ is closed to new replies.