Opencart Plugin

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

[to be completed with functionalities summary]

There are 3 simple steps for enabling the Filerobot plugin on your Opencart admin:
  • Obtain a Filerobot token (request it here)
  • Install the Filerobot module for Opencart
  • Add your security configuration parameters to access your Filerobot library
Limitation
  • Currently the Plugin supports the default WYSIWYG editor from Open cart - Summernote, but the native "Image resize" function is disabled. You can change the image size by removing the previous one then add it with new dimensions (original function will be added in the next version).

Installation

Step 1. Register for a demo if you don't already have a Filerobot account.

Photo alt \#responsive

Install the Filerobot module for Opencart

  • Step 1: Upload folder admin in upload/admin to your opencart source code
  • Step 2: Login to Admin Dashboard, Go to Extensions/Installers and upload file scaleflex_filerobot.ocmod.zip. Then go to Modification Click reload to update the Installer
  • Step 3: go to Extensions/Extensions, Choose Modules from drop-down -> Select Filerobot and update all configurations

    • Filerobot Token: Your Filerobot token from the Asset hub interface
    • Security Template Identifier: Security template ID, found in “Developers” top menu
    • Filerobot upload directory: Default /, this is the top storage folder for your assets.

      Please create the folder in Filerobot first to prevent error.

 \#responsive

Usage

Please enable the extension to use Filerobot in any pages

Step 1: Open FMAW

  • With Summernote:

 \#responsive

  • With Image(s) Field

Photo alt \#responsive

Step 2: Choose image(s), then click insert button

If you are on Summernote: 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.

Photo alt \#responsive

Developer's den

  • This extension is 100% compatible with the default theme.
  • If you use another theme or a custom development, you should verify that the image is indeed from filerobot (or not) before returning data to the view. Ex: For Banners

    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']
                    );
      }
    }