Fix current tab setting

This commit is contained in:
Fernando Marichal 2022-02-10 17:54:29 -03:00
parent 4d7e8ce2e8
commit 780a703aa7
1 changed files with 6 additions and 3 deletions

View File

@ -3075,10 +3075,13 @@ class WC_AJAX {
*/
public static function toggle_gateway_enabled() {
if ( current_user_can( 'manage_woocommerce' ) && check_ajax_referer( 'woocommerce-toggle-payment-gateway-enabled', 'security' ) && isset( $_POST['gateway_id'] ) ) {
global $current_tab;
// Set current tab.
$current_tab = 'checkout';
$referer = wp_get_referer();
if ( $referer ) {
global $current_tab;
parse_str( wp_parse_url( $referer, PHP_URL_QUERY ), $queries );
$current_tab = $queries['tab'] ?? '';
}
// Load gateways.
$payment_gateways = WC()->payment_gateways->payment_gateways();