I have a quick question. I have Woo Commerce Composite Products and the following code can be found in woocommerce-composite-products/includes/class-wc-product-composite.php on lines 1783-1801:
/**
* Get the add to cart button text for the single page.
*
* @return string
*/
public function single_add_to_cart_text() {
$text = __( 'UPDATE PRICE', 'woocommerce' );
if ( isset( $_GET[ 'update-composite' ] ) ) {
$updating_cart_key = wc_clean( $_GET[ 'update-composite' ] );
if ( isset( WC()->cart->cart_contents[ $updating_cart_key ] ) ) {
$text = __( 'Update Your Package', 'woocommerce-composite-products' );
}
}
return apply_filters( 'woocommerce_product_single_add_to_cart_text', $text, $this );
}
I have changed one line by hard coding it as follows:
$text = __( 'GET PRICE', 'woocommerce' );
I wanted to do this in the functions file, but it didn't work. I saw the article here https://docs.woocommerce.com/document/change-add-to-cart-button-text/ and tried this but this didn't work because it ends up ignoring all the code in lines 1792-1798. I also tried to just add lines 1792-1798 into this function woo_custom_cart_button_text() from the article and that didn't work. How would I make this change in the functions file? I don't see any example code on this filter on how I would make such a change. I also need to make other woo commerce changes that would require more advanced php skills beyond what woo commerce documentation can show me. What do I do? Can anyone help?