1. Home
  2. Knowledge Base
  3. WooCommerce Product Table
  4. Advanced Usage
  5. Changing the “Add to cart” text in the product table

Changing the “Add to cart” text in the product table

WooCommerce Product Table uses the same “Add to cart” button text as the main WooCommerce plugin.

If you wish to modify this text, you can use the woocommerce_product_single_add_to_cart_text filter provided in WooCommerce. Using this filter 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 quote'; // change as required
     }
     return $text;
 }

Was this article helpful?

Related Articles