Help us improve
Share bugs, ideas, or general feedback.
From woocommerce-commerce
Works with WooCommerce CRUD data stores for WC_Product, WC_Order, WC_Customer, WC_Coupon objects; covers getters/setters, meta data, HPOS migration, custom stores.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin woocommerce-commerceHow this skill is triggered — by the user, by Claude, or both
Slash command
/woocommerce-commerce:woo-data-storesThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Fetch live docs**:
Builds and consumes WooCommerce REST API v3 endpoints: authentication, custom routes, resource extensions, webhooks, batch operations. For WooCommerce API development and integrations.
Guides WooCommerce store development: setup, payment/shipping integration, custom products, optimization, and WordPress 7.0 features like AI product descriptions, DataViews, collaboration.
Provides curl command patterns for direct Wix REST API calls to Stores Catalog V1-V3, with authentication, site/account headers, queries, pagination, bulk updates, and PATCH operations.
Share bugs, ideas, or general feedback.
Fetch live docs:
site:developer.woocommerce.com crud data stores for CRUD documentationsite:github.com woocommerce woocommerce HPOS for HPOS architecturehttps://github.com/woocommerce/woocommerce/wiki for architecture decisionsWooCommerce's core entities extend WC_Data:
WC_Product — products (and subtypes: WC_Product_Simple, WC_Product_Variable, etc.)WC_Order — orders (and WC_Order_Refund)WC_Customer — customer profilesWC_Coupon — discount couponsWC_Shipping_Zone — shipping zonesAll CRUD objects inherit from WC_Data:
$data — array of core properties with defaults$meta_data — array of WC_Meta_Data objects$id — object ID$object_type — string identifier (e.g., 'product', 'order')$data_store — the WC_Data_Store instance handling persistenceget_{prop}( $context = 'view' ) — retrieve a property
'view' context — runs woocommerce_{object_type}_get_{prop} filter (for display)'edit' context — returns raw stored value (for forms/admin)set_{prop}( $value ) — set a property (in memory, not persisted until save())save() — persist to database (calls data store's create() or update())delete( $force_delete ) — remove from databaseget_meta( $key, $single, $context ) — get meta valueupdate_meta_data( $key, $value, $meta_id ) — set meta (in memory)delete_meta_data( $key ) — mark meta for deletionsave_meta_data() — persist meta changes (called automatically by save())Data stores abstract the persistence layer. The CRUD object calls generic methods (read, create, update, delete) on its data store, which handles the actual SQL.
| Object | Data Store | Storage |
|---|---|---|
| Product | WC_Product_Data_Store_CPT | wp_posts + wp_postmeta |
| Order (legacy) | WC_Order_Data_Store_CPT | wp_posts + wp_postmeta |
| Order (HPOS) | Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore | wp_wc_orders + related tables |
| Customer | WC_Customer_Data_Store | wp_users + wp_usermeta |
| Coupon | WC_Coupon_Data_Store_CPT | wp_posts + wp_postmeta |
You can swap data stores via the woocommerce_{object}_data_store filter:
WC_Object_Data_Store_Interface (or extend an existing data store)create(), read(), update(), delete(), read_meta(), update_meta(), delete_meta()add_filter( 'woocommerce_product_data_store', function() { return 'My_Custom_Store'; } )HPOS moves order data from wp_posts/wp_postmeta to dedicated tables:
wp_wc_orders — core order fields (status, currency, total, customer_id, dates)wp_wc_orders_meta — order metawp_wc_order_addresses — billing/shipping addresseswp_wc_order_operational_data — internal operational datawp_posts tableadd_action( 'before_woocommerce_init', function() {
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility(
'custom_order_tables', __FILE__, true
);
}
});
$order->get_meta(), $order->update_meta_data(), $order->save()wc_get_orders() with proper args for queryingget_post_meta(), update_post_meta() on ordersWP_Query to query orders directly$order->get_id() is a wp_posts IDThe proper way to query orders (HPOS-compatible):
status, customer_id, date_created, meta_key, meta_valueWC_Order objectsQuery products — delegates to WC_Product_Query:
type, status, sku, category, tag, price, meta_key, etc.WC_Product objects$data directlysave() after modifying an object'edit' context for admin forms, 'view' context for frontend displaywc_get_orders() / wc_get_products() for queries, not WP_QueryFetch the WooCommerce CRUD and HPOS documentation for exact method signatures, query parameters, and compatibility requirements before implementing.