=== Saan Shipping Rules for WooCommerce ===
Contributors: andykr
Tags: woocommerce, shipping, shipping rules, shipping classes, capacity
Requires at least: 6.0
Tested up to: 7.0
Stable tag: 3.0.0
Requires PHP: 8.0
Requires Plugins: woocommerce
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Control which shipping methods appear at checkout based on the size and type of products in the cart, not by weight.

== Description ==

**Shipping Rules for WooCommerce** lets you define exactly which shipping methods are available depending on what is in the customer's cart. Instead of weight-based rules, it uses WooCommerce product shipping classes combined with capacity rules so you can model real-world constraints like "this shipping method fits up to 5 small parcels or 2 tubes, but not both at the same time."

**How it works:**

1. Define your shipping methods in WooCommerce (for example Standard or Express).
2. Create product shipping classes (for example Small, Large, Tube) and assign them to your products.
3. Create a rule here: give it a name and select which shipping methods it applies to.
4. Optionally add capacity rules: define how many items of each shipping class fit into this shipment.
5. Activate the rule. It applies as soon as all capacity constraints are met.
6. Optionally enable free shipping from a certain cart value.

**Features:**

* Rules based on product shipping classes and capacity, not weight
* Multiple shipping methods per rule
* Capacity rules per shipping class (for example max. 5 Small, max. 2 Tube)
* Drag and drop to reorder rules - the first matching rule wins
* Free shipping threshold that sets all allowed shipping methods in the matching rule to no cost
* Active and inactive toggle per rule with validation
* Inactive WooCommerce shipping methods shown with a clear label
* Multilingual: English, German (DE/CH), French (FR/CH), Italian (IT/CH)
* Clean admin UI integrated into the WooCommerce menu

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **WooCommerce -> Shipping Rules** to configure your rules.

Make sure you have at least one shipping zone with shipping methods configured in WooCommerce before creating rules.

== Frequently Asked Questions ==

= Does this work with weight-based shipping? =
No. This plugin controls shipping method availability based on product shipping classes and capacity (size/type), not weight.

= What happens if no rule matches? =
If no rule matches the cart contents, WooCommerce falls back to its standard shipping method display and all enabled methods for the customer's zone are shown.

= Can a rule have multiple shipping methods? =
Yes. You can assign multiple shipping methods to a single rule. All selected methods will be available at checkout when the rule applies.

= What are capacity rules? =
Capacity rules define how many items of a given product shipping class fit into a shipment. A rule only matches if every shipping class present in the package has a capacity rule defined, and none of the limits are exceeded.

= Is free shipping supported? =
Yes. You can define a cart value threshold. When reached, all allowed shipping methods in the matching rule are displayed at no cost.

== Screenshots ==

1. Overview of shipping rules - drag to reorder, toggle to activate or deactivate.
2. Rule details - rule name, shipping methods multiselect with inactive method labels.
3. Capacity rules expanded - define how many items per shipping class fit in this shipment.
4. Free shipping settings - enable and set the cart value threshold.
5. How-it-works guide - collapsible explanation with example, visible directly in the admin.
6. WooCommerce checkout - only the matching shipping methods are shown to the customer.

== Changelog ==

= 3.0.0 =
* Multilingual support: EN, DE (DE/CH), FR (FR/CH), IT (IT/CH)
* Inactive shipping methods shown with label in method selector
* Collapsible how-it-works guide with mixed-package example
* Drag and drop reordering with dashed insertion line
* Active and inactive toggle with validation (rule name and methods required)
* New rules default to inactive
* WooCommerce submenu integration
* Requires Plugins header for WooCommerce dependency
* Free shipping threshold
* Capacity rules per shipping class

== Upgrade Notice ==

= 3.0.0 =
Initial public release.
