I need to change the order_button_text
for a specific payment gateway (COD in this case).
I could only get it to change globally (for all payment gateways) using:
add_action( 'woocommerce_after_add_to_cart_button', 'multiple_orders_text' );
function woo_custom_order_button_text() {
return __( 'Request Shipping Quote', 'woocommerce' );
}
But have found that if I add the line
$this->order_button_text = __( 'Request a Quote', 'woocommerce' );
to the setup_properties()
method in woocommerce/includes/gateways/cod/class-wc-gateway-cod.php
it does work.
However this is clearly bad practice as I'm hacking a core plugin file.
How can I achieve this without hacking a woocommerce core file?