While working on a workaround for a client, I had to hide a hidden product from the cart, checkout, order received and emails. Hidden products already don’t show on the shop and category pages, but they do show on the cart if they’re added to cart “programmatically”.
A tough task, but as usual here I come with the solution
PHP Snippet: Hide Hidden Products from WooCommerce Cart, Checkout, Order, Emails
Where to add this code?
You can place PHP snippets at the bottom of your child theme functions.php file (and in case of CSS, this goes at the bottom of the style.css file) – if you need more guidance, please take a look at my free WooCommerce Customization video tutorial.
Did this snippet work?
Please let me know in the comments if everything worked as expected. I would be happy to revise the snippet if you report otherwise.
And if you think this code saved you time & money, please join the other Business Bloomer supporters and avail of 365 days of WooCommerce benefits. Thank you in advance! Rodolfo,