CoCart v2.2.0 is now available!

June has been a busy month both in the world and development for CoCart.

Finally got guest customers supported and 5 small releases that provided fixes along the way that ensured 100% compatibility with WooCommerce’s latest release and conflicts found on the frontend.

I now have one WooCommerce extension officially supporting CoCart and another on the way.

Feedback again has been tremendous and your constant support towards me so that I am able to provide you what I need has been a great help. πŸ˜ƒ

It’s especially nice to see customers donating more for the constant updates I have been giving. If you like to give, you can support me by buying me a coffee or simply purchase CoCart Pro while it is on sale until the end of June.

Today I have released v2.2.0 which is a minor release (which means everything is backward compatible with the previous version) that adds support for CORS headers should you need them set and a few tweaks to the plugin just to make it a little bit better.

As always, I recommend creating a backup of your site before updating.

Enjoy!

Changelog

  • NEW: Support for allowing all cross origin header requests to pass. Requires cocart_disable_all_cors filter set to false to enable.
  • NEW: Returned response after adding an item now returns product name, title and price just like the cart.
  • Tweaked: Improved validation for a variable product to return the product name correctly if variation attributes are missing.
  • Tweaked: Made sure that we check if we are making a request for CoCart API only.
  • Tweaked: CoCart logger will only log if WP_DEBUG is also set true.
  • Dev: New filters added for returning additional item data once added to cart.

CoCart v2.1.2 Release Candidate 5

Final release candidate for v2.1.2 introducing support to prevent caching CoCart if you have WP REST API Cache plugin installed.

Testing has been going well so I am confident to release on the 4th June, 2020

Changelog

* NEW: Prevent CoCart from being cached with [WP REST API Cache plugin](https://wordpress.org/plugins/wp-rest-api-cache/).
* Tweaked: Check if product exists first before validating further.
* Tweaked: `cocart_update_cart_validation` filter passes `$current_data` fully.
* Tweaked: If validation for adding or updating item returned an error return error response.
* Dev: Added schema for cart route.
* Dev: Added schema for adding item route.
* Dev: Passed `$product_type` for `cocart_add_cart_item_data` filter.

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

Look forward to your feedback.

Thank you.

πŸ™‚

CoCart v2.1.2 Release Candidate 4

Changelog

Another minor release candidate that adds more validation. This time for when an item is updated.

Fixed: Cart removes items correctly if the product is no longer purchasable when cart contents is fetched.
Tweaked: Update item now validates if the product is sold individually to prevent item from updating if true.
Dev: Added filter cocart_update_cart_validation to allow plugin developers to pass their own validation before item is updated in the cart.

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

Look forward to your feedback.

πŸ˜ƒ

CoCart v2.1.2 Release Candidate 3

After not having a smooth release for v2.1, for the last 2 weeks I have been working on fixing the issue. I’m pleased to say the issue is now fixed but before I can 100% confirm that I need your help to test it further in case anything else was missed.

Version 2.1 was removed from WordPress.org so users cant rollback to it and I have reverted the stable version to v2.0.13 until this release is ready.

Here is the comparison log from v2.0.13

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

Thanks to all of the testers and contributors!

What’s New?

Synchronised Carts

One of the issues users reported with v2.1 was that the carts were no longer in sync. This is because CoCart runs it’s own session handler to support guest customers but for a registered customer their carts were not matching.

This was because on the web version of your store, it was still utilizing WooCommerce core session handler and reading data from their session table.

This has been corrected so now both your web and headless store use the same session handler. βœ…

CoCarts session handler is 100% compatible with any WooCommerce extension or custom code you may have applied to your store as the handler was forked and tweaked to add support for guest customers. It’s practically the same… only better. πŸ˜€

Validating Products More

Variable products can be a hard time to manage and based on feedback, forgetting to pass or unable to pass the variation ID was one parameter users were failing to set correctly. Now you don’t have to as CoCart will get the variation ID based on the attributes you provide. πŸ‘

Even the attributes get validation so encase you forgot to pass required attributes you will now be told which attributes you forgot. If a variable product is not valid it will not add to the cart.

Speaking of not adding products. Password protected products can not be added either now.

Full Changelog from v2.1 to v2.1.2

* NEW: Added support for guest customers.
* NEW: Carts in session are stored in a new database table.
* NEW: Carts are in sync across the web store and your headless store.
* NEW: Added plugin details to **WooCommerce System Status**.
* NEW: Added `uninstall.php` file to delete table and options.
* NEW: Able to transfer a cart from your headless store to the web.
* NEW: Added handlers to improve product validation and extended support for other product types.
* NEW: Can now add items to cart using a products SKU ID.
* NEW: When an item is updated, removed or restored... the cart totals are re-calculated.
* NEW: Added option to logout customer.
* NEW: Variable products are now validated and can find variation ID from attributes if not already set.
* NEW: Prevent password protected products from being added to the cart.
* Changed: Parameter used to set cart key. Previously `id` now `cart_key`. The `id` used as fallback if still used.
* Removed: Parameter to re-calculate totals once item was updated.
* Tweaked: Clear carts debug tool now clears saved carts as well.
* Tweaked: Products that are no longer purchasable and are already in the cart are removed from the cart.
* Tweaked: Stop redirect to getting started page if plugin was activated and was already installed before.
* Tweaked: Prevent redirect to getting started page if multiple plugins activated at once.
* Dev: Clear all carts stored in session via the Tools section of **WooCommerce System Status**.
* Dev: Synchronize carts over to CoCart's session table in the database via the Tools section of **WooCommerce System Status**.
* Dev: Cart expiration can be filtered if the default 30 days is not to your liking.
* Dev: Generated customer ID can be filtered before storing cart in the database and creates a cookie on the customer's device.
* Dev: Added filter `cocart_add_to_cart_validation` to allow plugin developers to pass their own validation before item is added to the cart.
* Dev: Added filters to override the product name `cocart_product_name` and product title `cocart_product_title` when getting the cart contents.
* Dev: Added filter `cocart_item_thumbnail_src` to override the source URL of the product thumbnail when getting the cart contents.
* Dev: Added filter `cocart_add_to_cart_quantity` to override the quantity when adding an item.
* Dev: Added filter `cocart_add_cart_item_data` so other plugins can pass cart item data when adding an item.
* Dev: Added filters so the returned response messages can be changed.
* Dev: Added conditional filter for returning a cart item.
* Dev: Added hook `cocart_user_switched` to allow something to happen if a user has switched.
* Dev: Added hook `cocart_load_cart` to manipulate the merged cart before it set in session.
* Dev: Added hook `cocart_load_cart_override` to manipulate the overriding cart before it set in session.
* Dev: Added hook `cocart_item_added_updated_in_cart` for when an item was added again but updated in cart.
* Dev: Added a new class that handles logging errors.
* Dev: Added filters to admin notices to extend the length of time they hide.
* Dev: Added filter to override cookie check for authenticated users.
* Tested: Compatible with WooCommerce v4.2.x

> This update replaces WooCommerce core session handler with CoCart's. 100% compatible.

CoCart v2.1 is now available!

Updated: 23rd May, 2020

CoCart v2.1 was removed from WordPress.org due to an unforeseen issue that affected some variations to the API to not work.

I’m very excited to announce that CoCart 2.1 is now available. It has been in development since July 2019 and has about 254 commits since the last update a month ago.

This is a minor release, which means everything is backward compatible with the previous version.

What’s new in 2.1?

In short… magic! πŸ§™ Checkout this post for all the details.

I have also improved the content and structure of the documentation making it easier to find what you need.

This scene from Beauty and the Beast movie is one of my favourites and in a strange small way sings this release.

Enjoy! πŸ˜ƒ

Changelog

  • NEW: Added support for guest customers.
  • NEW: Carts in session are stored in a new database table.
  • NEW: Added plugin details to WooCommerce System Status.
  • NEW: Added uninstall.php file to delete table and options.
  • NEW: Able to transfer a cart from your headless store to the web.
  • NEW: Added handlers to improve product validation and extended support for other product types.
  • NEW: Can now add items to cart using a products SKU ID.
  • NEW: When an item is updated, removed or restored… the cart totals are re-calculated.
  • NEW: Added option to logout customer.
  • Removed: Parameter to re-calculate totals once item was updated.
  • Tweaked: Products that are no longer purchasable and are already in the cart are removed from the cart.
  • Tweaked: Stop redirect to getting started page if plugin was activated and was already installed before.
  • Tweaked: Prevent redirect to getting started page if multiple plugins activated at once.
  • Dev: Clear all carts stored in session via the Tools section of WooCommerce System Status.
  • Dev: Cart expiration can be filtered if the default 30 days is not to your liking.
  • Dev: Generated customer ID can be filtered before storing cart in the database and creates a cookie on the customer’s device.
  • Dev: Added filter cocart_add_to_cart_validation to allow plugin developers to pass their own validation before item is added to the cart.
  • Dev: Added filters to override the product name cocart_product_name and product title cocart_product_title when getting the cart contents.
  • Dev: Added filter cocart_item_thumbnail_src to override the source URL of the product thumbnail when getting the cart contents.
  • Dev: Added filter cocart_add_to_cart_quantity to override the quantity when adding an item.
  • Dev: Added filter cocart_add_cart_item_data so other plugins can pass cart item data when adding an item.
  • Dev: Added filters so the returned response messages can be changed.
  • Dev: Added conditional filter for returning a cart item.
  • Dev: Added hook cocart_user_switched to allow something to happen if a user has switched.
  • Dev: Added hook cocart_load_cart to manipulate the merged cart before it set in session.
  • Dev: Added hook cocart_load_cart_override to manipulate the overriding cart before it set in session.
  • Dev: Added hook cocart_item_added_updated_in_cart for when an item was added again but updated in cart.
  • Dev: Added a new class that handles logging errors.
  • Dev: Added filters to admin notices to extend the length of time they hide.
  • Dev: Added filter to override cookie check for authenticated users.
  • Tested: Compatible with WooCommerce v4.1.x