Title: PHP Warning
Last modified: July 3, 2020

---

# PHP Warning

 *  Resolved [hwsiew](https://wordpress.org/support/users/hwsiew/)
 * (@hwsiew)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/php-warning-243/)
 * Everything seems working fine but I got a warning as follow,
 * Warning: in_array() expects parameter 2 to be array, null given in /path/to/wp-
   content/plugins/dc-woocommerce-multi-vendor/templates/vendor-dashboard/vendor-
   shipping/vendor-shipping-zone-settings.php on line 35

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [DualCube](https://wordpress.org/support/users/dualcube/)
 * (@dualcube)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/php-warning-243/#post-13075478)
 * Hi [@hwsiew](https://wordpress.org/support/users/hwsiew/), sorry to hear that
   you have faced this issue.
 * It seems like this issue is coming in your site, so can you please contact us
   over forum so our team can look into this: [https://wc-marketplace.com/support-forum](https://wc-marketplace.com/support-forum)
 *  Thread Starter [hwsiew](https://wordpress.org/support/users/hwsiew/)
 * (@hwsiew)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/php-warning-243/#post-13098221)
 * After debugging, it appears that if your WC settings > shipping zones > shipping
   regions set to a country instead of a state, for example, ‘United States’ instead
   of ‘Alabama, US’, you will have the issue of stating that ‘$states’ is null.
 * In the code, it doesn’t handle the case when country is selected other than state
   and postcode.
 * [https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/blob/a40b7704c7f115be138a6ab6a636240ecddc83fc/classes/class-wcmp-ajax.php#L3230-L3248](https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/blob/a40b7704c7f115be138a6ab6a636240ecddc83fc/classes/class-wcmp-ajax.php#L3230-L3248)
 *  Thread Starter [hwsiew](https://wordpress.org/support/users/hwsiew/)
 * (@hwsiew)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/php-warning-243/#post-13098969)
 * For others information, moving the variables initialization outside the if solve
   the issue.
 *     ```
           $countries = $states = $cities = $postcodes = array();
           if ($want_to_limit_location) {
              ...
           }
       ```
   
 *  [DualCube](https://wordpress.org/support/users/dualcube/)
 * (@dualcube)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/php-warning-243/#post-13105240)
 * Hi [@hwsiew](https://wordpress.org/support/users/hwsiew/), thanks for reporting
   this.
 * We will fix this in our next update i.e. 3.5.4.
 *  Thread Starter [hwsiew](https://wordpress.org/support/users/hwsiew/)
 * (@hwsiew)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/php-warning-243/#post-13106071)
 * Great, thanks.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘PHP Warning’ is closed to new replies.

 * ![](https://ps.w.org/dc-woocommerce-multi-vendor/assets/icon-256x256.gif?rev=
   3314608)
 * [MultiVendorX - WooCommerce Multivendor Marketplace AI Powered Solutions](https://wordpress.org/plugins/dc-woocommerce-multi-vendor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/dc-woocommerce-multi-vendor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/)
 * [Active Topics](https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [hwsiew](https://wordpress.org/support/users/hwsiew/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/php-warning-243/#post-13106071)
 * Status: resolved