Replacing “Place Order” Button on Checkout Page
-
Hello,
I am currently developing a custom plugin ,
Part of the functionality requires replacing the “Place Order” button with a “Connect Discord” button if the user has not connected their Discord account.
I’ve attempted to use the following action hooks and filters, but they don’t seem to be applied:
add_filter( 'woocommerce_order_button_html', 'custom_replace_order_button', 99 );
add_action( 'woocommerce_review_order_before_submit', 'custom_render_buttons' );
Despite these attempts, the hooks don’t seem to take effect. I also inspected the HTML and noticed that the “Place Order” button is controlled by JavaScript in the actions-frontend.js file located in
woocommerce/assets/client/blocks/checkout-blocks.
My Question:
Has anyone encountered a similar issue with replacing the “Place Order” button? What would be the best approach to conditionally replace this button with a custom button when certain conditions are not met?I appreciate any guidance or suggestions!
- The topic ‘Replacing “Place Order” Button on Checkout Page’ is closed to new replies.