开发者 |
sebd86
cocartforwc ajayghaghretiya skunkbad sefid-par mattdabell joshuaiz dmchale JPPdesigns inspiredagency darkchris mohib007 rozaliastoilova ashtarcommunications albertoabruzzo jnz31 douglasjohnson antondrob2 szepeviktor |
---|---|
更新时间 | 2024年12月13日 04:27 |
PHP版本: | 7.4 及以上 |
WordPress版本: | 6.7 |
版权: | GPLv3 |
版权网址: | 版权信息 |
An excellent plugin, which makes building a headless WooCommerce experience a breeze. Easy to use, nearly zero setup time. Harald Schneider🛒 Built for developers, by developers CoCart was created to fill a gap in the market for a robust, developer-friendly solution for headless WooCommerce stores. With a clean, intuitive API, CoCart lets you focus on what you do best: building unique and seamless shopping experiences. ★★★★★
Amazing Plugin. I’m using it to create a react-native app with WooCommerce as back-end. This plugin is a life-saver! Daniel Loureiro📦 Serious about going headless? Unlock your store’s true potential. Upgrade to access premium features and extend CoCart’s capabilities to take your headless WooCommerce store even further. See what else we have in store. ★★★★★
This plugin saved me tones 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 a 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 BoxMore testimonials See the wall of love. ☀️ Upgrading It is recommended that anytime you want to update CoCart that you get familiar with what's changed in the release. CoCart publishes release notes via the changelog. CoCart uses Semver practices. The summary of Semver versioning is as follows:
CoCart provides a REST API that is ready to decouple WooCommerce away from WordPress. It allows you to search products by Name, ID or SKU, filter and return product data you need without authentication, manage cart sessions for customers and avoids the hassle of needing multiple requests to verify item and coupon validity in your cart. It also efficiently checks stock, calculates totals and fees, ensuring real-time accuracy so your responses return up to date every time. 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.
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 it's 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 maybe 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 your 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 still prone to be used on native storefronts. It also lacks validation on the server end which you will need and not every extensions yet works with it out of the box. A lot of valuable information and abilities that developers require to help them are also unavailable and if you try to use the Store API for headless you will have issues managing the cart sessions. CoCart's API is designed for decoupling away from WordPress with ease. It's 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 100+ 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 API's 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.
Yes. The best method would be to install/update CoCart from the GitHub repository but you can also do so via https://wpackagist.org/
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.
Developer note: The last patch was not a great one but have found the root of the issue affecting carts for registered customers and is fixed in this one.v4.3.14 - 21st November, 2024 Bug Fixes
Dev note: The conflict is not triggered only on DELETE request methods.v4.3.13 - 21st November, 2024 Security Patch It appears that the rules of hidden and private meta is not respected and is still exposed on products that have such meta. This security patch ignores any meta data that is still leaking publicly without authorization. Wait what happened to v4.3.12? A commit error was spotted shortly after just releasing it and was taken down immediately. Improvement
Just a note: The security issue isn't directly related to CoCart itself, but we’re here to help keep your store secure. Since CoCart is a public API, security patches will be released as soon as possible to prevent the issue from affecting your site, so you don’t have to wait for a fix from the plugin causing it. We recommend updating to this version if you’re using any WooCommerce plugins that might reveal public information. We want you to know that we would never publicly name a plugin with a security concern. However, if you notice any security issues with CoCart or another plugin connected to it, please report the security vulnerability so we can address it quickly. Thank you for helping us keep CoCart safe for everyone!v4.3.8 - 7th November 2024 🐛 Bug Fix
Developer note: A commit was missing causing a fatal error when adding items to the cart.Changes
is_rest_api_request()
function within the authentication class.0
to 1
to help with CORS.access-control-allow-origin
.update_session_timestamp()
function from failing in session handler.These filters are for site admins more than anything.
cocart_in_plugin_update_message
allows you to change the upgrade notice.cocart_get_plugins_with_header
allows you to get the plugins that have a valid value for a specific header.cocart_get_plugins_for_cocart
allows you to get plugins which "maybe" are for CoCart.We advise that you update on staging or local to check if you have used any of our experimental functions and filters that were added to the session handler to see if any have been deprecated. You can also see the list of deprecations below. If you have any questions about this update please contact us.What's New?
cocart-api-cart-key
.is_user_customer()
to check the user role is a customer when authenticated before migrating cart from guest.cocart_update_customer_fields
.get_product_image_sizes()
. Cuts down on the filter cocart_products_image_sizes
being in multiple places.currency_symbol_pos
and the currency symbol will now return based on the set currency without lookup.is_rest_api_request()
function to the main class so it can be utilized outside of the plugin.CoCart_Session
that extended WC_Session
. Any remaining functions have moved to our refreshed session handler.CoCart_Session_Handler::destroy_cookie()
no longer used.CoCart_Session_Handler::cocart_setcookie()
no longer used.CoCart_Session_Handler::get_cart()
no longer used.cocart_cookie
no longer used. Use woocommerce_cookie
instead.cocart_cookie_httponly
no longer used.cocart_cookie_supported
no longer used.cocart_set_cookie_options
no longer used.cocart_cart_use_secure_cookie
no longer used. Use wc_session_use_secure_cookie
instead.cocart_is_cart_data_valid
no longer used.X-CoCart-API-Timestamp
and X-CoCart-API-Version
no longer used.cocart_after_session_saved_data
fires after the session is saved.cocart_send_nocache_headers
to decide if nocache headers are sent.HTTP_AUTHORIZATION
, REDIRECT_HTTP_AUTHORIZATION
or getallheaders()
function.cocart_does_product_allow_price_change
.CoCart-API-Cart-Expiring
and CoCart-API-Cart-Expiration
to be exposed with CORS.cocart_override_cart_item
filter. Recommend using cocart_item_added_to_cart
action hook instead.cocart_cart_updated
hook. Replaced with cocart_update_cart_before_totals
hook.cocart_auth_header
that allows you to change the authorization header.cocart_set_customer_id
that allows you to set the customer ID before initialized.cocart_available_shipping_packages
that allows you to alter the shipping packages returned.cocart_does_product_allow_price_change
that allows you to deny all custom prices or on specific items.cocart_update_customer_fields
that allows for additional customer fields to be validated and added if supported.cocart_after_item_added_to_cart
that allows for additional requested data to be processed once item has added to the cart.cocart_after_items_added_to_cart
that allows for additional requested data to be processed once items are added to the cart.cocart_update_cart_before_totals
fires before the cart has updated via a callback.cocart_update_cart_after_totals
fires after the cart has updated via a callback.cocart_cart
. No longer use $from_session
parameter.ReserveStock
not found when adding products to cart.Developer note: A line was unintentionally removed that calls the class for use.v4.0.0 - 13th May, 2024 In this release, we are happy to provide some of the various improvements made through out the plugin that were from the originally planned v4 release. These improvements are backwards compatible but one change is not. See the developer note for details.
Developer note: This release requires the quantity parameter to pass the value as a string for both adding items or updating items. If you are not new to CoCart then please update your code to account for this change.Find out more about what’s new in CoCart 4.0 in our release post! Hope you enjoy this release. What's New?
Access-Control-Allow-Credentials
being outputted as 1 instead of true. Solves issue 410. Thanks to @SebastianLamprecht for reporting it.CoCart-API-Cart-Expiring
and CoCart-API-Cart-Expiration
.These two new headers can help developers use the timestamps of the cart in session for when it is going to expire and how long until it does expire completely.
WP_DEBUG
is set to true to help with any debugging.