• Resolved haxball100

    (@haxball100)


    Hello. Sometimes, when I enter my website, I getting this warning:

    Warning: array_key_exists() expects parameter 2 to be array, string given in /home/caauty/domains/camourbeauty.com/public_html/wp-content/plugins/hide-shipping-method-for-woocommerce/public/class-woo-hide-shipping-methods-public.php on line 260

    My code starts from 260 line:

                if ( array_key_exists( 'general_rule_match', $cost_rule_match ) ) {
                    $general_rule_match = $cost_rule_match['general_rule_match'];
                } else {
                    $general_rule_match = 'any';
                }
            
            } else {
                $general_rule_match = 'any';
            }

    How to fix it? Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Dotstore

    (@dots)

    Hello haxball100,

    Thanks for reaching out to us.

    This type of issue might be coming based on the rules type of you have selected.

    There are two type of rule relation ALL and ANY.

    Click here to review the settings.

    So, can you please update above settings again and let us know your warning get removed or not.

    OR you can change that code to as below:

    `if ( array_key_exists( ‘general_rule_match’, (array) $cost_rule_match ) ) {
    $general_rule_match = $cost_rule_match[‘general_rule_match’];
    } else {
    $general_rule_match = ‘any’;
    }`

    Please follow above changes and let us know how it works.

    Thanks,

    Thread Starter haxball100

    (@haxball100)

    Hello, thanks for reply!

    O tryed to change setting, set to ALL, and now is good, I don’t get any warning or error. Now just want to know, what does it rule ALL and ANY? Now I changed rule settings to ALL, so my system will work same? Thanks!

    Plugin Author Dotstore

    (@dots)

    Hello haxball100,

    Thanks for the update. We are glad to know its working for you. 🙂

    Click here to review the document for how those both option work.

    If you have created only one rules then it will works fine on both option.

    Thanks,

    Plugin Author Dotstore

    (@dots)

    Hello haxball100,

    We haven’t heard back from you in a while, so I’m going to mark this as resolved

    If you have any further questions, you can start a new thread.

    Thanks,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Warning: array_key_exists() expects parameter 2 to be array’ is closed to new replies.