Skip to content

v4.0.0

Compare
Choose a tag to compare
@seb86 seb86 released this 13 May 21:21
· 11 commits to trunk since this release

In this release, we are happy to provide some of the various improvements made through out the plugin that were from the originally planned v4 release. These improvements are backwards compatible but one change is not. See the developer note for details.

Developer note: This release requires the quantity parameter to pass the value as a string for both adding items or updating items. If you are not new to CoCart then please update your code to account for this change.

Find out more about what’s new in CoCart 4.0 in our release post!

Hope you enjoy this release.

What's New?

  • REST API: Added batch support for cart endpoints listed below. (API v2 supported ONLY) See article for batch usage.
    • Add item/s to cart.
    • Clear cart.
    • Remove item.
    • Restore item.
    • Update item.
    • Update cart.

Bug Fixes

  • Plugin: Fixed various text localization issues.
  • REST API: Access-Control-Allow-Credentials being outputted as 1 instead of true. Solves issue 410. Thanks to @SebastianLamprecht for reporting it.
  • REST API: Update cart requests no longer fails and continues to the next item if an item in cart no longer exists.
  • REST API: Products API schema has been completed for v1.
  • REST API: Products API schema has been corrected for v2.
  • WordPress Dashboard: Plugin suggestions now lists CoCart JWT Authentication add-on.

Improvements

  • REST API: Now checks if the request is a preflight request.
  • REST API: Error responses are now softer to prevent fatal networking when a request fails.
  • REST API: Callback for cart update now passes the cart controller class so we don't have to call it a new.
  • REST API: Cart schema tweaks for API v2.
  • REST API: Cart and Product schema are now cached for performance for API v2.
  • Plugin: Added more inline documentation for action hooks and filters.
  • Plugin: Improved database queries.
  • Plugin: Updated to latest WordPress Code Standards.
  • WordPress Dashboard: Added CoCart add-on auto updates watcher.
  • WP-CLI: Updating CoCart via command will now remove update database notice.

Developers

  • REST API: Two new headers return for cart responses only. CoCart-API-Cart-Expiring and CoCart-API-Cart-Expiration.

These two new headers can help developers use the timestamps of the cart in session for when it is going to expire and how long until it does expire completely.

  • REST API: Error tracking is returned with the error responses when WP_DEBUG is set to true to help with any debugging.
  • REST API: Class aliases have been added to API v2 controllers after changing the class names for consistency.

Compatibility

  • Tested with WooCommerce v8.8