Skip to content

WooCommerce Rename Place Order Button at Checkout

WooCommerce Rename Place Order Button at Checkout

WooCommerce Rename Place Order Button at Checkout

Today, I will show you the easiest way to dynamically and conditionally change it based on the selected payment gateways while checking out. To do this? this snippet requires a payment gateway “ID”. Here is the reference for payment gateway IDs in case you don’t know how to retrieve them.

woocommerce find gateway ID

WooCommerce find gateway ID

PHP Snippet: Rename the “Place Order” Button Dynamically @ WooCommerce Checkout Page

 

/** * @snippet       Rename "Place Order" By Gateway @ WooCommerce Checkout * @how-to        Get Resources FREE * @author        WP Coders Club * @source		  https://wpcodersclub.com/woocommerce-rename-place-order-button-at-checkout/ * @compatible    WooCommerce 6 */ add_filter( 'woocommerce_available_payment_gateways', 'wpc_rename_place_order_button' );add_filter( 'woocommerce_available_payment_gateways', 'wpc_rename_place_order_button_bacs' ); function wpc_rename_place_order_button( $gateways ) {    if ( $gateways['cod'] ) {        $gateways['cod']->order_button_text = 'Confirm Cash on Delivery';    }     return $gateways;}function wpc_rename_place_order_button_bacs($gateways){	if($gateways['bacs']){        $gateways['bacs']->order_button_text = 'View Bank Details';	}    return $gateways;}

 

1 thought on “WooCommerce Rename Place Order Button at Checkout”

Leave a Reply

Your email address will not be published. Required fields are marked *