The idea here is to include the price (example: $40) with the button text, making it like this: "Place Order & Pay $40".
That is the expected outcome but the code I'm using (with or without wc_price()) only generates a span tag on the button.
I know that I can just add the currency symbol myself into the button text, but the idea is to make it global.
My code so far:
add_filter('woocommerce_order_button_text', 'place_order_button_with_order_total');
function place_order_button_with_order_total(){
$order_value = wc_price(WC()->cart->total);
return __('Place Order & Pay '.$order_value., 'woocommerce');
}
How do I change the code to include the price in the button text?