Changed thank you page text to follow PayPal guidelines

This commit is contained in:
Claudio Sanches 2019-10-02 14:17:25 -03:00
parent c671e89769
commit b655af2e3b
1 changed files with 17 additions and 0 deletions

View File

@ -72,6 +72,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
add_action( 'woocommerce_order_status_processing', array( $this, 'capture_payment' ) );
add_action( 'woocommerce_order_status_completed', array( $this, 'capture_payment' ) );
add_filter( 'woocommerce_thankyou_order_received_text', array( $this, 'order_received_text' ), 10, 2 );
if ( ! $this->is_valid_for_use() ) {
$this->enabled = 'no';
@ -450,4 +451,20 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
wp_enqueue_script( 'woocommerce_paypal_admin', WC()->plugin_url() . '/includes/gateways/paypal/assets/js/paypal-admin' . $suffix . '.js', array(), WC_VERSION, true );
}
/**
* Custom PayPal order received text.
*
* @since 3.9.0
* @param string $text Default text.
* @param WC_Order $order Order data.
* @return string
*/
public function order_received_text( $text, $order ) {
if ( $this->id ) {
return esc_html__( 'Thank you for your payment. Your transaction has been completed, and a receipt for your purchase has been emailed to you. Log into your PayPal account to view transaction details.', 'woocommerce' );
}
return $text;
}
}