, it represents creation, read , update , and to delete . Use Woocommerce, including products, orders, customers, coupons and other data stored in your database.
Woocommerce recent changes related to CRUD means that the platform is developing in a more scalability direction. Note: This article is indeed technical and assumes that you have a certain understanding of the PHP code.
Audio learner? The main point of this article comes from my speech in WoOoconf 2017.
In order to make our developers easier, we have added a special CRUD object to WooCommerce 3.0. This replaces all previous posts in WooCommerce, and all extensions must also be used to make the WooCommerce site expand.
At the same time, we added another set of objects named Data Stores, aiming Woocommerce data is loaded in the database and saved from the database. These abstract aims to make WooCommerce process a large number of orders, products and customers. This is achieved by connecting to Woocommerce to store data in different ways.
Each data storage realization determines the data storage and retrieval method of data, whether it is from the database or other ways to store data. By using them, Woocommerce can now be extended to corporate sales, so that millions of orders can be processed. What must be done is to add a filter that redefines woocommerce to store data. In additionThese structures also provide you with greater flexibility in the way to save and load data for the Woocommerce store. For each type of WOOCOMMERCE data (product, order, customer, etc.), you can now determine where the data should come from and where it should go by programming. This allows store builders to customize Woocommerce through interaction with other systems to meet their needs, or upgrade the performance of different parts of Woocommerce as needed.
In addition You provide you with greater flexibility in the way to save and load data for the Woocommerce store.
What does this mean? Well, consider the possibility: Save the order data in different databases from WPDB.
Obtain product data from the existing database on another system.
Sharing product inventory across multiple sites (examples are as follows).
Obtain product data from other sources through API.
Use the CLI command to load and save from one data storage to another (built -in import/export).
- Extended data storage
With the help of CRUD and data storage abstraction, Woocommerce no longer cares about where the data comes from or how to save. You can control it yourself.
In the following example, I retrieved inventory count from a separate service and only changed the inventory count of each product object. One of the benefits of doing this is that I can make multiple Woocommerce websites sell from the same amount of inventory and ensure that I do not sell my inventory.
This is the entrance point
Install_data_store
filter.
] This file contains bidirecti]
View raw class-Product-INVEntory-Data-Store.php Hosted with \u0026#10084; by Github
For most necessary functions, this data storage only calls parent data storage: [[[[[[[[[[[
Show hidden characters
}
View raw class-partum Hosted with \u0026#10084; by github
Copyright © 2026 leadloan blog