Skip to content

Instantly share code, notes, and snippets.

@arfinmilondev
Created May 19, 2025 09:28
Show Gist options
  • Select an option

  • Save arfinmilondev/69108bc7daeaf47c33d318fc8eb18f55 to your computer and use it in GitHub Desktop.

Select an option

Save arfinmilondev/69108bc7daeaf47c33d318fc8eb18f55 to your computer and use it in GitHub Desktop.
Change woocommerce add to cart text
<?php
/**
-----------------------------------------------------------------------------
Change woocommerce add to cart text
-----------------------------------------------------------------------------
*/
add_filter( 'woocommerce_product_single_add_to_cart_text' , 'woo_custom_cart_button_text' );
function woo_custom_cart_button_text() {
return __('Buy Now!' , 'woocommerce');
}
add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_shop_page_add_to_cart_callback' );
function woocommerce_shop_page_add_to_cart_callback() {
return __( 'Buy Now', 'woocommerce' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment