CoCart Get Cart Enhanced v2.0 Release Notes

This is the first release note post for CoCart Get Cart Enhanced. It introduces a couple of things. First checking the cart contents and applied coupons.

Validity of the items and stock is checked before returning the cart. The same for the coupons. This gives a more realistic cart in real time before the order is made and allows you to inform the customer should any item or coupon no longer be available or valid.

Second, is to give developers a preview of the new default cart response coming in CoCart v3.0 API v2.

What’s different and how do I preview?

Over time this add-on has been updated to improve the response based on the feedback by it’s users. One thing in particular that developers wanted was not to have the product prices and totals pre-formatted.

This suggestion allows more control, which means adding more information like the currency used for the store.

Default cart response with a single item added to the cart.

To preview the new cart response for CoCart v3.0 API v2, you need to use the filter cocart_preview_api_v2. You can copy the and paste the code below.

add_filter( 'cocart_preview_api_v2', function() { return true; });


This release also makes it compatible with v2.8 of CoCart Lite and small minor fix for those who are already using PHP 8. It’s also been tested with WooCommerce 4.8


Previewing the new cart response is still a working progress and is by no means complete. Use only for experimenting and to provide feedback.

Hope you enjoy and have a good X-mas. ?