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 *

tragamonedas de cinco tambores juega gratis a las slots de belatra casino tragaperras online hot safari synot games 27th cabaret todo sobre la actualizacion a la ley de juego online en peru blog faq ruleta casino gratis y sin descargar tragaperras online flying pigs es juegos software betsoft es noticias auge casinos colombia es luckia casino app qu juegos de casino te pagan dinero real 60866 silver fox slots casino resena juegos casino apk es egt egypt sky casinos fuera de espaa fire in the hole 3 lopebet casino resena spin samba casino resena mexico playzee ameba entertainment alliance 2 slot boss casino resena se puede vivir de las apuestas deportivas ainsworth eagle bucks bermeo casino codigo promocional y bonus code 81783