I want to hide the price for guest user in woocommerce. i only want to show the price for logged in user. i tried few plugin but it does not work with your theme. some places still showing either the price or add to cart button. can you offer a custom code for it?
Sorry but this is a feature that is not offered by WooCommerce or our theme. We have the option to disable prices and add to-cart so you can use your Website as catalog mode, but we don't any option to hide prices and show them for the logged in users only.
Maybe there exist any plugin that can do this job.
P.S If you're looking for professional help in this matter, there's always someone available for such tasks on the WP Kraken or Codeable. Pricing and timeline are always straightforward there and that's the main reason for recommending those services.
Can you guide me on the codes/shortcode that u use for displaying the prices/add to cart button. i see u are not using the woocommerce own code but your own. then i could put in few codes in the child function.php to hide the price.
great! it is working. just one more thing. can i add a button that redirect to certain url? like 'please register to view pricing' button and then redirect to registration page? it will only show if the user is not login.
1) Basically I want to show the registration button on all single product page. This would replace the add to cart button. I do not wish non member to see the price and add to cart button. instead they need to create an account to see the price.
2) Your code previously work well but I notice that if I have variable product, the price range will show up for non member. Maybe additional code needed to hide this?
I think it does not working correctly. Please see the link. I can still see the add to cart button. Although the register button does appear just after the add to cart button.
hi,
I want to hide the price for guest user in woocommerce. i only want to show the price for logged in user. i tried few plugin but it does not work with your theme. some places still showing either the price or add to cart button. can you offer a custom code for it?
Hi planet99,
Sorry but this is a feature that is not offered by WooCommerce or our theme. We have the option to disable prices and add to-cart so you can use your Website as catalog mode, but we don't any option to hide prices and show them for the logged in users only.
Maybe there exist any plugin that can do this job.
P.S If you're looking for professional help in this matter, there's always someone available for such tasks on the WP Kraken or Codeable. Pricing and timeline are always straightforward there and that's the main reason for recommending those services.
Have a nice day!
Hi,
Can you guide me on the codes/shortcode that u use for displaying the prices/add to cart button. i see u are not using the woocommerce own code but your own. then i could put in few codes in the child function.php to hide the price.
thanks
Hi planet99,
You can add this code in functions.php (end of file):
It will hide price and add to cart functionality for guest users.great! it is working. just one more thing. can i add a button that redirect to certain url? like 'please register to view pricing' button and then redirect to registration page? it will only show if the user is not login.
thanks
Hi planet99,
Yes you can add it but with custom code. Can you tell me where do you want to show that text so I can help you with that.
Hi,
1) Basically I want to show the registration button on all single product page. This would replace the add to cart button. I do not wish non member to see the price and add to cart button. instead they need to create an account to see the price.
2) Your code previously work well but I notice that if I have variable product, the price range will show up for non member. Maybe additional code needed to hide this?
Thanks
Hi planet99,
I have modified the previous code I gave you to fix the issue with variable products, and it also shows the button for non logged users:
And it now works on variable products as well:
(view large image)
I hope you like it.
Hi,
I think it does not working correctly. Please see the link. I can still see the add to cart button. Although the register button does appear just after the add to cart button.
https://commercial.planetlighting.co.uk/product/12w-120-led-24v-ultra-warm-white-strip/
Hi planet99,
Can you please give us your WP credentials so I can test this code and make sure to hide add to cart for non logged in customers.
To include your credentials click Insert Credentials button in editor toolbar. (See how)
Your information is safe here (private) in this thread.
Hi planet99,
I have modified the code to work with variable products as well:
Result:(view large image)
I hope this works for you.
Thanks! Work perfect.
Glad to hear that planet99, wishing you a great week!
If you like our theme, it would help us a lot if you could give us five star rating on themeforest from your Downloads tab.
A huge thank you from Laborator in advance!