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

How do costs work on variable products and variations?

A variation inherits its parent cost, can replace it, or can add to it. The additive flag, the inheritance rule, and what should count as a missing cost.

Group
Getting the cost data in
Source
R — behaviour of WooCommerce core
Code
VAR
Updated

The short answer

A variation inherits its parent’s cost unless you give it one of its own. If you do, there is one more switch: the variation cost can either replace the parent’s or be added to it.

So a shirt with a cost of 24 and a variation marked additive at 3 costs 27 — which is what you want when the variation is a surcharge, such as an embroidered name, rather than different goods.

What WooCommerce actually does

Parents and variations both keep their entered cost in _cogs_total_value. The variation adds a flag, _cogs_value_is_additive, set to yes when the cost adds to the parent’s and deleted otherwise.

One trap is worth knowing. The lookup column wc_product_meta_lookup.cogs_total_value holds the entered value, not the effective one — so a variation that simply inherits its parent’s cost sits there as NULL. A list of “products with no cost” built from that column alone would be full of variations that are perfectly well covered.

The variations screen also has a bulk action that clears variation overrides, so a product can be reset to “everything inherits the parent” in one step.

What to do about it

Pick one convention per product and stay with it:

  • the same goods in different colours — one cost on the parent, no overrides;
  • genuinely different goods under one product — a cost on each variation, replacing;
  • a surcharge — additive, carrying only the extra.

Then open one or two variations and confirm the flag is where you think it is. The field states which mode it is in, and the two modes differ by the whole parent cost.

How Merchgain reports it

Merchgain counts a variation as having no cost only when both its own value and its parent’s are missing. That rule exists because of the lookup column above: without it, the missing-cost list would be mostly false alarms, and a list you cannot trust is a list you stop reading.

Profit and margin are reported per product, per category and per period — not per variation. The numbers a shop acts on sit at product level, and a per-variation table over a catalogue with thousands of variations is a different screen with a different job.

See this on a real report

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