0

Nextjs Frontend, WooCommerce headless backend.

Trying to have a persistent cart with a signed in user, and just having a lot of difficulty in that. I've tried to create a custom plugin that adds a user's cart as metadata, but WooCommerce seems to have a lot of resistance to someone editing their own metadata (have set a customer as admin but still having issues, postman requests to metadata is just not changing it).

Everything I've found is that WooCommerce's cart is not persistent, but session based. Even the cocart API I've read about is using a session based cart.

Now, maybe that session based cart could be saved, but it still comes back to having to edit the user's metadata?

Anyway, I am having a great deal of difficulty on this and cannot find solutions. I see lots of people discuss trouble with this going back decades with no solutions...

1 Answer 1

0

Normally GET is used to list data. I had a similar problem with real-time data working with REACT and PHP. The solution was to change the GET to POST and it worked. I hope this little tip helps you.

Sign up to request clarification or add additional context in comments.

1 Comment

I'm not sure I follow - I can make a GET request to get stuff like userdata, it just doesn't show the metadata changed at all?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.