=== Materials Stock for Makers ===
Contributors: materialsstockformakers
Tags: woocommerce, inventory, bill of materials, raw materials, stock
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Raw material inventory and bills of materials for handmade WooCommerce shops. Deducts materials on orders and shows how many you can make.

== Description ==

WooCommerce tracks stock for finished products only. If you make what you sell — candles, soap, jewellery, cosmetics, food — you also need to know how much wax, oil, beads or flour you have left. Materials Stock for Makers adds a raw material inventory to WooCommerce and connects it to your products with a simple bill of materials (BOM).

**Materials**

* Add materials with a name, any unit you like (g, kg, ml, L, pcs, m…), current stock and an optional cost per unit.
* Manage them under WooCommerce > Materials: search, sort, edit, delete and bulk delete.
* Adjust stock manually (add, remove or set to a counted amount) with a reason. Every change is recorded in the stock history with date, user and related order.

**Bill of materials per product**

* On the product edit screen, list the materials and quantities needed to make one unit of a simple product.
* See instantly how many units you can make from current material stock.

**Automatic deduction on orders**

* When WooCommerce reduces stock for an order, the materials are deducted (quantity per unit × ordered quantity).
* When an order is cancelled or refunded, the materials are restored. Partial refunds with restocking restore the matching amount.
* Each order is deducted only once, and every change is atomic so simultaneous orders never miscount.
* Materials used are added as an order note.

**Makeable quantity**

* Optionally, per product, set the WooCommerce stock quantity to the number of units that can be made: the lowest of (material stock ÷ quantity needed). It updates automatically whenever material stock changes.

**Warnings**

* Materials at or below zero are highlighted in the list, counted on the menu and flagged in the product's bill of materials.

Compatible with WooCommerce High-Performance Order Storage (HPOS).

A Pro version adds bills of materials for each product variation, automatic material cost per product with a margin column in the products list, low-stock thresholds with a daily email alert, and CSV import and export of materials and stock history.

== Installation ==

1. Install and activate WooCommerce.
2. Upload the plugin folder to `/wp-content/plugins/` or install it from the Plugins screen, then activate it.
3. Go to WooCommerce > Materials and add your materials.
4. Edit a simple product and fill in the "Materials (bill of materials)" box.

== Frequently Asked Questions ==

= When are materials deducted? =

At the same moment WooCommerce reduces product stock for an order — usually when payment is received or the order is set to processing or completed.

= What happens if a material goes below zero? =

Orders are never blocked. The material is shown as out of stock so you know to restock. If you enable "makeable quantity" for a product, its stock becomes 0 and WooCommerce stops selling it.

= Can I turn off the automatic deduction? =

Yes, under WooCommerce > Materials > Settings.

= Does it work with variable products? =

The free version supports simple products. Bills of materials per variation are part of the Pro version.

= What is removed when I delete the plugin? =

All materials, bills of materials, stock history and plugin settings.

== Screenshots ==

1. Materials list with stock status.
2. Manual stock adjustment with reason and history.
3. Bill of materials on the product edit screen.
4. Stock history.

== Changelog ==

= 1.0.1 =
* Removed the product limit from the free version.
* Cleaner admin menu (no separate Contact Us item).

= 1.0.0 =
* First release.
