> For the complete documentation index, see [llms.txt](https://docs.scaleflex.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scaleflex.com/digital-asset-management-dam/plugins-and-connectors/plugins/opencart/opencart-v4.md). Agents can also search and read this documentation through its [MCP server](https://docs.scaleflex.com/~gitbook/mcp).

# Opencart (v4)

DAM x Opencart v4 plugin

The DAM Plugin is an extension which adds Asset Management to Opencart.

There are 3 simple steps for enabling the DAM plugin on your Opencart admin:

* Obtain a DAM token (request it [here](https://www.scaleflex.com/request-a-demo));
* Install the DAM module for Opencart;
* Add your security configuration parameters to access your DAM library.

### Installation <a href="#od_a4f55725" id="od_a4f55725"></a>

#### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

[Register for a demo](https://www.scaleflex.com/request-a-demo) if you don't already have a DAM account.

#### Step 1: Upload the plugin <a href="#step-1-upload-the-plugin" id="step-1-upload-the-plugin"></a>

* Login to **Admin Dashboard**
* Go to Extensions > Installer and upload the file **filerobot.ocmod.zip**
* Install DAM plugin

![](https://docs.scaleflex.com/~gitbook/image?url=https%3A%2F%2F3586816136-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fl0Yvbyw1t10jWRzoi0FW%252Fuploads%252FXNamemFRHGrLgJG9j8De%252Fimage.png%3Falt%3Dmedia%26token%3Daf9f3dbc-5a9e-44eb-b396-76195c07bcf9\&width=768\&dpr=4\&quality=100\&sign=76798cf4\&sv=1)

#### Step 2: Configure and activate the plugin <a href="#step-2-configure-and-activate-the-plugin" id="step-2-configure-and-activate-the-plugin"></a>

Navigate to *Extensions/Extensions*, choose *Modules* from the drop-down menu, select *Filerobot* and update all configurations.

* **DAM Token:** Your DAM token from the Asset Hub interface;
* **Security Template Identifier:** Security template ID, found in the *Project > Access > Security templates* tab;
* **DAM upload directory:** This is the top storage folder for your assets.

{% hint style="info" %}
*Please create the folder in DAM first to prevent errors.*
{% endhint %}

<figure><img src="https://docs.scaleflex.com/~gitbook/image?url=https%3A%2F%2F3586816136-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fl0Yvbyw1t10jWRzoi0FW%252Fuploads%252FGZwBos1eXGr0KSQ7TrWL%252Fimage.png%3Falt%3Dmedia%26token%3Da0944f3d-2354-4416-94bd-74ac062034ce&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=76b78dd7&#x26;sv=1" alt=""><figcaption></figcaption></figure>

### Usage <a href="#od_687683f1" id="od_687683f1"></a>

You need to enable the extension in order to use DAM in all pages.

#### **Step 1: Open MAW (Media Asset Widget)** <a href="#step-1-open-fmaw-filerobot-media-asset-widget" id="step-1-open-fmaw-filerobot-media-asset-widget"></a>

With Ckeditor:

![](https://docs.scaleflex.com/~gitbook/image?url=https%3A%2F%2F3586816136-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fl0Yvbyw1t10jWRzoi0FW%252Fuploads%252FPoJbnmxH9FpnkQeeHJ26%252Fimage.png%3Falt%3Dmedia%26token%3Dc3f5a5d3-114f-4372-bc34-c2a9b88e02ff\&width=768\&dpr=4\&quality=100\&sign=c56d35fd\&sv=1)

With Image field:

<figure><img src="https://docs.scaleflex.com/~gitbook/image?url=https%3A%2F%2F3586816136-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fl0Yvbyw1t10jWRzoi0FW%252Fuploads%252FlRhzTsj1mz7f3GxW7KmD%252Fimage.png%3Falt%3Dmedia%26token%3D57d10454-3254-4156-9fb2-f09deeb9259f&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=902f6dc1&#x26;sv=1" alt=""><figcaption></figcaption></figure>

#### **Step 2: Choose the image(s), then click insert button** <a href="#step-2-choose-the-image-s-then-click-insert-button" id="step-2-choose-the-image-s-then-click-insert-button"></a>

If you are on Ckeditor: You can select multiple images for insertion.

If you are in an Image Field: You should select only one. If you selected multiple items, it will use the last one, as Opencart's Image Field inserts only one image at a time.

<figure><img src="https://docs.scaleflex.com/~gitbook/image?url=https%3A%2F%2F3586816136-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fl0Yvbyw1t10jWRzoi0FW%252Fuploads%252FlXT76GMWmc7v3q93CMIe%252Fimage.png%3Falt%3Dmedia%26token%3D9cabf541-7fa5-4291-a07b-dac46e08a798&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=9a7274a5&#x26;sv=1" alt=""><figcaption></figcaption></figure>

### Developer's den <a href="#od_f8f03ba2" id="od_f8f03ba2"></a>

This extension is 100% compatible with the default theme.

If you use another theme (stock or custom), you should verify that the image is indeed from DAM before returning data to the view. An examples for banners would be:

Copy

```
foreach ($banner_images as $key => $value) {
    foreach ($value as $banner_image) {
                if (strpos($banner_image['image'], 'filerobot')) { // Check if image URL contain "filerobot"
                    $data['banner_images'][$key][] = array(
                        'title'      => $banner_image['title'],
                        'link'       => $banner_image['link'],
                        'image'      => $banner_image['image'],
                        'thumb'      => $banner_image['image'] . '&width=100&height=100', // return with dimensions
                        'sort_order' => $banner_image['sort_order']
                    );
                } else {
                    if (is_file(DIR_IMAGE . $banner_image['image'])) {
                        $image = $banner_image['image'];
                        $thumb = $banner_image['image'];
                    } else {
                        $image = '';
                        $thumb = 'no_image.png';
                    }

                    $data['banner_images'][$key][] = array(
                        'title'      => $banner_image['title'],
                        'link'       => $banner_image['link'],
                        'image'      => $image,
                        'thumb'      => $this->model_tool_image->resize($thumb, 100, 100),
                        'sort_order' => $banner_image['sort_order']
                );
  }
}
```
