Hide related products from non logged in users
-
Hi there,
I want to hide related products (upsell/crossell) for non-login users.
I found this hook.
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
However, related products are still displayed.
On the support thread I found this (link)
// Disable OceanWP upsells add_filter('theme_mod_ocean_woocommerce_upsells_count', 'my_theme_mod_ocean_woocommerce_upsells_count', 10 ); function my_theme_mod_ocean_woocommerce_upsells_count() { return '0'; }
it was successful to eliminate related products.
So my question,
1. How to hide related products for users who are not logged in?
2. If there is no solution for point 1, how to make the above code snippet work for a user who is not logged in?
Thank you
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Hide related products from non logged in users’ is closed to new replies.