Releases: co-cart/co-cart
Nightly
v4.4.0-beta.4
What's new since beta.2
Beta 3 skipped. Internal only!
Changes
- REST API: Avatars only return if requested now when using the login endpoint.
- Feature: Rewrote "Load Cart from Session" to allow even registered customers access their carts without having to re-login.
When logging in with the login route, set the parameter 'avatars' to true for them to return.
Improvements
- REST API: Moved more functions and filters to utility class to help improve the complexity of the cart controller so we get better performance.
- REST API: Cart item prices correctly display based on tax options for the cart not the store.
- REST API: Optimized shipping data, added validation and support for recurring carts for subscriptions.
- REST API: Fallback to a wildcard if the origin has yet to be determined for CORS.
- REST API: Reset the item key when adding item again as it may have been manipulated by adding cart item data via code or plugin.
- Feature: Load cart from session now supports registered customers.
- Plugin: PHPStan used to help with correcting errors and inconsistencies.
Third Party Support
- Plugin: LiteSpeed Cache will now exclude CoCart from being cached.
Feature: Load Cart from Session
Originally only designed for guest customers to allow them to checkout via the native site, registered customers can now auto login and load their carts to do the same.
How does a registered customer load in without authenticating?
To help customers skip the process of having to login again, we use two data points to validate with that can only be accessed if the user was logged in via the REST API to begin with. This then allows the WordPress site setup as though they had gone through the login process and loads their shopping cart.
The two data points required are the cart key which for the customer logged in via the REST API will be their user ID and the cart hash which represents the last data change of the cart. By using the two together, the customer is able to transfer from the headless version of the store to the native store.
Simply provide these two parameters with the data point values on any page and that's it.
https://your.store/?cocart-load-cart={cart_key}&c_hash={cart_hash}
Developers
- Introduced new filter
cocart_load_cart_redirect_home
allows you to change where to redirect should loading the cart fail. - Introduced new filter
cocart_cross_sell_item_thumbnail_src
that allows you to change the thumbnail source for a cross sell item. - Added the request object as a parameter for filter
cocart_add_to_cart_quantity
. - Added the request object as a parameter for filter
cocart_allow_origin
. - Added the cart class as a parameter for filter
cocart_shipping_package_name
. - Added new parameter
$recurring_cart
for filtercocart_available_shipping_packages
.
Deprecations
- Function
cocart_prepare_money_response()
is replaced with functioncocart_format_money()
.
The following filters are no longer used:
cocart_load_cart_override
cocart_load_cart
cocart_merge_cart_content
cocart_cart_loaded_successful_message
cocart_use_cookie_monster
Compare against stable release v4.3.6: v4.3.6...v4.4.0-beta.4
v4.3.6
v4.3.5
v4.3.4
v4.4.0-beta.2
What's new since beta.1
Bug Fix
- REST API: View or deleting a session with the Sessions API was not accessing the session handler. No longer needs a separate load.
Changes
- REST API: The following endpoints for Cart API v2 now extend
CoCart_REST_Cart_V2_Controller
instead of an Cart API v1 controller:cart/add-item
,cart/add-items
,cart/calculate
Improvements
-
REST API: Only registers CoCart endpoints if requesting it. Helps performance in backend such as when using Gutenberg/Block editor as it loads many API's in the background.
-
REST API: Prevent having to check cart validity, stock and coupons on most cart endpoints other than when getting the cart to help with performance.
-
REST API: Optimized how many times we calculate the totals when adding items to the cart to help with performance.
-
REST API: Moved some cart validation further up before returning cart contents.
-
Localization: Similar messages are now consistent with each other.
Developers
- Added parameters for filter
cocart_add_to_cart_sold_individually_quantity
. - Added the product object to filters
cocart_cart_item_price
andcocart_cart_item_quantity
.
Deprecations
The following filters are no longer used:
cocart_filter_request_data
v4.4.0-beta.1
Changes
- REST API: Avatars only return if requested now when using the login endpoint.
Improvements
- REST API: Moved more functions to utility class to help improve the complexity of the cart controller so we get better performance.
- Feature: Load cart from session now supports registered customers.
Load Cart from Session
Originally only designed for guest customers to allow them to checkout via the native site, registered customers can now auto login and load their carts to do the same.
How does a registered customer load in without authenticating?
To help customers skip the process of having to login again, we use two data points to validate with that can only be accessed if the user was logged in via the REST API to begin with. This then allows the WordPress site setup as though they had gone through the login process and loads their shopping cart.
The two data points required are the cart key which for the customer logged in via the REST API will be their user ID. And the cart hash which represents the last data change of the cart. By using the two together, the customer is able to transfer from the headless version of the store to the native store.
Simply provide these two parameters with the data point values on any page and that's it.
https://your.store/?cocart-load-cart={cart_key}&c_hash={cart_hash}
Developers
- Introduced new filter
cocart_load_cart_redirect_home
allows you to change where to redirect should loading the cart fail.
Deprecations
The following filters are no longer used:
cocart_load_cart_override
cocart_load_cart
cocart_merge_cart_content
cocart_cart_loaded_successful_message
cocart_use_cookie_monster
v4.3.3
Corrections
- Autoload for classes in the backend corrected to new locations.
- Clean up task that is scheduled was looking for the session handler in the wrong place.
- Fixed
update_session_timestamp()
function from failing in session handler.
Improvements
- REST API: Price of product is now consistent in the Cart API (v2 ONLY). If your store was setup with no decimals the price would not return fully. Solves issue #429
- REST API: Value of weight was returning in the wrong format. By returning as a string you get the true value without needing to round it up yourself.
- WordPress Dashboard: Updated add-on update watcher.
v4.3.2 - 🌋 Hot Fix
🌋 Hot Fix
This release fixes 3 known issues that were reported. issue #425, issue #426, issue #427 that has been affected since version 4.2 of CoCart.
It was due to the optimizations made to allow CoCart to perform better. Unfortunately it had some unexpected side affects that were not picked up during testing. For that I am sorry. If you haven't rolled back to before 4.2 then this patch is highly recommended.
Previous patch releases will also be updated to prevent further sites from experiencing these issues for those who like to update to specific version of the plugin.
A hard lesson was learned here and hope you haven't lost trust in the plugin. I appreciate your feedback and support during this process.
Please don't forget to backup your site before updating.
Corrections
- Typo caused the WP-CLI commands to not register and crash when used with composer.
- The data exception class was oddly not loading when updating an item. Autoloader was not picking it up. Now it is required.
- Cart would empty but the subtotal would not reset.
Improvements
- Ensure we have calculated totals before we get an item or update an item so we can identify them.
v4.3.0
What's New?
In this release we have added a plugin update prevention system as a safety measure. For the moment it will detect for compatibility with minor releases while we are making adjustments but it's designed mostly for detecting major changes. All CoCart add-ons that we release will now check for CoCart's requirements and will help you decide to update or not until your ready to do so.
- Added plugin headers to be used for detecting CoCart add-ons or plugins that support CoCart.
- Auto-updates are disabled should a CoCart add-on active have not tested with the latest release available.
- Update now link for CoCart opens up a modal listing none tested plugins with a confirmation.
Improvements
- Ensure we have calculated totals before we restore the requested item so we can identify them.
For Developers
These filters are for site admins more than anything.
- Introduced filter
cocart_in_plugin_update_message
allows you to change the upgrade notice. - Introduced filter
cocart_get_plugins_with_header
allows you to get the plugins that have a valid value for a specific header. - Introduced filter
cocart_get_plugins_for_cocart
allows you to get plugins which "maybe" are for CoCart.
Compatibility
- Tested with WordPress v6.6
- Tested with WooCommerce v9.1