Rename “Add to Cart” Button if Product Already at Cart

By | May 31, 2018

If Product already at WooCommerce Cart than change “Add to Cart” Button text and Displaying a different text instead of default “Add to Cart” text. So user can easily communicate with product. In Woocommerce it’s very easy. Woocommerce provide 2 filter hook for that. one filter hook for the Single Product page and another filter hook for the other pages such as Shop.

So first, we want to check if the product is already in user cart. Then according to the status of the product, we want to return the text for the Add to Cart button.

Add this code in your theme’s functions.php file of your active child theme (or theme).