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

A language shows up here once its pages are actually written. Nothing on this site is machine-translated.

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 shop
Source
R — behaviour 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 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_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: 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.

See this on a real report

Disagrees with what you see in your shop? Write to us — every message is read. contact@merchgain.com