# $productList->add()

> Adds a new product to the list.

- Source: `src/ProductList.php#L31` <https://github.com/wagnerwagner/merx/blob/2.0.0-alpha.11/src/ProductList.php#L31>

```php
$productList->add(Wagnerwagner\Merx\ListItem|array|string $data): Wagnerwagner\Merx\ProductList
```

## Parameters

| Name | Type | Default |
| --- | --- | --- |
| `$data` | `Wagnerwagner\Merx\ListItem\|array\|string` | `–` |

## Return type

`Wagnerwagner\Merx\ProductList`

## Description

```php
$productList->add('products/nice-shoes'); // ID of a ProductPage
$productList->add('page://L1cJEiOOQI3VzljV'); // UUID of a ProductPage
$productList->add(['key' => 'individual-shoes', 'page' => 'products/nice-shoes']); // Array including key
$productList->add(new ListItem(key: 'nice-socks', price: 10])); // Custom LitItem
```

## Parent class

`Wagnerwagner\Merx\ProductList`
