In WooCommerce, I am looking for a function to change the "Place Order" text if cart has a specific product(ID) on checkout page.
This is useful for woo shops selling product and at the same time offering different services for example memberships. This will make the place order text more descriptive of the product as a Call to Action button.
I founded that function for change ‘add to cart' button text on single product page based on specific product id
add_filter( 'woocommerce_product_single_add_to_cart_text',
'woo_custom_cart_button_text' );
function woo_custom_cart_button_text( $text ) {
global $product;
if ( 123 === $product->id ) {
$text = 'Product 123 text';
}
return $text;
}
And changing the place order text globally;
add_filter( 'woocommerce_order_button_text', 'woo_custom_order_button_text' );
function woo_custom_order_button_text() {
return __( 'Your new button text here', 'woocommerce' );
}
Im looking for how to adapt them for checkout page.
Thanks.