How To Change The Default Add To Cart Text In WooCommerce

Last Updated on 6th December 2019 by James Thomas
Table of Contents

WooCommerce provides many options for customising and styling your site. Depending on the theme or page builder you integrate with WooCommerce, may have control over the content displayed in the Add To Basket or Add To Cart button.

However if for example you are using WooCommerce with Elementor, you won’t have the ability edit the Add To Basket text, instead you will have to use a PHP snippet to do this.

Changing the add to basket text

To alter your add to basket text, first ensure that you have a child theme setup on your website, as you will need to access the functions.php file of your child theme.

Navigate to Appearance > Theme Editor and access the functions.php file.

To change the default WooCommerce add to cart text, you can use a PHP snippet targeting the ‘woocommerce_product_single_add_to_cart_text’ filter. Simply pass a function to the filter as the second parameter and alter the text within your function using a return statement.

Provided below is an example snippet you can use to do this on your site.

Line 3 which reads ‘Add to the basket’ is the text you can alter as necessary. Ensure that you keep the formatting or the code will not work.

WooCommerce change default add to cart text

Visit our new course

WP The Easy Way

Say goodbye to fancy themes, custom code, too many plugins, code conflicts and
endless WordPress headaches. Build your WordPress website the EASY way.

Say goodbye to fancy themes, custom code, too many plugins, code conflicts and endless WordPress headaches.

Build your WordPress website the
EASY way!

Build your WordPress website the EASY way

WP The Easy Way is a completely FREE video course that will teach you how to build WordPress websites without a theme, lots of plugins or a developer.

Please accept the Terms and Conditions to proceed.