Last active
September 20, 2021 13:11
-
-
Save jorpdesigns/4c2653e92dc445355faeb8a4fe77cf38 to your computer and use it in GitHub Desktop.
Snippet to change "Add to Cart" button text on WooCommerce archive and single product pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ARCHIVE | |
add_filter('woocommerce_product_add_to_cart_text', 'custom_archive_cart_button_text'); | |
function custom_archive_cart_button_text() { | |
return __('Purchase', 'woocommerce'); | |
} | |
// SINGLE PAGE | |
add_filter('woocommerce_product_single_add_to_cart_text', 'custom_single_cart_button_text'); | |
function custom_single_cart_button_text() { | |
return __('Add to Basket', 'woocommerce'); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment