Merchgain
EN
Available now
Next, in this order
  • FrançaisFR
  • ItalianoIT
  • PortuguêsPT
  • NederlandsNL

A language appears here once its pages are written. Nothing on this site is machine-translated, except the German and Spanish pages, which no native speaker has reviewed yet.

Install freeInstall
← All answers

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.

Group
Running it in your store
Source
R — behavior of WooCommerce core
Code
HPOS
Updated

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_items and woocommerce_order_itemmeta, whichever storage mode you use. _cogs_value is an item meta, so it is in the same table for everybody.
  • Orders are in wc_orders under HPOS and in posts under the classic layout. The order’s total cost is order meta, so it goes to wc_orders_meta or to postmeta accordingly.
  • Products are posts in both cases, with the cost in postmeta plus 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.

See this on a real report

Doesn't match what you see in your store? Email us—we read every message. contact@merchgain.com