# `PhoenixKitEcommerce.ShippingMethod`
[🔗](https://github.com/BeamLabEU/phoenix_kit_ecommerce/blob/v0.1.8/lib/phoenix_kit_ecommerce/schemas/shipping_method.ex#L1)

Shipping method schema for E-Commerce module.

Supports weight-based, price-based, and geographic restrictions.

## Fields

- `name` - Method name (required)
- `slug` - URL-friendly identifier (unique, auto-generated)
- `description` - Method description
- `price` - Shipping cost
- `free_above_amount` - Free shipping threshold
- `min_weight_grams`, `max_weight_grams` - Weight limits
- `min_order_amount`, `max_order_amount` - Order amount limits
- `countries` - Allowed countries (empty = all)
- `excluded_countries` - Excluded countries
- `active` - Enabled/disabled
- `position` - Sort order
- `estimated_days_min`, `estimated_days_max` - Delivery estimate
- `tracking_supported` - Tracking available

# `active?`

Returns true if method is active.

# `available_for?`

Checks if this method is available for given cart parameters.

## Examples

    iex> available_for?(method, %{weight_grams: 500, subtotal: Decimal.new("50"), country: "EE"})
    true

# `calculate_cost`

Calculates shipping cost for given subtotal.
Returns 0 if free shipping threshold is met.

# `changeset`

Changeset for shipping method creation and updates.

# `delivery_estimate`

Returns estimated delivery string.

## Examples

    iex> delivery_estimate(%ShippingMethod{estimated_days_min: 3, estimated_days_max: 5})
    "3-5 days"

    iex> delivery_estimate(%ShippingMethod{estimated_days_min: 1, estimated_days_max: 1})
    "1 day"

# `free_for?`

Checks if shipping is free for the given subtotal.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
