> For the complete documentation index, see [llms.txt](https://ovatheme.gitbook.io/brw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ovatheme.gitbook.io/brw/brw-menu/manage-vehicle.md).

# Manage Vehicle

### 1: Introduction

The **Vehicle** custom post type represents a named, individual rental unit within your inventory. Unlike the simple stock quantity counter ("Automatically" mode), vehicles allow you to assign each booking to a specific named unit — useful when you need to track which exact car, room, boat, or bicycle a customer has.

{% hint style="info" %}
Vehicles are only required when the product's **Inventory → Control inventory** is set to **Manually**. If you use the default **Automatically** mode, stock is managed by a simple count and you don't need to create Vehicle posts.
{% endhint %}

### 2: How It Works

{% stepper %}
{% step %}
Create Vehicle posts

BRW → Manage Vehicle

{% endstep %}

{% step %}

### Assign to product

Product → Inventory → Choose Vehicles
{% endstep %}

{% step %}

### Customer selects

Booking form: Vehicle ID dropdown
{% endstep %}

{% step %}

### Stored in booking

Order meta: assigned vehicle ID
{% endstep %}
{% endstepper %}

| Step                         | Where                                        | What happens                                                                                                        |
| ---------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| **1. Create vehicles**       | BRW → Manage Vehicle → Add new vehicle       | Create one post per physical unit: set a unique ID, optionally assign a fixed location and unavailable time period. |
| **2. Set product to Manual** | Product Edit → Advanced Settings → Inventory | Set **Control inventory** to **Manually**. The *Choose Vehicles* multi-select appears.                              |
| **3. Assign vehicles**       | Product Edit → Inventory → Choose Vehicles   | Select one or more Vehicle IDs. These are the units available for this product.                                     |
| **4. Customer chooses**      | Single product page booking form             | A *Vehicle ID* dropdown appears instead of a quantity selector. Customer picks their unit.                          |
| **5. Booking saved**         | WooCommerce order meta                       | The selected Vehicle ID is stored in order item meta, visible in the admin booking detail.                          |

### 3: Vehicle List Page

The list page shows all Vehicle posts using WordPress's standard CPT list table. Each row represents one vehicle unit.

BRW -> Manage Vehicles

<figure><img src="/files/Qiir3STxN9TJtk4ztLT4" alt=""><figcaption></figcaption></figure>

| Column     | Description                                                                                                                             |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **Title**  | The vehicle's display name. Used as the human-readable label in admin lists. Does not need to match the Vehicle ID slug. Click to edit. |
| **Author** | WordPress user who created the Vehicle post. Standard WP column.                                                                        |
| **Date**   | Publish date of the Vehicle post. Standard WP column.                                                                                   |

{% hint style="info" %}
The Vehicle CPT supports `title` and `author` (no thumbnail, no editor). Bulk actions (Move to Trash) and search are standard WordPress list table features.
{% endhint %}

### 4: Add New Vehicle

Creating a vehicle requires a Title and a unique Vehicle ID. The Settings meta box below the title field contains all BRW-specific configuration.

<figure><img src="/files/PLV600lDBM4Q6ASc7OPQ" alt=""><figcaption></figcaption></figure>

#### Vehicle ID (Unique)

A unique text identifier for this vehicle unit (e.g. `car-001`, `room-101`, `bike-5`). This is the key used throughout the system to reference this specific unit.

**Auto-generated:** If left blank on save, the Vehicle ID is automatically generated from the post Title using (lowercase, hyphens instead of spaces).

**What it populates:** The ID appears in the product's *Choose Vehicles* multi-select, in the customer-facing *Vehicle ID* dropdown on the booking form, and in the completed booking detail.

{% hint style="info" %}
Keep IDs short and descriptive. Examples: `camry-01`, `suite-201`, `kayak-red`. Avoid spaces — the system auto-sanitizes but it's best to be explicit.
{% endhint %}

#### Require Location

Radio buttons: **Yes** or **No** (default). When set to **Yes**, this vehicle requires a specific pickup/dropoff location to be selected before it can be booked.

Works in conjunction with the **Vehicle location** field below — if a vehicle has a fixed location and *Require Location* is Yes, the system enforces that the booking location matches.

#### Vehicle Location

A dropdown populated from Location CPT posts. Assigns a fixed home location to this vehicle unit — e.g. which depot, branch, or lot this vehicle lives at.

Used by the availability system to filter available vehicles by pickup/dropoff location. If a customer selects "Airport Terminal 1" as pickup and a vehicle's fixed location is "City Center", it may be excluded depending on the rental type's location matching logic.

{% hint style="info" %}
Locations must be created in **BRW → Manage Locations** first, before they appear in this dropdown.
{% endhint %}

#### Unavailable Time

A date–time range during which this specific vehicle is **not available** for booking — for maintenance, private reservation, seasonal closure, etc.

{% hint style="warning" %}
Only **one** unavailable time range per vehicle is supported. If you need multiple blocked periods for the same vehicle, consider creating multiple Vehicle posts (e.g. `car-001-a`, `car-001-b`) or blocking through the Booking Calendar.
{% endhint %}

### 5: Product Inventory Integration

Vehicles are connected to products through the **Advanced Settings → Inventory** panel on the WooCommerce product edit page.

<figure><img src="/files/SCTBYIbHPDuHYRackk76" alt=""><figcaption></figcaption></figure>

| Option              | Behavior                                                                                                                                                                                        |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Automatically**   | Stock managed by a simple count (*Stock quantity*). Customers select a quantity 1–N. No Vehicle posts needed.                                                                                   |
| **Manually**        | Each unit is represented by a Vehicle post. The *Choose Vehicles* multi-select (below) appears. Customers pick a specific Vehicle ID from a dropdown on the booking form instead of a quantity. |
| **Choose Vehicles** | A multi-select listing all published Vehicle posts                                                                                                                                              |

{% hint style="info" %}
For the **Hotel** rental type, only "Automatically" is available — the Manually option is hidden because hotel room management works differently (rooms are typically quantity-based by room type).
{% endhint %}

### 6: Booking Form — Vehicle ID Dropdown

When a product uses **Manually** inventory, the standard quantity input on the booking form is replaced by a **Vehicle ID** dropdown.

| Mode                        | Booking form shows                                                |
| --------------------------- | ----------------------------------------------------------------- |
| **Automatically**           | Quantity input , min 1, max = stock count)                        |
| **Manually**                | Vehicle ID dropdown (select from assigned vehicles)               |
| **Appointment** rental type | Always shows Quantity input (regardless of manage\_store setting) |

<div><figure><img src="/files/QZTjpaMeszwO8n7CRA33" alt=""><figcaption></figcaption></figure> <figure><img src="/files/lN5VbPRkf0pESJcYnLcP" alt=""><figcaption></figcaption></figure></div>

{% hint style="warning" %}
The Vehicle ID select field is rendered in the booking form. The AJAX availability check also considers each vehicle's unavailable time range — vehicles in their blocked period are excluded from available options.
{% endhint %}

### 7: Manage Vehicles in Backend

* See the corresponding vehicle for each order in Booking List ( go to: **BRW >> Manage Booking** )

<figure><img src="/files/abMXEOB5UDJx8E85BaaS" alt=""><figcaption></figcaption></figure>

* Quickly find Orders by vehicle ( go to: **BRW >> Manage Booking** )

<figure><img src="/files/OjGAsXqpEBM4Uc3n0l8q" alt=""><figcaption></figcaption></figure>

* View Vehicle ID in Order Details

<figure><img src="/files/3AKpyYtHtqp6gwKRwjqD" alt=""><figcaption></figcaption></figure>

* Check Available Vehicle IDs of any product in any time

<figure><img src="/files/iLWLYFZyX64MVlj80uZL" alt=""><figcaption></figcaption></figure>
