Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello there,

    Try to use the following code.

    add_filter('woocommerce_product_add_to_cart_text', 'modify_add_to_cart_text', 10, 2);
    function modify_add_to_cart_text($product){
    
    	global $product;
    	$text = $product->is_purchasable() && $product->is_in_stock() ? __( 'My add to cart', 'textdomain' ) : __( 'Read More', 'textdomain' );
    	return $text;
    
    }
    
    add_filter('woocommerce_product_single_add_to_cart_text', 'modify_add_to_cart_text_in_single');
    function modify_add_to_cart_text_in_single(){
    	return __('My add to cart', 'textdomain');
    }

    Put them in functions.php file. You should need to adjust the “My add to cart” text to meet your need.

    I hope it helps.

    Thread Starter Sandra Boulou

    (@debby78018)

    Thanks a lot Kharis finally the add filter working :))
    Have a nice day !
    SB

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘woocommerce change add to cart text in Genesis’ is closed to new replies.