> 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/specifications.md).

# Specifications

## Watch The Video Tutorial

{% embed url="<https://youtu.be/hzOKVNO5VnA>" %}

### 1: Introduction

Specifications are **global field definitions** — you create a field once here, and it becomes available on every rental product's edit screen under **Advanced Settings → Specifications**. Each product then fills in its own value for each spec field.

{% hint style="warning" %}
Examples of typical specification fields: Seats (number), Fuel Type (select), Transmission (radio), Air Conditioning (checkbox), Color (color), Manufacturer Year (number), Brochure (file).
{% endhint %}

### 2: How It Works

| Step                       | Where                                             | What happens                                                                                                                          |
| -------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| **1. Define fields**       | BRW → Specifications                              | Create spec field definitions (type, name, label, options, etc.)                                                                      |
| **2. Fill per product**    | Product Edit → Advanced Settings → Specifications | Each product gets an input for every enabled spec field; admin fills in the value                                                     |
| **3. Display on frontend** | Single product page / Card template               | Enabled specs with values are shown in the product's specifications section. Fields with *Show in Card* also appear in listing cards. |

### 3: Specifications List — Table Columns

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

| Column        | Description                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------------------------------ |
| **Checkbox**  | Select for bulk actions. "Select all" checkbox in header/footer selects all rows.                            |
| **Type**      | Field type (text, number, select, etc.). Also stored in a hidden field used during operations.               |
| **Name**      | The internal slug/key of the field. Unique, lowercase, no spaces. Used as the array key in storage.          |
| **Label**     | The human-readable display name shown to admins (in the product edit screen) and optionally on the frontend. |
| **Icon font** | CSS class for an icon (e.g. `flaticon-users`) displayed alongside the spec on the frontend.                  |
| **Enable**    | Green checkmark (✓) = enabled; blank = disabled. Disabled specs are visually greyed out in the list.         |
| **Actions**   | Edit, Delete, Visibility toggle (👁 = disable / 🚫 = enable), Drag handle (⣿) for reordering.                |

#### 3.1 Bulk Actions

Four buttons at the top of the page operate on selected (checked) rows.

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

| Button      | Action           | Behavior                                                                                                                                                                           |
| ----------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Add new** | Open add popup   | Opens the Add Specification popup modal. Does not require any selection.                                                                                                           |
| **Delete**  | Delete selected  | Removes all checked specification definitions. Irreversible — does NOT prompt for confirmation. Product meta values for deleted specs remain in the DB but are no longer rendered. |
| **Enable**  | Enable selected  | Sets `enable = 'on'` for all checked specs. Enabled specs appear in product edit screens.                                                                                          |
| **Disable** | Disable selected | Sets `enable = ''` for all checked specs. Disabled specs are hidden from product edit screens and frontend display.                                                                |

#### 3.2 Row Actions

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

**Edit**

* Opens the Edit popup modal pre-filled with the field's current values. All fields are editable including Name (slug) — renaming a spec updates all references to the old name in the global options array.

**Delete**

* Deletes this single specification immediately (no confirmation prompt). Submits the form with `action = delete` and the field name.

**Visibility Toggle**

* Toggles a single spec between enabled (👁 active, 🚫 hidden) and disabled (🚫 active, 👁 hidden). Disabled rows appear greyed out. AJAX-saves without page reload.

**Drag & Drop Reorder**

* Grab the drag handle (⣿) to drag rows up or down. The new order is saved automatically via AJAX on drop. The display order on the frontend follows the order in this list.

### 4: Add / Edit Popup — All Fields

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

**Select Type -** <mark style="color:$danger;">Required</mark>

* Dropdown with 11 field types. Determines which input control is rendered in the product edit screen and what the Default field looks like. See **Field Types** section for full details.

  Changing the type on an existing spec (Edit) re-renders the popup form instantly. Changing from a type with Options (radio/checkbox/select) to one without hides the Options table.

**Name -** <mark style="color:$danger;">Required</mark>

* Internal identifier / array key. Rules: **unique**, **lowercase only**, **no spaces** (use underscore:
* When editing, if you change the name, the plugin renames the key in the global spec array (all product meta values previously stored under the old name become orphaned — update product meta manually if needed).

**Label -** <mark style="color:$danger;">Required</mark>

* Display name shown to admins in the product edit screen and, when **Show label** is checked, on the frontend product page next to the spec value.

**Options**

* Appears only for types: Radio Checkbox Select. A sortable mini-table of option values. Each row has a text input, a **+** button (add row below), an **×** button (remove row), and a drag handle to reorder options.

  At least one option is required for these types.

**Icon font -** <mark style="color:$success;">Option</mark>

* A CSS class string for an icon font (e.g. `flaticon-users`, `brwicon2-seat`). Find icon class [here](/brw/basics/icons.md)

**Default -** <mark style="color:$success;">Option</mark>

* A pre-filled default value for this spec on every product that hasn't set it manually. The input type varies by field type:
*

```
| Type                               | Default input                                                                    |
```

```
| ---------------------------------- | -------------------------------------------------------------------------------- |
| Text Tel                           | Text input                                                                       |
| Link                               | URL input (`type="url"`), placeholder `https://example.com`                      |
| Number                             | Number input                                                                     |
| Email                              | Email input                                                                      |
| Color                              | Color picker (`type="color"`)                                                    |
| Date                               | Date picker (BRW datepicker widget)                                              |
| File                               | "Add file" button opening WP Media Library; stores attachment ID in hidden field |
| <p>Radio<br>Checkbox<br>Select</p> | Text input (free-text default; per-product selection overrides)                  |
```

**Class -** <mark style="color:$success;">Option</mark>

* Extra CSS class added to the spec wrapper element on the frontend. Use for custom styling or JavaScript targeting.

**Field Types**

11 input types are available. The type controls both how the value is entered in the product edit screen and how it is displayed on the frontend.

| Type     | Product Edit Input                            | Use Case                                             | Options needed |
| -------- | --------------------------------------------- | ---------------------------------------------------- | -------------- |
| Text     | Single-line text input                        | Short labels, model names, descriptions              | —              |
| Link     | URL input (`type="url"`)                      | Brochure URL, manual PDF link                        | —              |
| Number   | Number input                                  | Seats, doors, horsepower, year                       | —              |
| Tel      | Telephone input (`type="tel"`)                | Contact/support number                               | —              |
| Email    | Email input (`type="email"`)                  | Contact email for vehicle manager                    | —              |
| Radio    | Radio button group                            | Transmission (Auto / Manual), Fuel type (one choice) | ✓ Required     |
| Checkbox | Checkbox group                                | Features (AC, GPS, Child seat — multiple)            | ✓ Required     |
| Select   | Dropdown (optionally multi-select)            | Color, Body type, Category                           | ✓ Required     |
| Date     | Date picker                                   | Registration date, Last service date                 | —              |
| Color    | Color picker (`type="color"`)                 | Vehicle exterior color swatch                        | —              |
| File     | WP Media Library picker; stores attachment ID | User manual PDF, spec sheet                          | —              |

{% hint style="warning" %}
The **Select** type has an extra **Multiple** checkbox in the popup. When checked, the select renders as a multi-select (`multiple` attribute) allowing admins to pick several values per product.
{% endhint %}

{% hint style="info" %}
Add custom types with the filter `ovabrw_specification_get_types`. The filter receives the types array and must return it with your additions.
{% endhint %}

**Status Flags:** Three checkboxes at the bottom of the Add/Edit popup control display behavior.

* **Enable:** When checked : the spec appears in the product edit screen's Specifications panel, and is included in frontend output. When unchecked: completely hidden from both admin and frontend.
* **Show label:** When checked: the **Label** text is displayed alongside the spec value on the frontend (e.g. "Seats: 5"). When unchecked: only the value is shown (e.g. just "5" with its icon).
* **Show in Card template:** When checked: the spec (and its value) is also displayed on the compact **Card** view (product listing cards / archive cards). When unchecked: the spec appears only on the full single-product page.

### 5: Product-level Specifications

#### Show Specifications in Categories

You can show all specifications or some separate specifications for each category

First, Go to **Products >> Categories**. Then, click a category you want to add  specifications for, go to: **Choose Specifications**&#x20;

<figure><img src="/files/05yJ2WCamHyyiUCDMNUM" alt=""><figcaption><p>Specifications in category setting.</p></figcaption></figure>

* Choose "**All**" if you like to add all specifications for the category
* Choose "**Other Specifications**" if you want to add some separate specifications for the category.&#x20;

#### Step 3: Set Specifications for a Product

When you choose a category for product, the all Specifications of category will be displayed in product.

**Example** : If you create "Car" category with All Specifications, you will see all Specifications in product

<div><figure><img src="/files/8cOiz6VBdxqHqZErP4sm" alt=""><figcaption></figcaption></figure> <figure><img src="/files/atubs4lGj1PXNftxxlbd" alt=""><figcaption></figcaption></figure></div>

**Example 2**: If you create Car category with some Specifications, you will see some Specifications in product.&#x20;

Note: You have to save product then edit product again to see specifications.

<div><figure><img src="/files/S9wOwC1DKKSlLVrr9fXa" alt=""><figcaption></figcaption></figure> <figure><img src="/files/HEnRUWp3jmUvWjesDk2r" alt=""><figcaption></figcaption></figure></div>

#### Display Specifications in Front-end

<figure><img src="/files/LMQzOZSYw9jCxbtkN8UB" alt=""><figcaption><p>Product Detail template</p></figcaption></figure>

### 6: PHP Filters

| Filter Hook                                | Description                                                                                                     |
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| `ovabrw_specification_get_types`           | Add or remove field types from the Type dropdown. Receives and must return the types array (`[slug => label]`). |
| `ovabrw_submenu_specifications_capability` | Change the required WordPress capability to access the Specifications page. Default: `edit_posts`.              |
| `ovabrw_before_popup_add_specification`    | Action fired inside the Add popup form before the standard fields. Receives `$action, $type, $name`.            |
| `ovabrw_after_popup_add_specification`     | Action fired inside the Add popup form after the standard fields (before status checkboxes).                    |
| `ovabrw_before_popup_edit_specification`   | Action fired inside the Edit popup form before the standard fields.                                             |
| `ovabrw_after_popup_edit_specification`    | Action fired inside the Edit popup form after the standard fields.                                              |
