CoCart v3.0.0 Beta 3

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

CoCart v3 is very close to completion so any feedback you provide testing this beta that needs solving before releasing a release candidate is most appreciated.

I’m aiming to have CoCart v3 released sometime around mid to late April. Up until then I will be working on preparing CoCart Pro to be ready for the big update.

What’s New since CoCart v3 Beta 2?

CoCart can be found under the “Extensions” section.

New: Added the CoCart menu to the new WooCommerce Navigation Menu if it exists or is enabled.

WooCommerce will make this enabled by default in the future and as CoCart is WooCommerce related, it is best that users have everything related to WooCommerce under one roof.

🧹 NEW for API: Cart formatting applied to clean up get cart response. This is similar to what the Get Cart Enhanced add-on does by removing the item key as the parent array making it easier to look up the items in the response.

βœ… NEW for API: Added cart validation, check each item is in stock and applied coupons are still valid. If anything is not valid an error notice will be added which returns in the response.

Should for some reason the CoCart session table not exist in the database. To help prevent crashing the site when viewing the WooCommerce System Status page, it will check if the table exists before trying to return results.

If it is indeed missing it will simply return “Missing session table“. Should this be the case a tool is available to verify and create the missing table.

WooCommerce System Status will check if the CoCart session table exists before returning results.

Changes since beta 2

  • Improved: Plugin activation, environment check and install CoCart in one go for faster performance.
  • Tweaked: Redirect user to plugins page after dismissing a notice.
  • Tweaked: WooCommerce System Status will check if the CoCart session table exists before returning results.
  • Tweaked: Getting Started page to link new plugin section for add-ons.
  • Tweaked: Admin notices style.
  • Tweaked: Autoloader for WooCommerce Admin notes.
  • Tweaked: Added short descriptions to WP-CLI commands should the user do wp cocart help.
  • Fixed: Check if DISABLE_WP_CRON constant is defined.
  • Fixed: Routes returned for store API.
  • Fixed: Callback to WP-CLI commands.
  • Dev: Made sure SCSS assets do not export when downloading GitHub source zip of any release.
  • Dev: Merged updates from v2.9 and v2.9.1

For Developers

  • Dev: Introduced cocart_before_get_cart filter for modifying the cart data in any capacity before the cart response is returned.
  • Dev: Introduced cocart_cart filter for modifying the cart response in any capacity.

Minimum Requirements

PHP requirement has been bumped to v7.3 to ensure you are getting the best of CoCart.

Testing

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

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 v3.0.0 Beta 2

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

It’s a big update but one that is backwards compatible. You can still use API v1 while still enjoy some of the new features and improvements to CoCart.

In this release a new API providing more than before thanks to the feedback users have given. CoCart v3 brings a much better cart response with new options for developers to utilize.

Updating to the new API is easy. Some parameter defaults have changed while other parameters have changed for the better. Simply follow the upgrade guide and your good to go.

What’s New in CoCart v3?

In addition to a new API, new routes are also added to provide store information and administrator API for viewing carts in session and more.

  • Get Store Details [GET] – wp-json/cocart/v2/store
  • Add Grouped Products [GET] – wp-json/cocart/v2/cart/add-items
  • Delete Cart [DELETE] – wp-json/cocart/v2/cart/{cart_key}
  • Cart in Session [GET] – wp-json/cocart/v2/session/{session_id}
  • Cart Items in Session [GET] – wp-json/cocart/v2/session/{session_id}/items
  • Sessions [GET] – wp-json/cocart/v2/sessions

πŸ’― NEW: Better cart response based on the experimental free add-on “Get Cart Enhanced“, improved REST API naming convention and a much better flow as most routes now return the cart by default.

πŸ”‘ NEW: Basic Authentication now built in with the ability to authenticate via email address instead of username. πŸ₯³ No longer do you have to use the basic authentication handler by WP-API which is also outdated. See article for more information.

πŸ”’ 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 introduced. See article for more information.

πŸ“¦ NEW: Grouped products can now be added to the cart. See article for more information.

πŸ”Ž NEW: Browse and Search CoCart add-ons or supported extensions from the plugin install page. See how to use plugin suggestions.

πŸ“ˆ NEW: Support for TaxJar for WooCommerce plugin if you have v3.2.5 or above installed.

🚒 NEW: Support for WooCommerce Advanced Shipping Packages extension.

🎁 NEW: Support for WooCommerce Free Gift Coupons extension.

Notable fixes and improvements

  • 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: WooCommerce System Status Tools are made available even if COCART_WHITE_LABEL is set to true.

Admin notices have also been re-written for better management and improve on dismissing them.

API error validation has also be improved so even the smallest of errors caused by human error can get a clear explanation as to what went wrong.

Performance has also improved and while CoCart supports the minimum of PHP v7.0, I would recommend bumping to PHP v8.0 or above to give it a real boost in speed.

Minimum Requirements

As always security is important so support will available if you have WordPress v5.4 or above.

Filters and actions

This release introduces so many filters and action hooks that I need a new post just for them. 33 in total I think. I lost count. There maybe a few more I have not yet documented. πŸ˜†

Extras

On top of the large number of newly introduced filters and action hooks. There are also newly introduced shared functions that can be used to develop your own extension for CoCart or add support for CoCart in a previously developed WooCommerce extension. More on that later.

Database Changes

The session table has two additions. Upon installing CoCart v3 you will be asked to upgrade the database. Please backup your site before proceeding. See article for more information.

Testing

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

CoCart Pro v1.0.0-rc.5 Release Notes

A minor release for CoCart Pro just to patch a few things until the next big update for CoCart Pro is released.

Those who are on there free trial will not get this update. If you like CoCart Pro activate your subscription and the update will be added to your account.

Changelog

  • Fixed: Forced the formatting of the returned applied coupons to return as an array always even if a coupon was deleted at some point.
  • Dev: Disabled experimental WordPress auto update features.
  • Dev: Disabled plugin review and beta notice temporarily until new admin notice system in CoCart v3.0 is supported.
  • Dev: Removed the use of cocart_getting_started_doc_url filter no longer used in the core of CoCart.
  • Dev: Updated dependencies used for developing CoCart Pro.
  • Compatible with WordPress 5.7
  • Compatible with WooCommerce 5.1

    New Minimum Requirements
  • WordPress 5.4
  • WooCommerce 4.3