=== Stocktake – Physical Inventory Count for WooCommerce ===
Contributors: erenlabs
Tags: stocktake, stocktaking, inventory count
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.1.26
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Stocktake for WooCommerce: stock take with a barcode scanner or phone, blind counts, variance in units and money, apply with undo.

== Description ==

Stocktake for WooCommerce is a stock take and physical inventory count tool that runs inside the store you already have. Count with a barcode scanner — a USB or Bluetooth gun, or your phone camera — compare the shelf against what WooCommerce believes, review the variance in units and in money, and apply the corrected stock in one click, with an automatic backup and one-click undo.

The core is snapshot-based variance. When a session starts, expected quantities are recorded, so you can count while the store stays open and keep trading. As counted quantities come in, the difference to expected stock shows product by product. One click then adjusts WooCommerce stock to match; every apply is backed up first, so a single undo restores the previous levels.

Count the way the job needs: a full or zero-based count for year end, or a partial spot count and cycle count for the lines you check more often. Blind count hides the expected number so counters record what they find. The count screen runs in a phone or tablet browser — nothing to install — and a recognised barcode is counted on the spot while the cursor never leaves the scan box. Pause and resume at any time, export the count sheet to CSV, and see the variance value in real money when Cost of Goods data is set.

= Watch the whole plugin in one pass =

A real count end to end — scope it, scan to count, read the variance, apply it, undo it — then a tour of the Pro screens.

https://www.youtube.com/watch?v=NeEbjDATRIc

[Read the full documentation](https://erenlabs.net/stocktake-for-woocommerce/docs/) — scanning, blind counts, counting modes, variance review, restore points and the Pro reports.

= Free =

* Unlimited stocktake sessions, for counts of any size
* Full, zero-based, partial spot and cycle counts
* Scan to count by barcode, SKU or product name; phone-camera scanning (Beta)
* Blind count mode; pause and resume
* One-click apply with automatic backup and undo
* CSV export; reorder and low-stock shortlist; negative-stock warning
* Variance value in money with Cost of Goods data

= Pro =

Stocktake Pro adds quick stock check, tally and goods-in counting, restore-point history, valuation at retail and cost, ABC insights with a shrinkage trend, multiple counters with attribution, recount and approval, scheduled count reminders, printable count sheets, PDF reports, Excel export and priority support.

[Full feature comparison and pricing](https://erenlabs.net/stocktake-for-woocommerce/)

== Installation ==

1. Upload the `stocktake-for-woocommerce` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **Stocktake** in the admin menu and create your first session.

WooCommerce must be installed and active.

== Frequently Asked Questions ==

= How do I do a physical stock count in WooCommerce? =
Start a stocktake session, then enter counted quantities by scanning barcodes and SKUs or by typing them in. Stocktake compares your count against a snapshot of expected stock and shows the variance for each product. When you are finished, one click adjusts WooCommerce stock to match, and your previous levels are backed up automatically in case you need to undo. This replaces editing each product's stock quantity one by one.

= Can I count while the store is open, or do I have to close it? =
You can count while the store stays open. Stocktake records a snapshot of expected quantities when the session starts, so ongoing sales during the count are handled against that baseline. Partial spot counts and cycle counts also let you check sections of the catalogue without pausing trading.

= Why is my WooCommerce stock wrong or showing incorrect stock levels? =
System stock drifts from reality for many reasons, including caching, variable-product stock quirks, bad CSV imports, and concurrent sales. A physical stock count is the most reliable way to bring your records back in line with what is actually on the shelf. That is what a stocktake does: count, review the variance, and reconcile in one click — stock reconciliation you can hand to your accountant.

= What is a blind stock count and why would I use one? =
A blind count hides the system's expected quantity from the counter, so they record what they actually find rather than confirming the number on screen. This removes confirmation bias and produces a more honest count. Blind count is included free and can be toggled per session.

= How do I count inventory with a barcode scanner in WooCommerce? =
Connect a USB or Bluetooth barcode scanner and scan items to count them by barcode, SKU, or product name. Each scan counts the item on the spot. For smaller counts you can also use phone-camera barcode scanning, which is currently in Beta.

This is barcode inventory counting in the ordinary sense: the scanner types for you, and each scan counts the item on the spot.

= Can I use my phone camera as a barcode scanner to count stock? =
Yes, phone-camera barcode scanning is available as a Beta feature and works well for small counts. For counting hundreds of items, a dedicated USB or Bluetooth scanner is faster and more reliable, and both are fully supported.

= Is there a stocktake app I need to install on my phone? =
No. There is no separate app to download, and nothing to set up on each counter's device. The count screen is built to work in a phone or tablet browser: sign in to your store's admin on the device, open the running session, and start scanning. Because the counting happens in your own store rather than in a third-party app, the counted quantities never leave your site.

= How do I bulk update WooCommerce stock after a physical count? =
You do not need CSV round-trips or a bulk editor. After counting, one-click stock adjustment writes your counted quantities to WooCommerce. Before it applies, Stocktake backs up your current stock automatically, so a single undo restores the previous levels if something looks off.

= How do I see stock variance, and can it show inventory shrinkage in money? =
Stocktake shows the variance between counted and expected quantities for every product, and can express that variance in money when WooCommerce Cost of Goods data is set. Pro adds an accuracy and shrinkage trend so you can track how your count accuracy develops over time.

= Is this a stocktake tool or a stock management system? =

It is a stocktaking tool, not a stock control system. It will not raise purchase orders, hold supplier records, or run your stock day to day. It does one job properly: count what is physically on the shelf, show the variance against WooCommerce, and post the correction. If your stock already lives in WooCommerce, this is the stock take that keeps it honest.

= How often should I do a stocktake versus a full inventory count? =
A common approach is to cycle count high-value items frequently, count mid-value items periodically, and run a full physical count at your financial year end — 30 June in Australia, your accounting year end in the UK. Stocktake supports both full or zero-based counts and partial spot cycle counts, and Pro adds scheduled reminders to keep the rhythm.

= Can I pause and resume a stock count? =
Yes. You can resume an unfinished count at any time, so a large stocktake can span breaks, shifts, or multiple days without losing progress.

= What is the difference between a quick stock check and a full stocktake? =
A full stocktake is a session-based count of many products with variance review and a one-click apply. The Pro quick stock check is for one-off fixes: scan any single product, correct its live stock on the spot, and have the change recorded in an audit log. Use stocktakes for periodic counts and quick checks for spot corrections.

= Can multiple people count at the same time? =
Yes, in Pro. Multiple counters can work with their contributions attributed to them, and a recount and approval workflow lets a supervisor review before stock is applied.

= Can I value my inventory with this plugin? =
Yes. Pro inventory valuation reports the value of your stock at both retail and cost, with a per-category breakdown. In the free version you can also see variance value when WooCommerce Cost of Goods data is set.

= What can I export? =
The free version exports count results, variance, and the reorder or low-stock shortlist to CSV. Pro adds branded PDF count sheets and Excel (XLSX) export.

= Does it work with product variations? =
Yes — each stock-managed variation is counted as its own line. Scanning a variation's barcode (its SKU or the WooCommerce GTIN/UPC/EAN/ISBN field) counts that exact variation, and applying updates that variation's stock.

= Where can I find the documentation? =
Full documentation lives at [erenlabs.net/stocktake-for-woocommerce/docs](https://erenlabs.net/stocktake-for-woocommerce/docs/) — getting started, scanning and barcodes, blind counts, counting modes, variance review, applying stock safely, restore points, the Pro reports, and a troubleshooting section for the questions that come up most.

= Which barcodes are recognised? =
A scanned code is matched against the SKU first, then against WooCommerce's own GTIN / UPC / EAN / ISBN product field (WooCommerce 9.2+). Both work for products and variations.

= Which third-party libraries are bundled? =
This plugin bundles the ZXing barcode library (@zxing/library, MIT license,
https://github.com/zxing-js/library) at assets/js/vendor/zxing.min.js, used as a
fallback decoder for the phone-camera scanner when the browser has no native
BarcodeDetector. It is served locally and never loaded from a remote CDN.

= Does this plugin use any external services? =
This plugin uses the Freemius SDK (https://freemius.com) for optional usage
tracking and for licensing/updates of the separate Pro version. On first
activation you are shown an explicit opt-in screen; NOTHING is sent anywhere
unless you click "Allow & Continue" — choosing "Skip" keeps the plugin fully
functional with no data leaving your site. If you opt in, Freemius receives
basic site data (site URL, WordPress/PHP versions, plugin version, admin email)
to provide update notifications and support.
Freemius terms: https://freemius.com/terms/
Freemius privacy policy: https://freemius.com/privacy/

== Screenshots ==

1. All your stocktakes at a glance — start a count, resume an open one, and see the mode, progress, variance and value of every session.
2. Scan once — a recognised barcode is counted on the spot; correct any quantity on the editable list of what you just scanned.
3. Review every variance (expected vs counted, units and value), then apply the adjustments to WooCommerce in one click.
4. Free forever, Pro when you grow — the full Free vs Pro comparison (every Pro feature listed) and simple annual pricing.
5. Blind counts and phone-camera barcode scanning (Beta), for smaller counts without a handheld scanner.
6. An automatic restore point is saved before every apply — roll back any count at any time.

== Changelog ==

= 1.1.26 =
* Listing: the description now describes the stock take and inventory count workflow directly; the bundled-library and external-service notes moved to the FAQ.
* Fixed: Apply could time out on a large count; it now runs in batches.
* Fixed: a barcode the till could scan was not found during a count, and a variation's own SKU is now searchable in the count box.
* Fixed: the count screen could show a shortfall Apply would then refuse; the counted-quantity ceiling is enforced on the server as well.
* Fixed: a count the database refused was reported as saved; the scanner is now told, so the item can be scanned again.
* Fixed: Apply and Undo take the same lock, and Undo says when there was nothing to restore.
* Fixed: the per-category variance table now ignores forgotten extra rows, matching the summary.
* Improved: the phone-camera scanner keeps the screen awake, survives a tab switch, closes on Escape and no longer closes on a stray tap.
* Improved: a variation is valued at the cost its parent carries, and a cost typed here is shared with sibling Eren Labs plugins.
* Fixed: uninstall removes every option and finishes on multisite and with an object cache; other plugins' notices are hidden on Stocktake screens rather than removed.
* Updated: bundled ZXing decoder 0.23.0. The Free vs Pro comparison and the upgrade page meet WCAG AA contrast.
* Tested with WooCommerce 11 and WordPress 7.1.


= 1.1.25 =
* Fixed: an undo that could not restore every product still reported plain
  success. If a product was deleted between applying a stocktake and undoing it,
  the screen showed a green "Reverted N products" and said nothing about the ones
  it could not reach. The restore point was always kept so the undo could be
  retried — but nobody was told to retry it. The session screen now names the
  products that could not be restored and says the restore point is still there.
* Fixed: a full (zero-based) count could set a product to 0 that nobody counted.
  Scanning an item that was outside the count's scope adds it to the session; if
  the counter then removed that count with the ✕, the line stayed behind as
  "not counted", and a full count treats not-counted as zero. Lines added during
  a count are now exempt from that rule — removing their count means "forget this
  line", never "this line is empty".

= 1.1.24 =
* Fixed: stock variances were valued at the retail price instead of the cost
  price on stores that record cost in WooCommerce's own Cost of Goods field.
  WooCommerce treats that field as internal meta and hands back nothing while
  the Cost of Goods feature is switched off, so the plugin fell through to the
  shelf price without saying so — while the Valuation report, which reads the
  database directly, showed the true cost. Same product, two different costs
  depending on the screen. Cost is now read the same way in both places, and a
  variation with no cost of its own inherits the parent's.
* Fixed: creating a stocktake logged two "called incorrectly" notices per
  product on sites with debugging enabled. That was the same root cause and is
  now silent.

= 1.1.23 =
* Compatibility: verified against WooCommerce 10.9 and WordPress 7.0. The
  "WC tested up to" header now reads 10.9, so the incompatibility notice no
  longer appears on up-to-date stores.
* Listing: added a walkthrough video and a link to the full online
  documentation, so the answers to the common setup questions are one click
  away instead of a support ticket.
* No functional changes to the plugin itself.

= 1.1.22 =
* The plugin is now listed as "Stocktake – Physical Inventory Count for
  WooCommerce" — the same plugin and the same install; only the display name
  is clearer about what it does. Listing and documentation refreshed.
* No functional changes.

= 1.1.21 =
A ground-up rework of the counting screen for real, non-stop scanning.

* One-scan counting: a recognised barcode — or a name-search pick, or a camera
  read — is counted the instant it resolves. No quantity prompt, no dialog, the
  cursor never leaves the scan box, so you scan one item after another at the
  pace of the scanner. First scan counts 1.
* Scan the same product again and it adds on top, in every mode, with a clear
  "5 + 1 = 6" note so an accidental double-scan can never pass unnoticed.
* Corrections moved to a big, editable panel for the item you just counted plus
  an editable list of recent scans: adjust a quantity with the +/− stepper
  (saved automatically) or remove a line entirely. No need to touch the screen
  at all if the default of 1 is right.
* A product that isn't in this count's list is simply added and counted when you
  scan it (you're holding it, after all) — with a quiet note, never a pop-up.
  A code that matches no product shows an inline message with the scanned code.
* Hardware scanners are recognised even when the cursor sits in a quantity
  field, and a barcode-sized quantity is refused — a stray scan is treated as
  the next item, not saved as a count.
* New REST endpoint and audit-log event for removing a count (Pro's session
  history shows these as "Count removed").
* Reliability: live-count reads are never served from a cache, and rapid or
  overlapping scans are processed in order so no count is lost or double-counted.

= 1.1.20 =
* Fix: the bundled ZXing barcode library is back in the package — a packaging
  step had been leaving assets/js/vendor/ out of the zip, which broke the
  phone-camera scanner's fallback decoder on iOS.
* Directory housekeeping for WordPress.org: escapes all admin output through
  wp_kses(), prepares every database query with placeholders, uses a more
  distinct internal PHP namespace, and drops directory image files and build
  metadata from the plugin package.
* Every Pro-only engine — the approval workflow, presets, scheduled
  reminders, stock-check access layer and the Pro report helpers — now ships
  exclusively in the separately distributed Pro build.


= 1.1.19 =
* Fix: Excel exports now declare a default cell style, so strict readers
  (e.g. openpyxl) no longer warn about a missing default style. The files
  always opened correctly in Excel; this makes them fully standard.
* Fix: a cancelled stocktake now shows "View" instead of "Count" in the list.
* Fix: the phone-camera scanner shows a clear message when the camera can't
  start (unsupported browser or insecure context) instead of doing nothing.


= 1.1.18 =
* WordPress.org review compliance: the free plugin now contains no Pro code
  at all — Pro-only counting modes and cost valuation live exclusively in
  the separately distributed Pro build (nothing is locked or gated).
* All admin JavaScript is enqueued via wp_enqueue_script (no inline tags).
* Documents the optional Freemius opt-in under "External services".


Older releases: see the changelog.txt file shipped with the plugin.
