• Resolved saznajnovo

    (@saznajnovo)


    Hi,
    I notice errors in my debug log like this:
    PHP Notice: Undefined index: billing_state in /wp-content/plugins/woo-manage-fraud-orders/includes/class-wmfo-track-fraud-attempts.php on line 138
    So, the problem is that I removed some fields from the checkout, like state and postcode. For example:

    add_filter('woocommerce_checkout_fields','custom_override_checkout_fields', 1000, 1);
    function custom_override_checkout_fields( $fields ) {
    	unset($fields['billing']['billing_state']);
    	unset($fields['billing']['billing_postcode']);
    	return $fields;
    }

    Now, some themes and plugins are doing the same thing if they provide options to disable some checkout fields.

    So, I think you should first check if field exists and if it is not empty, and only than extract information from it. Apply this logic to all fields and it should fix the problem.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Bug: Undefined index: billing_state’ is closed to new replies.