Skip to content

Commit

Permalink
Update the place order button text
Browse files Browse the repository at this point in the history
  • Loading branch information
mahdiyazdani committed Aug 3, 2023
1 parent cb72efd commit bc544fe
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/WooCommerce/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function setup() {
add_action( 'woocommerce_before_checkout_form', array( $this, 'enqueue_checkout_assets' ) );
add_action( 'woocommerce_pay_order_before_submit', array( $this, 'enqueue_checkout_assets' ) );
add_action( 'woocommerce_before_checkout_form', array( $this, 'apply_coupon_via_url' ) );
add_filter( 'woocommerce_order_button_text', array( $this, 'update_place_order_button_text' ) );
add_filter( 'woocommerce_coupon_message', array( $this, 'update_coupon_message' ), 10, 3 );
add_filter( 'woocommerce_checkout_fields', array( $this, 'unset_checkout_fields' ) );
add_action( 'woocommerce_thankyou_woo-paddle-gateway', array( $this, 'save_checkout_hash' ) );
Expand Down Expand Up @@ -94,6 +95,18 @@ public function apply_coupon_via_url() {
WC()->cart->add_discount( wc_clean( $coupon_code ) );
}

/**
* Update the place order button text.
*
* @since 1.0.0
*
* @return string
*/
public function update_place_order_button_text() {

return __( 'Complete Checkout', 'woo-paddle-gateway' );
}

/**
* Update the coupon message to display the coupon description.
*
Expand Down

0 comments on commit bc544fe

Please sign in to comment.