Skip to content
Advertisement

WooCommerce: change cart button text in loop to icon

I want to change the cart button text on archive pages to an icon.

I found a snippet which does that. But that also changes the link of the cart button:

JavaScript

Is there a way to change only the text of the button?

I know, that I could change the template file /loop/add-to-cart.php. But I need a solution based on a function.

Advertisement

Answer

That should do the trick. You can adjust the conditional statement. Right now it’s covering any taxonomy.php page, which are an archive page for the products (Woocommerce), and the regular archive.php page.

JavaScript

Learn more

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement