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 v3.0.0 Release Candidate 3

I’m excited to announce that CoCart v3 Release Candidate 3 is now available for testing! You can either download it directly from GitHub or install the CoCart Beta Tester plugin.

This release fixes a few minor bugs and tidies up the code a little more. This is the final release candidate before launching real soon.

What’s New since CoCart v3 RC 2?

  • NEW: Added PUT to Access-Control-Allow-Methods
  • Fixed: Undefined cart_key.
  • Fixed: Undefined object property ID.
  • Fixed: Check $user_id is not empty.
  • Fixed: Passed the product ID & quantity values for add to cart message that is finally added to cart to return the message correctly, specifically for variable products.
  • Improved: Various inline docs here and there.
  • Removed: Various lines of code not used any more to clean it up.

Testing

If you discover any bugs during the testing process, please let me know by logging a report on the GitHub repository. There I can manage it better and get on the issue asap.

CoCart v3.0.0 Release Candidate 2

I’m excited to announce that CoCart v3 Release Candidate 2 is now available for testing! You can either download it directly from GitHub or install the CoCart Beta Tester plugin.

I’m hoping now this release candidate is the last one but again, any remaining feedback you provide testing this release candidate is most appreciated.

What’s New since CoCart v3 RC 1?

  • NEW: Compatible with WP-GraphQL WooCommerce.

As both CoCart and WP-GraphQL WooCommerce extension use their own session handler, there was a clash.

With this release a condition has been added to check if a graphql request was being made in an area that CoCart also shares.

Now both plugins can work side by side. 👍

  • NEW: Added notice for when item is removed from cart.
  • Fixed: Authentication with login API. Incorrect permission check used. 🤦‍♂️
  • Localization: Added missing translator notes.

Testing

If you discover any bugs during the testing process, please let me know by logging a report on the GitHub repository. There I can manage it better and get on the issue asap.

CoCart v3.0.0 Release Candidate 1

Didn’t you just release a beta?

Yes I did. The release post got delayed as I found a few other bugs while writing the documentation. Read the previous post so you have the full log on the new additions and corrections.

I’m excited to announce that CoCart v3 Release Candidate 1 is now available for testing! You can either download it directly from GitHub or install the CoCart Beta Tester plugin.

CoCart v3 is so close to launching now. Any remaining feedback you provide testing this release candidate is most appreciated.

What’s New since CoCart v3 Beta 4?

  • New: Added success notice for when a simple or variable product was added to cart.
  • Fixed: Authenticating on any API while requesting cart key.
  • Fixed: Product validation for adding grouped products.
  • Fixed: Response when requesting to return items after adding a grouped product.
  • Improved: Response returned when removing an item already removed from cart.
  • Improved: Response returned when restoring an item already restored to the cart.
  • Tweaked: All links pointing to CoCart.xyz
  • Updated: Getting started page.

Documentation

The documentation for v3 is now ready for API v2. You will find a section called breaking changes that will explain differences between the two API versions.

You can use the upgrade guide to help with the routes.

Node.js is now the default language tab and the menu navigation has been improved.

While there is still a lot to document, (mostly filters, I added way to many for v3) you can see all the options that are available for the new API version.

If you need help with any of it or you spot an error in the documentation, let me know via the live chat.

Testing

If you discover any bugs during the testing process, please let me know by logging a report on the GitHub repository. There I can manage it better and get on the issue asap.

CoCart v3.0.0 Beta 4

I’m excited to announce that CoCart v3 Beta 4 is now available for beta testing! You can either download it directly from GitHub or install the CoCart Beta Tester plugin.

CoCart v3 is just around the corner so any remaining feedback you provide testing this beta that needs solving before releasing a release candidate is most appreciated.

What’s New since CoCart v3 Beta 3?

  • NEW: Added login route to help with customer flow.
  • NEW: Introduced saving the cart hash in session.
  • NEW: Support for JWT Auth plugin.

Changes since beta 3

  • Improved: Copy for readme.txt
  • Improved: Check cart is completely empty not just the cart contents.
  • Improved: Product title now returns in status when item is removed from cart.
  • Corrected: Redirect to current page when hiding admin notice.
  • Added: Schema for count items API.
  • Added: Option to keep removed items in session when clearing the cart.
  • Deprecated: cocart_return_empty_cart filter.
  • Fixed: Install date value when product review notice loads for the user.
  • Fixed: Validation of variable product.
  • Fixed: Product validation failing before adding to cart to return error response.
  • Fixed: Formatting variation data for custom option.
  • Fixed: Issue with a non-numeric value encountered.
  • Fixed: Session failing returned response if cart is empty.
  • Fixed: Cart source when cart was first created no longer updates.
  • Merged: Changes added in CoCart v2.9.2
  • Moved: Deleting cart API under session API for admins only.
  • Tweaked: Cart response now returns empty only if no cart exists or the cart is completely cleared. This allows for only removed items left in session to be returned to the cart without issues.
  • 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 but best to have it and not need it than not have it and need it.

Testing

If you discover any bugs during the testing process, please let me know by logging a report on the GitHub repository.