Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkout block shows warning Warning: foreach() argument must be of type array|object, string given when a guest session is loaded after upgrading to 8.9 #47485

Closed
opr opened this issue May 14, 2024 · 3 comments · Fixed by #47514
Assignees
Labels
block: checkout Issues related to the checkout block. focus: checkout Issues related to checkout page. priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues type: bug The issue is a confirmed bug.

Comments

@opr
Copy link
Contributor

opr commented May 14, 2024

Issue

Warning shown when loading the Checkout block in WC 8.9 with a guest session created in 8.8.

Warning: foreach() argument must be of type array|object, string given in wp-content/plugins/woocommerce/includes/data-stores/class-wc-customer-data-store-session.php on line 152

It is potentially linked to https://github.com/woocommerce/woocommerce/pull/46762/files#diff-578ec004cc2b40bb0b5b7d4901dc51c209cc8a76456b588cbcbc12b693757466

Reproduction steps

  1. Be on WC 8.8.3 with no other plugins installed
  2. Open an incognito window and add an item to your cart. Go to the Checkout block and check out as a guest.
  3. Add an item to the cart and go to the Checkout block.
  4. In your main window, upgrade to WC 8.9
  5. In the incognito window, refresh the Checkout page.
  6. The warning will be shown
@opr opr added type: bug The issue is a confirmed bug. priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. focus: checkout Issues related to checkout page. team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues block: checkout Issues related to the checkout block. labels May 14, 2024
@johanmolen
Copy link
Contributor

Same issue here.

@ZaDeveloper
Copy link

Same Issues Here How to fix it?

@senadir
Copy link
Member

senadir commented May 15, 2024

Hey! A fix is here and should land with 8.9.1

#47514

This warning will only trigger for guest customers who already had a session in 8.8.x and 8.7.x. It only happens on the first load and then it's gone.

If you really want to get rid of it, you can go to WooCommerce -> Status -> Tools -> Clear Customer sessions, but that will clear existing carts as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
block: checkout Issues related to the checkout block. focus: checkout Issues related to checkout page. priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues type: bug The issue is a confirmed bug.
Projects
None yet
4 participants