switch to site locale before translating refund reason

This commit is contained in:
Ron Rennick 2020-08-13 10:32:19 -03:00
parent cbfe4bd595
commit 38d358490b
1 changed files with 2 additions and 0 deletions

View File

@ -778,6 +778,7 @@ function wc_order_fully_refunded( $order_id ) {
}
// Create the refund object.
wc_switch_to_site_locale();
wc_create_refund(
array(
'amount' => $max_refund,
@ -786,6 +787,7 @@ function wc_order_fully_refunded( $order_id ) {
'line_items' => array(),
)
);
wc_restore_locale();
$order->add_order_note( __( 'Order status set to refunded. To return funds to the customer you will need to issue a refund through your payment gateway.', 'woocommerce' ) );
}