Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( !is_user_logged_in()) {
- function exclude_product_from_users($q){
- $current_user = wp_get_current_user();
- $prodcuts_ids = array(648);
- $q->set( 'post__not_in', $prodcuts_ids );
- }
- add_action( 'woocommerce_product_query', 'exclude_product_from_users' );
- }
Add Comment
Please, Sign In to add comment