Coming in v2: Totals

Fetching the cart totals is one of the most important parts of the CoCart API and while you do get all the information you need, they were not always returned in the same format when it came to the actual totals and did not have the currency symbol applied.

I’m sure developers would have to convert the values and apply the currency symbol after fetching the totals which could also increase load time for their app with the additional code required.

For version 2, I wanted to make it faster and easier for developers by returning the results pre-formatted ready to simply display them.

All totals can now return as a string with the currency symbol automatically applied according to the store currency set in the WooCommerce settings.

To get these results, simply set the new property as true.

See documentation for example.

That’s it!

Feedback Required!

CoCart v2 is now available for beta testing.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.