Issue with Guest to Logged-in Cart Merge – Cart Appearing only one product
-
Hi CoCart Support,
I am currently testing the checkout API flow using the CoCart plugin for both guest and logged-in users. However, I have encountered an issue where the second product does not appear on the checkout page after login.
Here’s the flow I am following:
1. Adding a product to the cart as a guest using:
POST /wp-json/cocart/v2/cart/add-item
2. Proceeding to checkout using:
/checkout/?cocart-load-cart=c09085a57b9663df7e680040fea2cd
For guest users, this works fine. However, when a user logs in, the cart key is set to the user ID, and any new product added does not appear in the cart. It seems that merging the guest cart with the logged-in user’s cart is preventing new items from being added.
I am trying to identify the root cause and resolve the issue. Could you please advise on how to properly merge the carts while ensuring that all products, including newly added ones, appear correctly after login?
Looking forward to your guidance.
- You must be logged in to reply to this topic.