WooCommerce Deposits Add to Cart Issue

If you are a WooCommerce user, you may have come across an issue where on both archive (shop) pages and single product pages, the ‘add to cart’ button says, ‘read more’. Or, more importantly, you may not want to have the button say, ‘add to cart’ at all. This lovely little function can be added to your functions.php file to not just deal with the issue, but allow you to customise the button based on your product type.

However, I came across a complication today. If you install WooCommerce Deposits, it overwrites all of these, changing the button text to ‘select options’. On inspection, it appears that WooCommerce Deposits uses it own filter for displaying text. Therefore, to make the code above also work with Deposits installed, you need to hook into that filter too:

I hope you no longer have to tear your hair out to the same extent as I have. Not that I had much to start with.

Shares

Ben Roberts

Thank you for reading! I'm Ben, a web developer from Hertfordshire. I love writing about problems I've been able to solve, or very ocasionally, those that I can't. Sometimes I write about other things, such as cybersecurity, which has always fascinated me. If there is anything you'd like help with, or explained better, let me know in the comments below.