I have the Catalog Visibility Options plugin set to hide prices and add to cart from users who are not logged in. This works fine, EXCEPT on the products category page “Quickview” popup where they can see the prices and add to cart button without being logged in.
ThanksTheme version: 1.5 WooCommerce version: 2.3.9
I’ve checked Quick View and price isn’t shown there:
Please clear browser cache and check again.
Hello Eva – No the price is NOT showing on the live site because
The price and add to cart are only supposed to be for logged in users, so Until the issue is fixed I have had to disable them in the theme settings.
I DO want to show the price and “add to cart” for logged in users only on the quickview, and that is what I am asking about.
Please see the image below in private content and you will see what it looks like to a visitor that is Not logged in.
ie. The price and “add-to-cart” are hidden on the category page but ARE showing on the quickview.
I am using the Woocommerce Catalog Visibility Options plugin
Try to edit the file product-quick-view.php in the directory wp-content/themes/woopress/woocommerce, find the lines 51 and 59 and replace the code
<?php if (etheme_get_option('quick_price')): ?> with
<?php if (etheme_get_option('quick_price') && is_user_logged_in()): ?>
replace this code
<?php if (etheme_get_option('quick_add_to_cart')): ?> with this one
<?php if (etheme_get_option('quick_add_to_cart') && is_user_logged_in()): ?>.
Please try it.
Thank you for the code updates
Yes – that seems to be working fine now, and only logged in users can see the price and add-to-cart.
What happens if we update theme – will we have to edit this file every time?
please create child theme and move to it your edited theme files before update. In this case you will not lose customization on theme update.
You can read more about child themes here: https://codex.wordpress.org/Child_Themes
You must be logged in to reply to this topic.Log in/Sign up
One standard license is valid only for 1 project. Running multiple projects on a single license is a copyright violation.
The message was successfully sent
Your shopping cart is empty
Seems you did not register purchase code for WooPress WordPress Support Forum to be able to create a topic on this forum.