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 structural rather than clever: 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: cost values are not touched by it, and they are not re-derived afterwards.
One thing to avoid during any migration: refunds and order edits while the cost feature is off. The reason is in switching the cost feature back off.
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 shop 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 shops that have Analytics switched off entirely.
Related answers
Disagrees with what you see in your shop? Write to us — every message is read. contact@merchgain.com