Cost of Goods by PixelYourSite / Managing Costs / Adding Costs to Products

Adding Costs to Products

Last updated: February 12, 2026

You can add Cost of Goods (COG) to products individually.

Simple Products

  1. Edit a product in WooCommerce.
  2. In the Product data metabox, go to the General tab.
  3. Find the Cost of Goods by PixelYourSite section.
  4. Select the type: Fix or Percent.
  5. Enter the cost value.
  6. The plugin will display the estimated Profit based on the current price.

Variable Products

  1. Edit a variable product.
  2. Go to the Variations tab.
  3. Expand a specific variation.
  4. Enter the Cost of Goods type and value for that specific variation.

Category-Based Costs

If a product has no specific cost, the plugin checks its category.

  1. Go to Products > Categories.
  2. Add or Edit a category.
  3. Enter the Cost of Goods type and value.
  4. This value applies to all products in this category that do not have their own cost set.

How “Cost” is used

For every order, the plugin calculates:

  • Item Cost = (Cost per product/variation) × (Quantity)
  • Order Cost = sum of all item costs (plus shipping cost, if you enabled it)
  • Profit = Order Total − Order Cost
    (and “Order Total” can be with tax or without tax, depending on your Tax rule setting)

Cost fallback logic (what value gets used)

When the plugin needs a cost for an order item, it looks for it in this order:

  1. Variation cost (highest priority)
    • If the customer buys a variation and that variation has its own Cost, that’s the one used.
  2. Parent product cost
    • If the variation has no cost set, the plugin checks the main variable product cost (the parent).
  3. Category fallback cost
    • If there’s no product-level cost, the plugin checks if the product’s category has a default cost rule.
  4. Global rule (last resort)
    • If none of the above exists, the plugin applies your Global rule from WooCommerce → Settings → Cost of Goods by PixelYourSite.

Example (what happens in real life)

  • You sell a T-shirt variation “Size L” with no variation cost set
  • The parent product has Cost = 8 → the plugin uses 8

If the parent product also has no cost, but the category “Apparel” has a Cost = 6, it uses 6.

If the category has no rule either, it uses the Global rule (ex: 20% or Fix 5).