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...
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...
Share edited Mar 8 at 17:17 LoicTheAztec 255k24 gold badges399 silver badges446 bronze badges asked Mar 7 at 18:20 EvanProgramsEvanPrograms 195 bronze badges1 Answer
Reset to default 0Normally 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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744913643a4600701.html
评论列表(0条)