开发者 |
sebd86
cocartforwc ajayghaghretiya skunkbad sefid-par mattdabell joshuaiz dmchale JPPdesigns inspiredagency darkchris mohib007 rozaliastoilova ashtarcommunications albertoabruzzo jnz31 douglasjohnson antondrob2 szepeviktor |
---|---|
更新时间 | 2025年6月27日 02:22 |
PHP版本: | 7.4 及以上 |
WordPress版本: | 6.8 |
版权: | GPLv3 |
版权网址: | 版权信息 |
An excellent plugin, which makes building a headless WooCommerce experience a breeze. Easy to use, nearly zero setup time. - Harald Schneider💼 Upgrade to CoCart Plus For more performance, and enterprise-level control — upgrade to CoCart Plus. Unlock features like:
This plugin saved me tons of work and it is working amazingly! The plugin author provides fast and high-quality support. Well done! @codenroll💜 Need Support? We aim to provide regular support for the CoCart plugin via our Discord community server. Please understand that we do prioritize support for our paying customers. 🧰 Developer Tools
Thanks for doing such great work with this! Works exactly as expected and CoCart seems to have a nice community around it. The founder seems really devoted and that’s one of the key things for a plugin like this to live on and get the right updates in the future. We just got ourselves the lifetime subscription. - Mighty Group Agency ★★★★★ This plugin works great out of the box for adding products to the cart via API. The code is solid and functionality is as expected, thanks Sebastien! - Scott Bolinger, Creator of Holler Box See the wall of love for more testimonials.👍 Add-ons to further enhance CoCart We also have add-ons that extend CoCart to enhance your development and your customers shopping experience.
CoCart provides a REST API that is ready to decouple WooCommerce away from WordPress.
Pretty much everyone who wants a faster eCommerce store to improve their business. WooCommerce runs multiple requests for multiple steps. We avoid the hassle of needing multiple requests for these steps and process them all together. CoCart is perfect for eCommerce owners and developers who want to create an eCommerce app for mobile or a custom frontend shopping experience completely using the REST API.
CoCart is designed with developers in mind allowing for complete control to customize or add support for a plugin to work with CoCart. CoCart does its best to work out of the box but if there is a compatibility issue with a plugin that you would like to work with CoCart. We would be happy to hear about it.
CoCart sources the WooCommerce’s Data Stores API and repeats most WooCommerce hooks to provide a wider array of support for most WooCommerce extensions out of the box.
Yes. Just install CoCart and activate it on the sites you want to use CoCart.
Absolutely. That is what CoCart is mainly developed for. You just need to enable CORS. You can do that easily with the CORS add-on or you can manually enable it via the filters available in the documentation.
The majority of plugins are not REST API specific so it shouldn't. However, while we allow the source of truth for compatibility, there may be a WooCommerce extension that returns data via an action hook that the REST API cannot understand during a specific action and may fail the response. If that does happen, simply report the situation with as much detail as possible on our GitHub repository and we will try our best to find a solution.
You will first need WooCommerce installed and set up to your configurations. Then install CoCart, activate and you're ready to start using the REST API following the API Reference provided.
Please check the requirements listed in the installation section.
WooCommerce’s Store API is designed for the Gutenberg blocks which only requires a fixed format and is used on native storefronts. A lot of valuable information and abilities that developers require to help them are also unavailable. CoCart's API is designed for decoupling away from WordPress with ease while the Store API is not. CoCart is a plug-and-play solution that just works out of the box. Also, improvements are always made to CoCart to ensure you get the best decoupled experience.
As this plugin provides a REST API built for developers, you will need to have some coding knowledge to use it.
You can find the documentation here.
You certainly can. There are over 200+ filters available to customize to your needs.
If you're familiar with WooCommerce, you may be wondering why using a custom session handler at all instead of the WooCommerce default session handler? A number of reasons but the ones that really matter are.
shutdown
hook.No. "WooCommerce Shipping and Tax" ignores any custom REST APIs from allowing the ability to calculate the taxes from TaxJar except for WooCommerce Blocks and JetPack. We don't recommend it. However, TaxJar for WooCommerce plugin is supported.
If you have "TaxJar for WooCommerce" v3.2.5 or above and CoCart v3.0 or above installed... then yes, it is supported.
Report bugs on the CoCart GitHub repository. You can also notify us via the Discord community server in the #bug-report channel – be sure to search the forum to confirm that the error has not already been reported.
Yes, you can! Join in on our GitHub repository and follow the development blog to stay up-to-date with everything happening in the project.
Yes! CoCart is deployed with full translation and localization support via the ‘cart-rest-api-for-woocommerce’ text-domain.
If you get stuck, you can ask for help in the CoCart support forum or join the CoCart Community on Discord where you will find like minded developers who help each other out. If you are in need of priority support, it will be provided by purchasing CoCart Plus or a higher tier.
Find out all relevant features and pricing information over on the official site.
Check out Frequently Asked Questions for more.
Note: The session expiration's can still be filtered back to the previous values but that would mean it would match the expiration for logged in users.Third Party Support
cocart_cart_expiring
added parameter is_user_logged_in()
to allow the expiration for logged in users to be filtered.cocart_cart_expiration
added parameter is_user_logged_in()
to allow the expiration for logged in users to be filtered.cocart_log_entry_name
no longer used.cocart_log_entry_version
no longer used.cocart_log_entry_source
no longer used.cocart_setup_wizard_store_save_next_step_override
no longer used.Dev note: Meaning if you have requested that the customer provides the shipping address first before shipping is calculated, then no shipping methods will return until it's provided.Compatibility
BIGINT UNSIGNED
to bigint(20) unsigned
.t_
before the cart key provided. This matches with WooCommerce session handler where it maybe used by 3rd party plugins or web host configurations to identify if the session is for a guest user.Dev note: This affects only new guest sessions.Compatibility
cocart_get_customer_{field}
after value instead of using it only when there is no value returned for a customers field. Replace {field}
with the section prefix followed by the field name. e.g. billing_country
Developer note: This allows you to then alter values such as the billing country. See example.` add_filter( 'cocart_get_customer_billing_country', function( $value ) { if ( WC()->countries->country_exists( $value ) ) { return WC()->countries->get_countries()[ $value ]; } return $value; }, 10, 1);
* Introduced new filter
cocart_get_after_customer_{field-type}_fieldsthat allows you to change the customer fields after they returned. Replace
{field-type}with either
billingor
shipping` for the fields to alter.
v4.3.21 - 20th February, 2025
Improvement
no-store
as part of the Cache-Control
header for guest users.WP_DEBUG
is made sure it is defined before returning extras for developers in the store response.