1. WooCommerce Product Table
  2. Advanced Usage

Changing the ‘Add to cart’ text in the product table

WooCommerce Product Table uses the same ‘Add to cart’ button text as WooCommerce itself.

Change the cart button text using our Custom Add to Cart Button plugin

You can easily change the add to cart text throughout your store using our free WooCommerce Custom Add to Cart Button plugin, which integrates with WooCommerce Product Table.

Download Plugin

Change the cart button text using a code snippet

Alternatively, you can use the woocommerce_product_single_add_to_cart_text hook provided in WooCommerce. Using this hook will modify the text everywhere in your store, including the single product pages. If you only want to change it in the product tables, use the code as provided below:

add_filter( 'add_to_cart_text', 'wcpt_modify_add_to_cart_text', 999 );
add_filter( 'woocommerce_product_single_add_to_cart_text', 'wcpt_modify_add_to_cart_text', 999 );

function wcpt_modify_add_to_cart_text( $text ) {
    if ( did_action( 'wc_product_table_before_get_data' ) ) {
        $text = 'Add to Order'; // set your button text as required
     }
     return $text;
 }

 

Still need help?
If searching the knowledge base hasn't answered your question, please contact support.

Related Articles