co-cart / co-cart

đź›’ CoCart is a free REST API designed to decouple your slow WooCommerce storefront and convert it blazing-fast, build in any web framework, and save you countless hours.

Home Page:https://cocartapi.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cart not updating when removing the product and having cocart-load-cart param in URL

luco opened this issue · comments

I'm using the version 3.2.0 from the trunk. When the cocart-load-cart key is set on URL and I try to remove a product from the cart, it doesn't remove. The ajax refreshes and keeps the product.

When I remove the param from the URL and remove, it works.

Hi @luco

I have not been able to replicate the issue. Items remove fine and I can restore without removing the cocart-load-cart parameter.

I was logged out so the cart was loaded as a guest as it's designed. I'm assuming your logged in.

Yes. What it's the best way to handle a user that's logged and not logged?

Well, the feature wasn't designed for registered customers. The idea is that if you are bringing back a returning customer to the native checkout they would need to log in to continue.

Open to suggestions on how to do this safely without conflict.

What about clearing the cart for logged users?

Well that wouldn't work because your removing items the customer may want that was saved before.

Yeah, but a flag would be great, like clear-cart=true to explicity clear it. Or maybe merge the cart.

I will see what I can do.

Thanks a lot @seb86!

@luco Have you tried setting keep-cart to false?

Example: https://example.com/cart/?cocart-load-cart=bbfa8e97ac9cff4c861d62a109e83bb6&keep-cart=0

@seb86 In fact it works, but the problem comes again to the logged user that, once goes to cart, can't remove the product as I described in the issue. This only happens if the used is logged in.

@luco I'm afraid that it's only an issue with the vendors plugin and I don't currently have the resources to solve it. Perhaps you can get further assistance from the vendor plugin developers.

Closing this issue.