Single Product Layout - Condition to show / hide if product in cart

Hi there,

I have a product that’s sold individually - I need to add a notice to the single product page that replicated woocommerce behavior when you try and add an individually sold product to your cart, when it’s already in your cart. By default, woocommerce displays a notice saying something like, this product is already in your cart.

I have the notice ready to go and need to show it in following conditions:

  • Product is - sold individually (I have enabled this option)
  • Product is - in cart (cannot figure this out)

Can you please let me know how to add this to my Layout? Thanks

Hello @katie_s_mills,

Thanks for writing in! Regretfully there is no such condition that is “Product is in Cart”. We highly recommend that you use the Shop Notices WooCommerce dynamic element instead. This is where the WooCommerce Notices to display that your product is already added to the cart.

Best Regards.

Thank you! That’s exactly what I was looking for!

Hi @katie_s_mills,

You’re welcome! Glad to hear that solves it for you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.