As WooCommerce powers over 28% of all online stores, so often store owners looks to provide a unique flavor to there online shop. One of the question that most of the WooCommerce user ask is “How they can change the ADD TO CART text on the button”. The solution is quite easy. You just need to use 2 filters, one for Product Single Page and second is for rest of the shop, i.e., on the Shop page, Related Products Listing, etc.

Code For Woocommerce Product Single Page

add_filter( 'woocommerce_product_single_add_to_cart_text', 'alter_woocommerce_product_single_add_to_cart_text', 10, 2 );
function alter_woocommerce_product_single_add_to_cart_text( $addToCartText, $productReference ) {
	$addToCartText = 'Buy Me';
	return $addToCartText;
}

Code For Woocommerce Shop Page

add_filter( 'woocommerce_product_add_to_cart_text', 'alter_woocommerce_product_add_to_cart_text', 10, 2 );
function alter_woocommerce_product_add_to_cart_text( $addToCartText, $productReference ) {
	$addToCartText = 'Add To Basket';
	return $addToCartText;
}

Now its time for a bonus trick. Now I will tell you how to change the PLACE ORDER text on button on Checkout page.

add_filter( 'woocommerce_order_button_text', 'alter_woocommerce_order_button_text', 10, 1 );
function alter_woocommerce_order_button_text( $orderButtonText ) {
	$orderButtonText = 'Allow Us To Serve You!';
	return $orderButtonText;
}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.