前言介紹
- 這款 WordPress 外掛「Headless WooCommerce Made Easy with CoCart」是 2018-02-25 上架。
- 目前有 1000 個安裝啟用數。
- 上一次更新是 2025-04-27,距離現在已有 6 天。
- 外掛最低要求 WordPress 6.3 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 7.4 以上。
- 有 21 人給過評分。
- 論壇上目前有 3 個提問,問題解答率 67% ,不低,算是個很有心解決問題的開發者團隊了!
外掛協作開發者
sebd86 | cocartforwc |
外掛標籤
cart | headless | rest-api | decoupled | woocommerce |
內容簡介
重要訊息
自 2022 年 10 月 5 日起,WordPress.org 中的 CoCart 外掛將不再進行重大更新,此舉是為了專注於付費的 CoCart Pro 版本。只有針對錯誤的次要修復將會更新。請放心,您仍然可以永遠使用此外掛。
此外,雖然仍可使用 API v1,但不會再獲得支持。
CoCart:為 WooCommerce 打造的 #1 電商 RESTful API,可擴展至無界面開發。
使用 CoCart 將您的 WooCommerce 業務推至全新高峰,使用無界面電商。
CoCart 可自定義的 WooCommerce REST API,讓您將 CMS 與呈現層分離,開發人員可使用熟悉的框架和工具。
🥪 API
CoCart 支援管理使用者會話,雖然也有其他替代選項可供使用;但其使用限於與 WordPress 安裝同源的應用程式。這是因為 WooCommerce 使用 cookie 儲存使用者會話權杖。
CoCart 提供了更改此行為的實用程式,在任何購物車請求期間傳遞所需的資訊至 HTTP 標頭,以便客戶端進行緩存。使用 HTTP 授權標頭則是選擇性的,使使用者可以像訪客一樣購物。
🛒 購物車 API
透過產品 ID 或 SKU ID 將簡單、變化和分組產品添加到購物車,個別或批次更新購物車項目等。該流程簡單易懂,每次都會返回更新過的購物車回應,所有總計和庫存檢查都已計算完成,讓您更輕鬆地更新 UX/UI。
🛍️ 產品 API
訪問您的商店中的產品,以您喜歡的方式顯示,包括多個查詢,可幫助您通過產品類別、標籤、屬性等進行篩選。您甚至可以獲取已發表的評論,所有有關產品的資訊和其狀態,可幫助您開發 UX/UI。
➕ 額外功能
獲取商店資訊。
登入客戶/使用者。
登出客戶/使用者。
清空購物車。
對於管理員來說,作為額外的福利,CoCart 還提供以下功能:
獲取會話中的購物車。
獲取會話中購物車的詳細資訊。
查看已添加至會話中的購物車項目。
刪除會話中的購物車。
✨ 功能
CoCart 還提供了內建功能:
全新:覆寫被添加到購物車的簡單或可變產品的價格。
全新:將客戶的電子郵件地址附加到添加到購物車的商品。在被遺棄的購物車情況下非常有用。
透過網絡載入會話中的購物車。如果您沒有無界面結帳,並想使用原生的結帳功能,則非常有用。
支援訪客客戶。
支援基本驗證,包括以電子郵件作為用戶名。
支援 透過 WooCommerce 方法身份驗證。
支援多站點網絡。
不緩存 API,因此每次都會獲得新鮮的回應。
可跨多個域工作,支援跨來源資源共享 (CORS)!因此,可以將多個前端連接到一個後端。
可讓您過濾 CoCart 以使其成為白標記。
隨 CoCart 一起提供的還有:
详细的文档
教程和代码单元测试报告
密码保护API文档
帮助和支持
原文外掛簡介
CoCart provides developers with a flexible REST API, designed to save hours of development so you can spend time building modern and scalable stores away from WordPress. Unlock your WooCommerce store, TODAY.
Using CoCart makes building headless stores in modern frameworks like Astro, React, Vue, or Next.js easy and makes complex customizations a breeze.
Want to try it out?
Why WooCommerce?
CoCart chose to support WooCommerce because it provides a flexible and efficient way to build cutting-edge stores with WordPress at its core. However, it was missing a key component to decouple WooCommerce via the REST API efficiently. That’s where CoCart comes in.
Finally, a REST API that’s Easy and Powerful
Struggling with performance? Finding it hard to decouple WooCommerce from WordPress without hitting roadblocks? CoCart is here to eliminate the hassle of creating your own REST API endpoints for WooCommerce and provides all the essential features for a powerful, headless eCommerce experience making it easy to decouple WooCommerce from WordPress.
Source of Truth – CoCart utilizes WooCommerce’s Data Stores API and mirrors most WooCommerce hooks, ensuring broad compatibility with numerous extensions right from the start.
No Cookie Required – Our session handler generates a unique key for each user session in the WordPress database, storing session-related metadata on the client side without imposing a heavy load.
Easy Authentication – No Admin API Keys required. Customers can log in with their account either with Email+Password, Username+Password, or Phone Number+Password.
Domain Dominance – Addressing CORS issues in decoupled setups, CoCart grants you control over the origin.
Efficient Product Search – Search products by name, ID, or SKU; filter and retrieve necessary product data without authentication, ensuring no private data is exposed.
Real-Time Cart Validation – Our system minimizes the need for multiple requests to verify item and coupon validity in your cart. It efficiently checks stock, calculates totals and fees, ensuring real-time accuracy so your responses are consistently up-to-date.
No Headless Checkout? – Easily load any cart session into the native WooCommerce checkout if you prefer.
Customizable Callbacks – Register your own cart callbacks without creating new endpoints. CoCart handles the rest, returning responses once complete.
Customer Tracking – Monitor all cart sessions, including those nearing expiration or already expired.
Name Your Price Built In – Empower your customers to set their price, encouraging support with flexible payment options that broaden your paying audience.
Bulk Requests – Batch multiple cart requests at once for efficiency and faster responses.
And this is just the start. With CoCart, your WooCommerce store can be faster, more flexible, and ready to take on any custom solution you dream up.
★★★★★
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 born out of frustration with no easy solution on the market. As beautiful as it functions, the API is just as flexible with you, the developer, in mind. We spend an unfathomable amount of time making the API a joy to work with.
Our goal is to create the API for you so you can focus on building a headless store. Integrate with CoCart in days, not months.
★★★★★
Amazing Plugin. I’m using it to create a react-native app with WooCommerce as the 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 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
CoCart Beta Tester allows you to easily update to pre-release versions of CoCart for testing and development purposes.
CoCart VSCode extension for Visual Studio Code adds snippets and autocompletion of functions, classes, and hooks.
CoCart Product Support Boilerplate provides a basic boilerplate for supporting different product types to add to the cart with validation including adding your own parameters.
CoCart Cart Callback Example provides you an example of registering a callback that can be triggered when updating the cart.
📢 Testimonials – Developers just love it
★★★★★
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
More 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:
MAJOR version when you make incompatible API changes.
MINOR version when you add functionality in a backwards compatible manner.
PATCH version when you make backwards compatible bug fixes.
You can read more about the details of Semver at semver.org
👍 Add-ons to further enhance CoCart
We also have add-ons that extend CoCart to enhance your development and your customers shopping experience.
CoCart – CORS enables support for CORS to allow CoCart to work across multiple domains.
CoCart – JWT Authentication allows you to authenticate via a simple JWT Token.
CoCart – Cart Enhanced enhances the data returned for the cart and the items added to it.
and more add-ons in development.
They work with the core of CoCart already, and these add-ons of course come with support too.
⌨️ Join our growing community
On Discord, we have a community of developers, WordPress agencies, and shop owners building the fastest and best headless WooCommerce stores with CoCart.
Come and join our community
Built with developers in mind
If you’re interested to jump in the project, there are opportunities for developers at all levels to get involved. Contribute to CoCart on the GitHub repository and join the party. 🎉
🐞 Bug reports
Bug reports for CoCart are welcomed in the CoCart repository on GitHub. Please note that GitHub is not a support forum, and that issues that aren’t properly qualified as bugs will be closed.
More information
The official CoCart API plugin website.
CoCart for Developers, an official hub for resources you need to be productive with CoCart and keep track of everything that is happening with the API.
CoCart API Reference
Subscribe to updates
Like, Follow and Star on Facebook, Twitter, Instagram and GitHub
💯 Credits
This plugin is developed and maintained by Sébastien Dumont.
Founder of CoCart Headless, LLC.
Contributors & Developers
You can help translate “CoCart” into your language.
INTERESTED IN DEVELOPMENT?
Browse the code on GitHub, or follow the CoCart development blog for the latest development updates. You can also follow @cocartapi on Twitter to stay up to date about everything happening with CoCart.
Please share your experience
We’d love to hear what you have to say. Share your experience and help others discover CoCart. It helps to keep the plugin going strong, and is greatly appreciated.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Headless WooCommerce Made Easy with CoCart」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
4.0.0 | 4.0.1 | 4.0.2 | 4.1.0 | 4.1.1 | trunk | 4.3.15 | 4.3.16 | 4.3.17 | 4.3.18 | 4.3.19 | 4.3.20 | 4.3.21 | 4.3.22 | 4.3.23 | 4.3.24 | 4.3.25 | 4.3.26 | 4.3.27 | 4.3.28 | 4.3.29 | 4.3.30 |
延伸相關外掛(你可能也想知道)
WPGraphQL 》WPGraphQL 是一個免費、開源的 WordPress 外掛,為任何 WordPress 網站提供可延伸的 GraphQL schema 和 API。, 以下是一些有助於你開始使用 WPGraphQL 的連結...。
Headless CMS 》這是一個 WordPress 外掛,透過 REST API 向任何前端環境添加以下功能,使 WordPress 成為無界面 CMS。, 此外掛提供多種功能,您可以使用與您的前端應用程式...。
Faust.js 》 Faust 外掛與 Faust NPM 套件 協同工作,透過 GraphQL 調變和 REST API 端點,讓解耦式前端與 WordPress 進行驗證,並扮演 Faust 前端應用程式與 WordPress ...。
CoCart CORS Support 》這款免費的外掛程式為 CoCart 提供支援 CORS,允許 CoCart 在多個網域上運作。, 只需安裝並啟用,無需任何配置!, 工具和庫, , CoCart Beta Tester 讓您輕鬆...。
WPGraphQL Blocks 》總結:透過wp-graphql外掛,可將Gutenberg塊轉換成JSON資料。, , 問題與答案:, , 問題:wp-graphql是什麼外掛?, 答案:wp-graphql是在WordPress上使用Graph...。
CoCart – Cart API Enhanced 》此免費 WordPress 外掛是針對 CoCart 的附加元件,可增強傳回給購物車和添加到其中的商品的資料。, 功能, 每個添加到購物車的商品都會傳回以下資料:, , 返回...。
WPGraphQL IDE 》總結:WordPress 外掛 GraphQL IDE for WPGraphQL 為使用者提供一個更直觀的界面,方便進行 GraphQL 查詢和測試。, , 問題與答案:,
- ,
CoCart JWT Authentication 》- CoCart的免費附加元件可讓您透過簡單的JWT Token進行身份驗證。- 啟用PHP HTTP授權標頭- 大多數共享主機默認已禁用HTTP授權標頭。- 要啟用此選項,您需要通...。
Publish to Netlify 》使用 WordPress 作為後端,輕鬆將靜態網站部署到 Netlify。此外掛使用 Netlify webhook 觸發部署流程,建構您的靜態網站。。
Gato GraphQL 》- Gato GraphQL 是一個能夠與 WordPress 網站的資料互動的工具,可以檢索、操作和再次儲存任何您所需的資料, - Gato GraphQL 可以處理來自多個外掛的功能:, ...。
Guillotheme 》Guillotheme此外掛可透過限制存取WordPress生成的前端加密連結(permalinks),將佈景主題的前端部分(即head)截掉。這在使用非一般結構或解耦應用時是不必...。
CoCart – Rate Limiting 》此免費外掛為 CoCart 提供額外的速率限制功能,可用在版本 4.0 以上。, 只需安裝並啟用即可,無需其他設置。但若需更改任何選項,可透過 wp-config.php 檔案...。
Decoupled Preview 》這款 WordPress 外掛可以在多個拆解前端中提供預覽,並且可以與 Decoupled Kit Next.js WordPress Starter 一起使用,提供預先配置的文章和頁面內容。它還具...。