I recently came across this intriguing error. I searched online and did not find anything that helped much, so I decided to write this post with a solution.
Here is the full error: PHP Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in /yourwpfolder/wp-content/plugins/woocommerce/includes/wc-cart-functions.php:476. The line may vary depending on your WooCommerce version.
Let's go to the solution. Initially, the quickest fix is to create a new shipping zone for locations not covered by your other shipping zones. In my case, I did it as shown below, and it solved the issue:

The menu is located at WooCommerce > Settings > Shipping.
Another solution mentioned online is disabling all plugins except WooCommerce and repeating the checkout process. Some plugins can affect shipping methods and cause this error.
Comments
Join the conversation
Loading comments...