It’s no overstatement to say that the addition of the data store layer of abstraction in WooCommerce 3 opened up an entirely new world of possibilities. Whether your objective is customizing behavior, optimizing performance, or creating an entirely new sales proposition in WooCommerce, data store can provide an elegant way to accomplish the task.
This level of coding can be considered “heavy lifting” in any WP/WooCommerce group of developers. While the considerations are significant, you’ll see that the process is fairly straightforward, with several major players in the industry providing us with a template for success
It is generally known: Historically, WooCommerce has not been highly performant software. Especially with larger stores with over 10k products/purchase orders
As a result of this, the innovative community of WordPress and WooCommerce developers is toiling away to solve this problem. The most notable efforts are Liquid Web’s flattened order table plugin and the custom product table plugin that have been developed by WooCommerce
The big players are working on developing solutions, and there’s a good chance that their solutions will end up in the Woo Core at some point in the future. So make sure you’re not creating extra work for yourself down the line by reinventing the wheel.
WC_Abstract_Order_Data_Store_Interface
WC_Customer_Data_Store_Interface
WC_Customer_Download_Data_Store_Interface
WC_Customer_Download_Log_Data_Store_Interface
WC_Object_Data_Store_Interface
WC_Order_Data_Store_Interface
WC_Order_Item_Data_Store_Interface
WC_Order_Item_Product_Data_Store_Interface
WC_Order_Item_Type_Data_Store_Interface
WC_Order_Refund_Data_Store_Interface
WC_Payment_Token_Data_Store_Interface
WC_Product_Data_Store_Interface
WC_Product_Variable_Data_Store_Interface
WC_Shipping_Zone_Data_Store_Interface
WC_Webhook_Data_Store_Interface
Once you’ve created your new custom data store class, and applied it using either the ‘woocommerce_data_stores’ or the ‘woocommerce_{$object_type}_data_store’ filter. You’ll likely need to convert existing data over. This is the most complex part of the task. We’ll use Liquid Web’s (LW) plugin as an example.
Note: if your are planning on distributing your plugin, you need to include a user friendly method for both migrating to and from your custom data stores. If this is your situation LW’s WP-CLI methodology is a great methodology to examine.
Complex but powerful, custom data stores provides an extraordinary amount of flexibility in customizing WooCommerce.
While it is a bit daunting, you should now have a clear idea of the steps involved in creating a custom data store to support your project. If you need more specifics, the resources provided in the references section are excellent. and even includes an explainer from WooCommerce in their Wiki
Take a deep breath, create a backup, and test your mettle in unlocking the full potential of WooCommerce for your project.
This conclude the topic and the course! Remember this course is designed to be searchable, nimble, and is continuously updated, so keep this material in your back pocket and use it to breeze through your next WooCommerce project!
0 of 1 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 1 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Custom Data Store Must… (select all that apply)