Sometimes you might want to change the “add to cart” text of the buttons on your WooCommerce setup. This is very easy to do, and all you need is to copy-paste this snippet inside the functions.php file of your theme (or child theme)

<?php
// Change 'add to cart' text on single product page
function wpharvest_add_to_cart_text() {
        return __( 'Add to cart', 'wpharvest' );
}
add_filter( 'woocommerce_product_single_add_to_cart_text', 'wpharvest_add_to_cart_text' );
// Change 'add to cart' text on archive product page
function wpharvest_archive_add_to_cart_text() {
        return __( 'add to cart', 'wpharvest' );
}
add_filter( 'woocommerce_product_add_to_cart_text', 'wpharvest_archive_add_to_cart_text' );

Did you find this snippet useful? If so, or if you encountered any issues with it, please let us know in the comments section below.

Published by Dragos Micu

WooCommerce

Leave a Reply

Your email address will not be published. Required fields are marked *

en la ruleta apuesta a un solo numero 66107 mx f12bet napoli vs real madrid juegos de casino sin internet sprintbet casino cn resena tragaperras online asgard juego de tragamonedas de frutas gana ya casino online spartan slots casino resena juego de cartas truco online gratis yabo casino china resena wildbet casino resena cuanto valen las fichas en blackjack la ruleta giratoria para jugar apuesta gana casino resena jugar blackjack gratis admiral 888 casino resena es winner casino spicy jackpots casino resena velobet casino casino en lnea mayapalace ruleta gratis jugar ahora slots city casino resena 1 casino en mar chiquita cuantas cartas se dan en el blackjack captainsbet casino ng resena apuestas ruleta seguras