CoCart v2.1.0 Release Candidate 4

This is a small update to correct a bug for when setting the cart key via the id parameter so it is not overridden by the cookie set. This ensures the correct cart is returned if you are specifying a cart should the current cookie not update.

In addition to this patch I have also added a new route to enable you to provide a logout option for your customers. ?

curl -X POST https://example.com/wp-json/cocart/v1/logout

The reason for this addition is because developers were not clearing the cookie which stores the customers ID or cart key which is then used to load the cart on future requests so you don’t have to re-authenticate the customer per API request.

However, for additional debugging purposes I have added a filter that will override the cookie check so you don’t have to clear the cookie to test each customers cart.

Simply apply this snippet to your functions.php file and your good to go.

add_filter( 'cocart_override_cookie_check', function() { return true; });

Oh and since setting the cart via the id parameter did not update the cart expiry. I made another tweak so now it does. ?

Simply download and install the release candidate below, follow the work in progress documentation and report back to me if you come across a bug or have any questions.

Just a little reminder that I’m aiming to have v2.1 released on 8th May, 2020 unless another release candidate is required before then so get testing. ?

I want to say thank you for those who have been testing and reporting back feedback so far. It means a lot and I’m not just saying that.

Here’s what Joel from jppdesigns.co.uk had to say.

What can I say this thing has it all. It is the “Missing WooCommerce REST API plugin” without it I was managing users cart myself in weird and wonderful but hacky ways. NOT GOOD and so vulnerable. Then I stumbled upon CoCart and with the help of Seb I got it working how I needed it and he has been supporting me with even the smallest of queries. Really appreciate your work and continued support Seb.

Joel Pierre-Powell