$productList->add()
Adds a new product to the list.
$productList->add(Wagnerwagner\Merx\ListItem|array|string $data): Wagnerwagner\Merx\ProductList
Parameters
| Name | Type | Default |
|---|---|---|
$data |
ListItem or array or string |
- |
Return type
Description
$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