# How to add products programmatically

```php
$post_id = 3537;
$module_id = 'Offer';

$products = [
    [
        'unique_id' => 'prod001',
        'title' => 'Wireless Headphones',
        'subtitle' => 'Crystal-clear sound with deep bass',
        'description' => 'High-quality wireless headphones with noise cancellation.',
        'img' => 'https://example.com/images/headphones.jpg',
        'url' => 'https://example.com/products/headphones',
        'orig_url' => 'https://example.com/products/headphones',
        'price' => 99.99,
        'priceOld' => 149.99,
        'currencyCode' => 'USD',
        'merchant' => 'ExampleStore',
        'badge' => 'Best Seller',
        'badge_color' => 'primary',
        'logo' => 'https://example.com/logos/examplestore.png',
        'ratingDecimal' => 4.5,
        'order' => '',
        'stock_status' => 1,
    ],
    [
        'unique_id' => 'prod002',
        'title' => 'Smart Watch',
        'subtitle' => 'Track your fitness in style',
        'description' => 'Fitness-focused smartwatch with heart rate monitor and GPS.',
        'img' => 'https://example.com/images/smartwatch.jpg',
        'url' => 'https://example.com/products/smartwatch',
        'orig_url' => 'https://example.com/products/smartwatch',
        'price' => 129.99,
        'priceOld' => 179.99,
        'currencyCode' => 'USD',
        'merchant' => 'TimeTech',
        'badge' => 'Hot Deal',
        'badge_color' => 'primary',
        'logo' => 'https://example.com/logos/timetech.png',
        'ratingDecimal' => 5,
        'order' => '',
        'stock_status' => 1,
    ],
    [
        'unique_id' => 'prod003',
        'title' => 'Bluetooth Speaker',
        'subtitle' => 'Powerful sound in your palm',
        'description' => 'Portable Bluetooth speaker with deep bass and waterproof design.',
        'img' => 'https://example.com/images/speaker.jpg',
        'url' => 'https://example.com/products/speaker',
        'orig_url' => 'https://example.com/products/speaker',
        'price' => 49.99,
        'priceOld' => 69.99,
        'currencyCode' => 'USD',
        'merchant' => 'SoundPro',
        'badge' => 'Editor\'s Pick',
        'badge_color' => 'primary',
        'logo' => 'https://example.com/logos/soundpro.png',
        'ratingDecimal' => 4.7,
        'order' => '',
        'stock_status' => 1,
    ],
];

\ContentEgg\application\components\ContentManager::saveData($products, $module_id, $post_id);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ce-docs.keywordrush.com/faq/how-to-add-products-programmatically.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
