CoCart v3 Release Notes

I’m pleased to announce CoCart v3 is now available. It’s my biggest release yet for CoCart and may be a while before I release any further updates as I get CoCart Pro ready for it’s next big update.

This release brings a new API providing more than before. Thanks to the amazing feedback from users, CoCart v3 brings a much better cart response designed for all with an all-new flow experience, new options and support for developers to utilize.

Adding grouped products is also now possible while adding variable products has become simpler. Error validation has also be improved so even the smallest of errors caused, a developer can get a clear explanation as to what went wrong.

Basic authentication is also now built in with additional support for use of email address for the username. So you don’t have to use the JSON Basic Authentication plugin no more which is also outdated.

Updating to the new API is simple and makes building your headless store easier than before. Most parameters are the same, other parameters have changed for the better including the default values.

Simply follow the upgrade guide and your good to go.

If your not new to CoCart I think your going to love this update. If you are new to CoCart, well I can already feel your smile of appreciation. ☺

What’s New with CoCart v3?

  • 🥇 NEW: API v2 with new routes to help with the flow.
  • 💯 NEW: Better cart response based on the experimental free add-on “Get Cart Enhanced“.
  • ⛓️ NEW: Carts can sync for guest customers between app and web once “Load Cart from Session” feature has been used.
  • 🔑 NEW: Basic Authentication now built in with the ability to authenticate via email instead of username. 🥳
  • 🔒 NEW: Each route can be forced to check if the user (meaning only a logged in user) has permission to use the API. This requires the use of a new filter. See article for more information.
  • 🔎 NEW: Browse and Search CoCart add-ons or supported extensions from the plugin install page.
    • Search suggestions are added at the bottom of the plugin search results on the first page only if matching key words match.
    • New plugin install section “CoCart” displays information on available add-ons or supported extensions with compatibility information and links to more details.
  • 🧾 NEW: Support for TaxJar for WooCommerce plugin if you have v3.2.5 or above.
  • 🚢 NEW: Support for WooCommerce Advanced Shipping Packages extension.
  • 🎁 NEW: Support for WooCommerce Free Gift Coupons extension.
  • 🗝️ NEW: Support for JWT Auth plugin by Useful Team.
  • 🌗 NEW: Compatible with WP-GraphQL WooCommerce add-on.
  • Tweaked: Session data now handled by new abstract to gain more control over it.
  • Tweaked: Cart key now returns in the cart response the first time round. 🥳
  • Tweaked: The loading of the session handler for better initialization by filtering it outside the action hook woocommerce_loaded.
  • Tweaked: Loading a cart from session is now prevented if a user is already logged in.
  • Tweaked: Loading a cart from session is now prevented if a user is not logged in and the cart key requested matches any registered user.
  • Tweaked: Cart session now stores when the cart was created, it’s source and hash.
  • Tweaked: WooCommerce System Status Tools are made available even if COCART_WHITE_LABEL is set to true.
  • Deprecated: Redirect to cart after using load cart from session.
  • Tested: ✔️ Compatible with WooCommerce v5.3
  • Dev: 🐸 NEW Update database manually for CoCart via WP-CLI.
  • Dev: 🐸 NEW Get the current version of CoCart via WP-CLI.
  • Dev: Forked get_customer_unique_id() from WooCommerce session handler for backwards compatibility. Introduced to help with unit tests in WooCommerce since version 5.3. Not needed for CoCart.

There is a whole lot of action filters and hooks now available which you can view in the full changelog.

View the full changelog here.

Minimum Requirements

PHP requirement has been bumped to v7.3 to ensure you are getting the best of CoCart. However, web hosts will soon be updating the default PHP version to v7.4 and deprecating support for PHP 7.3 and below. CoCart v3 is ready for that.

Documentation changes

New documentation for v3 is available so you can get stuck into using the new release asap. Wish to access documentation for the previous API version?

Database changes

This release does introduce changes to the CoCart session table to store when the cart was created, it’s source and cart hash.

If you have been keeping CoCart up to date until now then you will have no issues upgrading when your ready.

Just another warning encase you missed the first one.

If you have not updated CoCart to at least v2.9 then I must warn you. If you have large stores and you update CoCart directly to v3 ignoring previous patches, then the database upgrade will run automatically in the background without notice.

So please update to v2.9 before updating to v3 for a smoother upgrade process.

CoCart Lite v2.9.1 Release Notes

Excited to announce that CoCart Lite 2.9.1 is now publicly available! This is a minor release so everything is backwards compatible with the previous version.

As always, it is recommend to create a backup of your site before updating.

What’s new in CoCart v2.9.1?

This release fixes a problem with merging cart contents together. It’s a feature that WooCommerce provides in the core and one that was not working out of the box with CoCart.

What is this feature for? Well it’s simple. The feature is triggered when a customer logs in but started as a guest. They already added items to the cart but also have items added to the cart as a registered customer.

So for any items that are not already in the cart, they are merged together. Now you only have one cart of all the items you added. This will then destroy the guest cart as it is no longer needed.

Pretty cool. ?

In addition to this fix. A change has been made to further enhance the API for headless development. The cookie that stores the cart information now adds the samesite attribute to None. This article explains more about SameSite Cookie Attribute.

To help with those who wish to change the default attribute value, a new filter cocart_cookie_samesite has been introduced to allow you to override it. Before this attribute was added the default value was lax after 20th February 2020 if the attribute is not applied.

This cookie change is only available for those who use PHP 7.3 or above and will be the minimum requirement for CoCart v3 once it is released so I recommend that you update to PHP 7.3 or higher soon.

Why was this cookie attribute added so late? To be honest it just got forgotten about due to Covid-19, personal health and working on other improvements for CoCart. I only just recently got reminded about it. ?

If you have tips or feature requests to help CoCart improve for your development then please send me feedback or make a enhancement request via the GitHub repository where I can manage things better.

I like to thank Joel for this release who spent a little of his weekend helping me to get this done.

Database changes

This release does not introduce any changes to the database.

Documentation

This release does not introduce any changes to the documentation.

CoCart Lite v2.9.0 Release Notes

Excited to announce that CoCart Lite 2.9.0 is now publicly available! This is a minor release so everything is backwards compatible with the previous version.

As always, it is recommend to create a backup of your site before updating.

What’s new in CoCart v2.9?

This release is for preparation for CoCart v3 in order for the database upgrade to work as it should.

If you don’t update CoCart to this release first, then when it comes to upgrading to v3, the database will be upgraded automatically as it will not know the version of the CoCart database.

This is important for large stores as they will need time to backup the database before proceeding.

As a bonus, I fixed an issue that prevented CoCart from being installed correctly on a multi-site environment. So CoCart now supports multi-site environments. ?

Enjoy!

Database changes

This release does not introduce any changes to the database.

Documentation

This release does not introduce any changes to the documentation.

CoCart Lite v2.8.3 Release Notes

Excited to announce that CoCart Lite 2.8.3 is now publicly available! This is a minor release so everything is backwards compatible with the previous version.

As always, it is recommend to create a backup of your site before updating.

What’s new in CoCart v2.8.3?

This is the last minor update for CoCart v2 or at least for this year I think.

What’s new is that multi-site networks now properly engage with the site admin once the plugin is activated on the network.

A few tweaks have been made so we don’t add the version of the plugin per site. All admin notices now show via the network admin and if you are new to CoCart, you are redirected to the getting started page in the network admin upon first activation.

Before network sites would only see “Plugin activated” which makes the site admin feel left out.

A couple of fixes were also made.

Headers were already sent when filtering rest_pre_serve_request. This appeared to only cause issues when you have WP_DEBUG enabled when using CoCart locally.

And finally, a few errors were not returning the status error in the correct format.

That is it. I hope you are doing well and have a good x-mas. ?

Database changes

This release does not introduce any changes to the database.

Documentation

This release does not introduce any changes to the documentation.

CoCart Lite v2.8.2 Release Notes

Excited to announce that CoCart Lite 2.8.2 is now publicly available! This is a minor release so everything is backwards compatible with the previous version.

As always, it is recommend to create a backup of your site before updating.

What’s new in CoCart v2.8.2?

Two things have been done to improve the loading of a cart from session via the web. Load the chosen shipping method and cart fees.

In addition to this minor release, a request was made to be able to filter the parameter name cocart-load-cart, used for loading the cart from session via the web to provide more white labelling for their client.

You can find an example for this filter under “White Labelling”.

Database changes

This release does not introduce any changes to the database.

Documentation

All examples provided for setting a cart key have been corrected. Due to an over look on my part, I mistakenly documented the cart_key parameter as a standard data parameter and not a global parameter that requires to be queried.

Not many developers who had issues with this, saw the error and corrected this in their development but not reported the error to me.

Others had tried to report the error but did not make it clear to me as to what was wrong and moved on. Now after several releases and finally getting someone to report clearly what was wrong, I was able to correct it.

I apologise for the mistake and hope you try again with the new examples provided. I have also added a warning notice in the documentation to remind you that it is not to be passed as a data parameter.

CoCart Lite v2.8.1 Release Notes

Excited to announce that Pantheon, a high performance hosting platform is now supported in CoCart Lite 2.8.1 which is now publicly available! This is a tiny release so everything is backwards compatible with the previous version.

As always, it is recommend to create a backup of your site before updating.

What does it do?

Well because Pantheon is a platform built for speed, it’s cache system caused a problem for guest customers on the frontend making it look like the cart was empty no matter how many items were added to the cart.

Luckily, this was a quick easy fix after talking to their customer service.

All that was required was to change the cookie name using the available filter in CoCart to a new formatting that Pantheon reorganizes to prevent the session cookie from caching.

And after trying them out, I can say that I recommend using Pantheon for speedy performance to run your store no matter how large.

Database changes

This release does not introduce any changes to the database.

Documentation

This release does not introduce any changes to the documentation.