Hi @mareck1234,
Thank you for your message.
To add clarity to this enquiry, it sounds like a different hook would like to be used when rendering the Clearpay message and Express button (if Express Checkout is enabled). This functionality is not currently built into the plugin. A ticket has been raised internally to track discussion and prioritise the work.
In the meantime, the following code should attach the render_cart_page_elements
to the woocommerce_after_cart_totals
hook (this can be added to the functions.php
file):
if (
class_exists('WC_Gateway_Afterpay') &&
method_exists('WC_Gateway_Afterpay', 'getInstance') &&
method_exists(WC_Gateway_Afterpay::getInstance(), 'render_cart_page_elements')
) {
remove_action( 'woocommerce_cart_totals_after_order_total', array(WC_Gateway_Afterpay::getInstance(), 'render_cart_page_elements'), 10, 0 );
add_action( 'woocommerce_after_cart_totals', array(WC_Gateway_Afterpay::getInstance(), 'render_cart_page_elements'), 10, 0 );
}
Thank you.