Skip to content

Instantly share code, notes, and snippets.

@thegdshop
Created March 20, 2012 22:08
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thegdshop/2141771 to your computer and use it in GitHub Desktop.
Save thegdshop/2141771 to your computer and use it in GitHub Desktop.
WooCommerce - Change add to cart button text
<?php
add_filter('single_add_to_cart_text', 'woo_custom_cart_button_text');
function woo_custom_cart_button_text() {
return __('My Button Text', 'woocommerce');
}
?>
@shaivure
Copy link

Hey, could you explain how to use this? I'm new to WooCommerce and php and a few pointers about where to add this would be very much appreciated. Thanks

@Ya2Sabe
Copy link

Ya2Sabe commented May 24, 2012

*edit

I found it :] just add "color: #fff !important;" to the code! So anyone can add "" a.button, button.button, input.button, #review_form #submit { color: #fff !important; background: #558ed5; } "" to their custom css...

Thanks,

Ya2Sabe ..a.k.a.. You Already Know

@wpninja-1
Copy link

I tried adding this inside php tags, but its not changing anything..
http://staerk-reklamebureau.dk/jing/2012-08-16_1128.png

@mchrislay
Copy link

Could you tell me how to change "Completed" to "Shipped" on the Check Order Status Page?

Thanks!

@squaremunkey
Copy link

This does not seem to work for me. Is there an updated snipped. Thanks

@squaremunkey
Copy link

It does work but doesn't change it everywhere just on the single product page. I'll see if i can modify it elsewhere. Is there a way to change the word cart throughout the woo commerce? I'd like to change it to basket. Anyone have any tips, snippets? Thanks.

@fender841
Copy link

Snippet to change button text on category view pages. Basically just change 'single_add_to_cart_text' to 'add_to_cart_text'
https://gist.github.com/fender841/5255958

@peternortefb
Copy link

I just had a fatal error in here. i added theses lines in woocommerce-core-functions.php . Think im wrong cause it shuld be in functions.php... Suddenly my webstite is down and cannot access tu www.mysite.com/wp.admin. But still have access via ftp.
I reallny need help. any ideas of what to do?

@technologers
Copy link

hey peternortefb..

same error is occur with my site and solved it.
you can go to ur cpanel and then open function.php through file manager then delete the code which u pasted..

problem solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment