WP SITES

3088 Coded Tutorials & 294 Plugins

How to Calculate Tax on Profit Margin Using COGS for WooCommerce

This tutorial will walk you through setting up margin-based tax calculation using the COGS Tax plugin for WooCommerce.

STEP 1 : Enable the COGS Tax Plugin

  1. Go to WooCommerce > Settings > COGS Tax
  2. Check the box next to “Enable Margin-Based Tax”
  3. Click “Save changes”

STEP 2 : Set Up Standard Tax Rates

  1. Go to WooCommerce > Settings > Tax
  2. Click on the “Standard rates” tab
  3. Click “Insert row”
  4. Fill in the tax rate details:
  • Country code: Enter country code (e.g., US)
  • State code: Enter state code (e.g., CA) or leave blank for all states
  • Postcode/ZIP: Enter specific ZIP codes or leave blank for all
  • City: Enter specific cities or leave blank for all
  • Rate %: Enter the tax percentage (e.g., 8.5)
  • Tax name: Enter a name (e.g., “Sales Tax”)
  • Priority: Leave as 1 (unless you have compound taxes)
  • Compound: Leave unchecked (unless this tax should be calculated on top of another)
  • Shipping: Check if tax applies to shipping

5. Click “Save tax rates”

    STEP 3 : Create a Custom Tax Class for Margin-Based Tax

    1. Go to WooCommerce > Settings > Tax
    2. Scroll down to “Additional tax classes” section
    3. In the “Add tax class” field, type a name (e.g., “cogs-tax”)
    4. Click “Add tax class”
    5. The new tax class will appear in the list

    STEP 4 : Set Up Tax Rate for Your Custom Tax Class

    A. Add a Tax Rate for Your Custom Tax Class (Margin-Based Tax)

    1. Go to WooCommerce > Settings > Tax
    2. Click on the tab for your custom tax class (e.g., “Tax on Profit”)
    3. Click “Insert row”
    4. Fill in the tax rate details:
    • Country code: Enter country code (e.g., US)
    • State code: Enter state code or leave blank
    • Postcode/ZIP: Enter specific ZIP codes or leave blank
    • City: Enter specific cities or leave blank
    • Rate %: Enter the tax percentage for profit margin (e.g., 5)
    • Tax name: Enter a name (e.g., “5% Tax on Profit”)
    • Priority: Leave as 1
    • Compound: Leave unchecked
    • Shipping: Check if tax applies to shipping

    5. Click “Save tax rates”

      STEP 5 : Add COGS Value to Products

      1. Go to Products > All Products
      2. Click on a product to edit it
      3. In the product editor, find the “Product Data” section
      4. Look for the COGS (Cost of goods ($)) field
      • Enter the cost value (e.g., 50 for a $100 product)

      5. Click “Update” to save

        STEP 6 : Configure Product Tax Settings

        A. Set Product Tax Class

        1. While editing a product, go to the “General” tab
        2. Find the “Tax class” dropdown
        3. Select your custom tax class (e.g., “Tax on Profit”)
        4. Click “Update” to save

        B. Configure Margin-Based Tax Setting for Individual Products

        1. While editing a product, go to the “General” tab
        2. Find the “Margin-Based Tax” dropdown
        3. Choose one of these options:
        • “Use global setting” – Uses the setting from Step 1
        • “Enable” – Always use margin-based tax for this product
        • “Disable” – Never use margin-based tax for this product

        4. Click “Update” to save

          STEP 7 : Test the Tax Calculation

          1. Add the product to your cart
          2. Go to the cart page
          3. You should see:
          • Subtotal: Full product price (e.g., $100)
          • Tax: Calculated on margin only (e.g., if margin is $50 and tax rate is 5%, tax = $2.50)
          • Total: Subtotal + Tax

          Example Calculation:

          Product Price: $100
          COGS Value: $50
          Margin: $100 – $50 = $50
          Tax Rate: 5%
          Tax Amount: $50 × 5% = $2.50
          Total: $100 + $2.50 = $102.50

          Without margin-based tax, tax would be calculated on full price:
          Tax Amount: $100 × 5% = $5.00
          Total: $100 + $5.00 = $105.00

          STEP 8 : Bulk Edit Products (Optional)

          1. Go to Products > All Products
          2. Select multiple products using checkboxes
          3. Click “Bulk actions” dropdown
          4. Select “Edit”
          5. Click “Apply”
          6. In the bulk edit panel:
          • Find “Margin-Based Tax” dropdown
          • Select your desired setting
          • Click “Update”

          STEP 9 : Quick Edit Products (Optional)

          1. Go to Products > All Products
          2. Hover over a product and click “Quick Edit”
          3. Find the “Margin-Based Tax” dropdown
          4. Select your desired setting
          5. Click “Update”

          TROUBLESHOOTING

          • If tax is not calculating correctly, make sure:
          • COGS value is set on the product
          • Tax class is assigned to the product
          • Margin-Based Tax is enabled (globally or per-product)
          • Tax rates are properly configured
          • WooCommerce tax settings are enabled
          • If you see the full product price being taxed instead of margin:
          • Check that Margin-Based Tax is enabled in plugin settings
          • Verify the product has a COGS value
          • Check the product’s Margin-Based Tax setting

          SUPPORT

          For additional help, contact: plugins@wpsites.net

          Leave a Reply

          New Plugins