Does it work with High-Performance Order Storage?
Yes, and with classic post storage too. Order line items live in the same tables under both layouts, which is exactly where the cost values are.
The short answer
Yes, both. HPOS and the classic post-based storage are equally supported, and there is nothing to configure either way.
The reason is simple: HPOS moved orders into their own tables, not order line items. The cost of each sold item lives on the line item, in the same place under both layouts.
What WooCommerce actually does
- Line items stay in
woocommerce_order_itemsandwoocommerce_order_itemmeta, whichever storage mode you use._cogs_valueis an item meta, so it is in the same table for everybody. - Orders are in
wc_ordersunder HPOS and inpostsunder the classic layout. The order’s total cost is order meta, so it goes towc_orders_metaor topostmetaaccordingly. - Products are posts in both cases, with the cost in
postmetaplus the lookup column.
So a report needs to know your storage mode for the order-level part of the query and not at all for the item-level part—and the item level is where the interesting number is.
What to do about it
Nothing, on the cost side. If you are still on classic storage and considering the migration, that decision has nothing to do with this report. The migration moves orders and their meta, including each order’s total cost, and leaves the order lines, where the cost of each item sits, where they are. Nothing is recalculated along the way.
How Merchgain reports it
Merchgain declares HPOS compatibility the way WooCommerce asks plugins to
(FeaturesUtil::declare_compatibility() on before_woocommerce_init), and builds its query
against whichever order table your store actually uses.
It also does not require the WooCommerce Analytics module. Analytics keeps its own lookup tables and they carry no cost column at all, so this report queries the order tables directly—which means it works on stores that have Analytics switched off entirely.
Related answers
Doesn't match what you see in your store? Email us—we read every message. contact@merchgain.com