I'm trying to create a custom payment gateway that is based on a javascript API. The button at checkout has to work like the paypal checkout button works which opens another window but I can't find a way to replace the button. Since the button is loaded by javascript and the html is just a place
add_filter( 'woocommerce_order_button_html', 'custom_order_button_html');
function custom_order_button_html( $button ) {
// The text of the button
$order_button_text = __(' order', 'woocommerce');
// HERE you make changes (Replacing the code of the button):
$button = '<div id="custom_Checkout_Button"></div>';
}
I put this function in function __construct
but it doesn't replace.
The scripts are loading appropriately. If I load the script through console its loading fine.