=== Ni Cost of Goods for WooCommerce ===
Contributors: anzia
Tags: cost of goods, cogs, profit margin, profit report, woocommerce reports
Requires at least: 5.0
Tested up to: 6.9.4
Stable tag: 3.4.5
Requires PHP: 7.4
WC requires at least: 5.0
WC tested up to: 10.6.1
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Last Updated Date: 10-September-2026

Add cost of goods (COGS) to WooCommerce products and see real profit, profit margin and profit reports by product, order, customer and category.

== Description ==

**Ni Cost of Goods for WooCommerce** adds a cost price (COGS / purchase price) to every simple and variable product and turns it into clear **profit reports**, so you know your true **gross profit and profit margin** on every sale &ndash; not just revenue.

WooCommerce shows you sales, but it does not tell you what those sales *cost* you. This cost of goods plugin fills the gap: enter what you pay for each product and it calculates profit per product, per order, per customer and per category, with dashboards, date filters and year&#8209;over&#8209;year analysis built in.

Every report is fully compatible with **WooCommerce HPOS (High&#8209;Performance Order Storage)** and with classic post&#8209;based order storage, so your profit figures stay accurate on any store.

= Why track cost of goods in WooCommerce? =

* Know your real net profit and profit margin, not just turnover.
* Find low&#8209;margin and loss&#8209;making products before they hurt your bottom line.
* Price new products with confidence using accurate cost data.
* Compare profit month by month and year by year to see what is working.
* Value your inventory at cost for accounting and stock planning.

= Key features =

**Cost price for every product** &ndash; Add a cost of goods / purchase price to simple products, variable products and individual variations. Profit margin, net profit and profit percentage are calculated for you.

**Profit dashboard** &ndash; One screen with total, this&#8209;year, this&#8209;month, this&#8209;week, yesterday and today figures for sales, order count and profit, plus your top 5 profit products, customers and categories.

**Product Profit Report** &ndash; Line&#8209;by&#8209;line profit for sold items: product name, quantity, sales price, line total, cost price and profit. Search and filter by period (today, yesterday, last 7 / 15 / 30 / 60 / 90 days), billing country, customer first / last name and order ID, then sort by any column. Printable.

**Order Profit Report** &ndash; Profit per order after cost of goods and payment gateway charges, with customer, country, payment method, order total and currency.

**Top Profitable Products** &ndash; The best performing products for today, yesterday and the last 7 days, ranked by quantity, revenue and profit.

**Profit Analysis (year over year)** &ndash; Month&#8209;by&#8209;month profit for the current year versus the previous year, so trends are obvious at a glance.

**Category Stock Value Report** &ndash; Stock quantity and stock value for every product category, for inventory control and stock valuation.

**Payment gateway charges** &ndash; Record a fixed or percentage fee for each payment gateway and have it deducted in the Order Profit Report for a true net profit.

**Bring your own meta key** &ndash; Already storing a cost price with another cost of goods plugin? Point this plugin at that meta key in Settings and keep all of your existing data.

**Product list columns** &ndash; Optionally show cost price, net profit, net profit margin (%) and profit percentage (%) columns on the WooCommerce Products screen, and edit the cost price with Quick Edit and Bulk Edit.

= HPOS ready and developer friendly =

* Declares compatibility with WooCommerce High&#8209;Performance Order Storage (custom order tables).
* Works with legacy (post&#8209;based) WooCommerce orders too &ndash; the same business result in both modes.
* Reports are built on optimised, strict&#8209;mode&#8209;safe SQL with filter hooks for customisation.
* All profit reports respect the Pending, Processing, On&#8209;Hold and Completed order statuses.

<p>The Ni Cost of Goods for WooCommerce Pro version adds bulk cost price updates, a dashboard summary, daily and monthly profit reports, stock valuation reports, CSV export and more.</p>

<blockquote>
<h4>Ni Cost of Goods for WooCommerce Pro &ndash; Buy Now and View Demo</h4>
<ul>
<li><a href="http://demo.naziinfotech.com?demo_login=woo_cost_of_goods" target="_blank">View live demo of Ni Cost of Goods for WooCommerce Pro</a></li>
<li><a href="http://naziinfotech.com/product/ni-woocommerce-cost-of-good-pro/" target="_blank">Buy Ni Cost of Goods for WooCommerce Pro</a></li>
</ul>
<p></p>
</blockquote>

<h4>Ni Cost of Goods for WooCommerce Pro features</h4>
<ul>
<li>Bulk cost of goods price update</li>
<li>Dashboard summary</li>
<li>Daily profit report</li>
<li>Monthly profit report</li>
<li>Product profit report</li>
<li>Stock report</li>
<li>Add cost of goods for simple products</li>
<li>Add cost of goods for variable products and variations</li>
<li>Export reports to CSV</li>
<li>Stock valuation</li>
<li>Stock quantity</li>
</ul>

<blockquote>
<h4>Support, feedback and custom report requests</h4>
<ul>
<li>We welcome your suggestions and feedback &ndash; thank you for using our plugin.</li>
<li><a href="mailto:support@naziinfotech.com">support@naziinfotech.com</a></li>
</ul>
<p></p>
</blockquote>

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`, or install it from **Plugins &rarr; Add New** in your WordPress admin.
2. Activate **Ni Cost of Goods for WooCommerce** from the Plugins screen (WooCommerce must be active).
3. Open the **Ni Cost Of Goods** menu in the WordPress admin.
4. Edit a product and enter its **Cost Of Goods** value (on the General tab for simple products, or per variation for variable products), or use the **Add Cost Price** screen to set many products quickly.
5. New orders now store the cost price, and the profit reports fill in automatically.

== Frequently Asked Questions ==

= What is cost of goods sold (COGS)? =

Cost of goods sold is what a product costs you to buy or make, before you sell it. Sales price minus cost of goods equals your gross profit. This plugin stores that cost per product and does the profit maths for you.

= How do I add a cost price to WooCommerce products? =

Edit a product and enter the **Cost Of Goods** value on the General tab (simple products) or on each variation (variable products). You can also set costs in bulk from the **Add Cost Price** screen, or with Quick Edit / Bulk Edit on the Products list.

= Does this plugin work with WooCommerce HPOS (High-Performance Order Storage)? =

Yes. The plugin declares HPOS compatibility and every report has a dedicated query path for both HPOS (custom order tables) and legacy post&#8209;based orders, so profit, totals and filters match in either storage mode.

= Does it support variable products and variations? =

Yes. You can set a separate cost of goods for every variation, and the reports use the exact variation that was sold.

= I already store a cost price with another plugin. Can I reuse it? =

Yes. Go to **Ni Cost Of Goods &rarr; Setting** and enter the meta key your other plugin uses (for example `_ni_cost_goods`, `_wc_cog_cost`, or your own). The reports will read that key with no data migration.

= Which orders are included in the profit reports? =

Orders with the status Pending, Processing, On&#8209;Hold or Completed. Refunds are excluded from sales and profit totals.

= Does it change my product or order data? =

No. It reads WooCommerce data and stores only the cost price you enter (as product meta) and an optional payment gateway charge per order.

= Do you customise this plugin? =

Yes. Contact support@naziinfotech.com with your requirement.

= Where can I get support? =

Use the plugin support forum, or email support@naziinfotech.com.

== Screenshots ==

1. Sales analysis &ndash; order count and value
2. Profit analysis &ndash; order count and value
3. Top 5 profit products
4. Top 5 profit customers
5. Product Profit Report search and filter
6. Product profit grid / table
7. Product Profit Report
8. Today, yesterday and last 7 days top profit products
9. Add cost price to products
10. Cost of goods settings
11. Extra profit columns on the Products list
12. Top 5 profit categories
13. Current year vs previous year profit

== Changelog ==

= version 3.4.5 - 10-September-2026 =
* Fixed: Order Profit Report now works on both WooCommerce HPOS and legacy (post-based) order storage
* Fixed: report queries are now compatible with MySQL strict mode (ONLY_FULL_GROUP_BY)
* Fixed: date range filters (Last 7 / 15 / 30 / 60 / 90 days) in the Product and Order Profit Reports
* Fixed: PHP 7.4 fatal error in the payment gateway charges class
* Fixed: custom cost of goods meta key not being applied on the Add Cost Price screen
* Fixed: refund orders no longer counted in HPOS sales and profit totals (now matches the legacy path)
* Fixed: Profit Analysis report used the site timezone on legacy orders and GMT on HPOS; both now use GMT
* Improved: removed unused duplicate files from the plugin package
* Tested: Compatible with WooCommerce 10.6.1
* Tested: Compatible with WordPress 6.9.4

= version 3.4.4 - 02-April-2026 =
* Added: payment gateway charges
* Added: order report to show profit - payment gateway charges

= version 3.4.3 - 25-March-2026 =
* Fixed: HPOS and legacy issue

= version 3.4.2 - 23-March-2026 =
* Tested: Compatible With WooCommerce 10.6.1
* Tested: Compatible With WordPress  6.9.4
* Fixed: Security issue

= version 3.4.1 - 18-March-2026 =
* Tested: Compatible With WooCommerce 10.6.1
* Tested: Compatible With WordPress 6.9.4

= version 3.4.0 - 05-March-2026 =
* Tested: Compatible With WooCommerce 9.6
* Tested: Compatible With WordPress 6.7

= version 3.3.1 -22-October-2025 =
* Tested: Compatible With WooCommerce 10.3.0
* Tested: Compatible With WordPress 6.8.3
* Fixed: Security issue

= version 3.3.0 -03-September-2025 =
* Tested: Compatible With WooCommerce 10.1.2
* Tested: Compatible With WordPress 6.8.2

= version 3.2.9 -13-April-2024 =
* Tested: Compatible With WooCommerce 9.8.1
* Tested: Compatible With WordPress 6.7.2

= version 3.2.8 -12-October-2024 =
* Tested: Compatible With WooCommerce 9.3.3
* Tested: Compatible With WordPress 6.6.2


= version 3.2.7 -23-August-2024 =
* bugFix: fix sales analysis

= version 3.2.6 -22-August-2024 =
* bugFix: fix Profit summary issue

= version 3.2.5 -13-August-2024 =
* Tested: Compatible With WooCommerce 9.1.4
* Tested: Compatible With WordPress 6.6.1
* Compatible: compatible with woocommerce HPOS

= version 3.2.4 -12-March-2024 =
* Tested: Compatible With WooCommerce 8.6.1
* Tested: Compatible With WordPress 6.4.3

= version 3.2.3 -23-November-2023 =
* Tested: Compatible With WooCommerce 8.3.1
* Tested: Compatible With WordPress 6.4.1


= version 3.2.2 -28-August-2023 =
* Tested: Compatible With WooCommerce 8.0.2
* Tested: Compatible With WordPress 6.3

= version 3.2.1 -26-June-2023 =
* Tested: Compatible With WooCommerce 7.8.0
* Tested: Compatible With WordPress 6.2.2

= version 3.2.0 -12-June-2023 =
* Tested: Compatible With WooCommerce 7.7.2
* Tested: Compatible With WordPress 6.2.2
* Added: Product category stock value report

= version 3.1.9 -05-May-2023 =
* Tested: Compatible With WooCommerce 7.6.1
* Tested: Compatible With WordPress 6.2


= version 3.1.8 -20-February-2023 =
* Tested: Compatible With WooCommerce 7.4.0

= version  3.1.7 -27-December-2022 =
* Tested: Compatible With WooCommerce 7.2.2
* Tested: Compatible With WordPress 6.1.1

= version  3.1.6 -11-November-2022 =
* Tested: Compatible With WooCommerce 7.0.1
* Tested: Compatible With WordPress 6.1

= version  3.1.5 -03-September-2022 =
* Tested: Compatible With WordPress 6.0.2
* Added : Added mailto link in customer email in profit report

= version  3.1.4 -28-August-2022 =
* Tested: Compatible With WooCommerce 6.8.2


= version  3.1.3 -24-July-2022 =
* Tested: Compatible With WooCommerce 6.7.0
* Tested: Compatible With WordPress 6.0.1


= version  3.1.2 -28-May-2022 =
* Tested: Compatible With WooCommerce 6.5.1
* Tested: Compatible With WordPress 6.0

= version  3.1.1 -17-April-2022 =
* Tested: Compatible With WooCommerce 6.4.1
* Tested: Compatible With WordPress 5.9.3

= version  3.1.0 -20-March-2022 =
* Tested: Compatible With WooCommerce 6.3.1
* Tested: Compatible With WordPress 5.9.2

= version  3.0.9 -19-January-2022 =
* Tested: Compatible With WooCommerce 6.1.0
* Tested: Compatible With WordPress 5.8.3
* Added : Added new report current year vs previous  profit in analytical sales report

= version  3.0.8 -16-December-2021 =
* Tested: Compatible With WooCommerce 6.0.0
* Tested: Compatible With WordPress 5.8.2
* BugFix: Top 5 profit category


= version  3.0.7 -21-November-2021 =
* Tested: Compatible With WooCommerce  5.9.0
* Tested: Compatible With WordPress 5.8.2



= version  3.0.6 -29-September-2021 =
* Tested: Compatible With WooCommerce 5.7.1
* Tested: Compatible With WordPress   5.8.1
* BugFix : Internal bugfix

= version  3.0.5 -09-Aug-2021 =
* BugFix : Handle woocommerce decimal separator.

= version  3.0.4 -16-July-2021 =
* BugFix : Internal bugfix

= version  3.0.3 -16-July-2021 =
* BugFix :Fixed Net Profit Margin (%), if cost price and sales price empty

= version  3.0.2 -29-June-2021 =
* BugFix : Internal bugfix (This month sales and profit)

= version  3.0.1 -29-June-2021 =
* BugFix : Internal bugfix (Today and yesterday sales and profit)

= version  3.0.0 -24-June-2021 =
* Added : Add new UI
* Added : Add new search filter
* Added : Add new sort option
* BugFix : Internal bugfix
* Added : language translation (text domain :wooreportcog)


= version  2.4.2 -17-June-2021 =
* Added : Added filter first name and last name
* Tested: Compatible With WooCommerce 5.4.1
* Tested: Compatible With WordPress  5.7.2


= version  2.4.1 -25-April-2021 =
*Added : Added product cost columns
*Added : Added net profit margin (%) columns
*Added : Added net profit columns
*Added : Added profit percentage (%) columns
*Added : Added setting enable disable the product columns


= version  2.4.0 -12-March-2021 =
*Fixed : Add cost price only for product


= version  2.3.9 -12-March-2021 =
* Tested: Compatible With WooCommerce 5.1.0
* Tested: Compatible With WordPress 5.7


= version  2.3.8 -11-February-2021 =
* Added: Add last year profit
* Tested: Compatible With WooCommerce 5.0.0


= version  2.3.7 -18-January-2021 =
* Added: Added search option in add cost price
* Tested: Compatible With WooCommerce 4.9.0
* Tested: Compatible With WordPress 5.6

= version 2.3.6 -12-December-2020 =
* Tested: Compatible With WooCommerce 4.8.0
* Tested: Compatible With WordPress 5.6
* Added: add cost price, add admin notes, add profit columns


= version 2.3.5 -08-December-2020 =
* Added: Add columns regular price sales price in add cost price list

= version 2.3.4 -07-December-2020 =
* Tested: Compatible With WooCommerce 4.7.1
* Tested: Compatible With WordPress 5.5.3
* Added: Add option to add cost price

= version 2.3.3 -18-October-2020 =
* Tested: Compatible With WooCommerce 4.6.0
* Tested: Compatible With WordPress 5.5.1


= version 2.3.2 -20-August-2020 =
* BugFix: Internal BugFix


= version 2.3.1 -20-August-2020 =
* Tested: Compatible With WooCommerce 4.4.1
* Added: Option to set the custom cost of goods meta key


= version 2.3.0 -16-August-2020 =
* Tested: Compatible With WooCommerce 4.3.3
* Tested: Compatible With WordPress 5.5


= version 2.2.9 -17-July-2020 =
* Tested: Compatible With WooCommerce 4.3.0
* Tested: Compatible With WordPress 5.4.2
* Added: Print Profit Report

= version 2.2.8 -08-June-2020 =
* Tested: Compatible With WooCommerce 4.2.0
* Tested: Compatible With WordPress 5.4.1

= version 2.2.7 -11-April-2020 =
* Tested: Compatible With WooCommerce 4.0.1
* Tested: Compatible With WordPress 5.4

= version 2.2.6 -01-March-2020 =
* Tested: Compatible With WooCommerce 3.9.2


= version 2.2.5 -14-January-2020 =
* Added: Bulk product edit for cost of goods

= version 2.2.4 -01-January-2020 =
* Tested: Compatible With WooCommerce 3.8.1
* Tested: Compatible With WordPress  5.3.2

= version 2.2.3 -15-November-2019 =
* Tested: Compatible With WordPress 5.3

= version 2.2.2 -08-November-2019 =
* Tested: Compatible With WooCommerce 3.8.0
* Tested: Compatible With WordPress  5.2.4

= version 2.2.1 -26-September-2019 =
* Tested: Compatible With WooCommerce 3.7.0
* Tested: Compatible With WordPress 5.2.3


= version 2.2.0 -05-August-2019 =
* Tested: Compatible With WooCommerce 3.6.5
* Tested: Compatible With WordPress 5.2.2

= version 2.1.9 -09-June-2019 =
* Bug fixes: Internal changes

= version 2.1.8 -05-June-2019 =
* Added: Added cost of goods filed in Product quick edit.
* Tested: Compatible With WooCommerce 3.6.4
* Tested: Compatible With WordPress 5.2.1

= version 2.1.7 -18-May-2019 =
* Tested: Compatible With WooCommerce 3.6.3
* Tested: Compatible With WordPress 5.2

= version 2.1.6 -16-April-2019 =
* Tested: Compatible With WooCommerce 3.5.8


= version 2.1.5 -31-March-2019 =
* Tested: Compatible With WooCommerce 3.5.7
* Tested: Compatible With WordPress 5.1.1

= version 2.1.4 -24-February-2019 =
* Tested: Compatible With WooCommerce 3.5.5
* Tested: Compatible With WordPress 5.1

= version 2.1.3 -13-January-2019 =
* BugFix: Internal BugFix

= version 2.1.2 -30-December-2018 =
* Tested: Compatible With WooCommerce 3.5.3
* Tested: Compatible With WordPress 5.0.2

= version 2.1.1 -11-November-2018 =
* Tested: Compatible With WooCommerce 3.5.1

= version 2.1.0 -12-October-2018 =
* Tested: Compatible With WooCommerce 3.4.6

= version 2.0.9 -08-September-2018 =
* Tested: Compatible With WooCommerce 3.4.5
* Tested: Compatible With WordPress 4.9.8
* Tested: Added New Top profit product report

= version 2.0.8 -26-July-2018 =
* Tested: Compatible With WooCommerce 3.4.3


= version 2.0.7 -15-July-2018 =
* Tested: Compatible With WooCommerce 3.4.3
* Tested: Compatible With WordPress 4.9.7

= version 2.0.6 -15-June-2018 =
* Added: Added Hook

= version 2.0.5 -07-June-2018 =
* Tested: Compatible With WooCommerce 3.4.2
* Tested: Compatible With WordPress 4.9.6
* Added: Added Hook

= version 2.0.4 -08-May-2018 =
* Added: All report show base on the 'Pending','Processing','On-Hold' and 'Completed' order status.

= version 2.0.3 -29-April-2018 =
* Tested: Compatible With WooCommerce 3.3.5
* Tested: Compatible With WordPress 4.9.5
* Added: Added Billing Last Name

= version 2.0.2 -02-April-2018 =
* Tested: Compatible With WooCommerce 3.3.4

= version 2.0.1  -25-February-2018 =
* Tested: Compatible With WooCommerce 3.3.3
* Fixed: Cost of goods in wooCommerce product page style

= version 2.0 -14-February-2018 =
* Tested: Compatible With WooCommerce 3.3.1
* Tested: Compatible With WordPress 4.9.4
* Added: Added Billing First Name
* Added: No record found
* Added: Please wait while searching order

= version 1.9 -10-January-2018 =
* Added: Added Last 20 days filter

= version 1.8 -30-December-2017 =
* BugFix: Internal BugFix


= version 1.7-25-December-2017 =
* Tested: Compatible With WooCommerce 3.2.6
* Added: Cost of goods in wooCommerce product page


= version 1.6-10-December-2017 =
* Tested: Compatible With WooCommerce 3.2.5
* Tested: Compatible With WordPress 4.9.1


= version 1.5-19-November-2017 =
* Tested: Compatible With WooCommerce 3.2.4
* Tested: Compatible With WordPress 4.9

= version 1.4 - 05-November-2017 =
* Tested: Compatible With WooCommerce 3.2.3
* Tested: Compatible With WordPress 4.8.3
* Added : Profit and Loss Analysis

= version 1.3 - 12-September-2017 =
* Tested: Compatible With WooCommerce 3.2.2
* Tested: Compatible With WordPress 4.8.2


= version 1.2 - 19-June-2017 =
* Tested: Compatible With WooCommerce 3.0.8
* Tested: Compatible With WordPress 4.8

= version 1.1 - 05-April-2017 =
* Tested: Compatible With WooCommerce 3.0.0

= version 1.0 - 19-February-2017 =
* Initial release

== Upgrade Notice ==

= 3.4.5 =
Recommended for every store: fixes the Order Profit Report on legacy order storage, makes all reports MySQL strict-mode safe, restores PHP 7.4 support and fixes the date range filters.

== Disclaimer ==

The author is not responsible for any harm or wrongdoing this plugin may cause. Users are fully responsible for their own use. This plugin is provided WITHOUT warranty.
