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

How do costs work on variable products and variations?

A variation inherits its parent's cost unless it has its own. The rarely seen additive flag, the inheritance rule, and what should count as a missing cost.

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

The short answer

A variation inherits its parent’s cost unless you give it one of its own. In the product editor that is the whole choice: leave a variation’s Cost field empty and it uses the cost from the General tab; type a cost and it replaces the parent’s.

There is a third mode the editor does not show: a variation cost added to the parent’s. A shirt with a cost of 24 and an additive variation at 3 costs 27, which suits a surcharge such as an embroidered name. WooCommerce has no switch for it in the admin. It can be set only through the REST API or in code.

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. In the REST API it is defined_value_is_additive.

A variation can also hold an explicit cost of 0. That counts as its own cost, so it does not fall back to the parent’s.

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 tab also has a bulk action, Remove custom costs, that clears every variation’s own cost, so the whole product goes back to “everything inherits the parent” in one step.

What to do about it

Pick one convention per product and stick with it:

  • the same goods in different colors—one cost on the parent, nothing on the variations;
  • genuinely different goods under one product—a cost on each variation;
  • a surcharge—the full cost on each variation is the simplest way. Use the additive flag only if you set costs through the API anyway.

If a developer or an app has set costs for you, ask whether it used the additive flag. The editor does not show it: an additive variation’s Cost field holds only the extra amount, and the product’s real cost is that amount plus the parent’s.

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 and per category, for the date range you pick, not per variation. The numbers a store acts on sit at product level, and a per-variation table over a catalog with thousands of variations is a different screen with a different job.

See this on a real report

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