Modules configuration and setup

Overview

In most cases modules need to be configured before you can proceed with setup and activate it. There are two ways of configuring modules:

  1. Configuring modules via admin interface

  2. The automatic deployment friendly way by Configuring modules via providing configuration files

@startuml
    start
    partition "Configuration   " {
        if (How?) then (Configure module via\nweb interface)
          :Configures module via WEB interface;
        else (Script based\nconfiguration)
          :Change values in configuration files;
        endif
        :Configuration file is updated;
    }
    partition "Setup   " {
        if (Action) then (Activate)
            :Execute on activate action/events;
        else (Deactivate)
            :Execute on deactivate action/events;
        endif
    }
    stop
@enduml

Configuration

Configuring modules via admin interface

To configure modules via admin interface, please open OXID eShop administration panel and got to Extensions ‣ Modules, you will see modules list, please select module you want to configure click Settings, you will see list of settings which is possible to change.

Entries in the settings list are loaded and saved in configuration files located in var/configuration/shops. For each shop id there is one directory with the complete configuration for the shop. So if the shop has id 1, a directory would be named 1. See the example below:

.
└── var
    └── configuration
        └── shops
           └──1
           └──2
           └── ...

Note

If var directory has not found in the project directory. composer update must be executed or it must created manually. Also, each shop must have their own separate directory.

Configuring modules via providing configuration files

Since the complete configuration is in configuration files, you can make it part of the VCS repository of your project and deploy it to your testing, staging and productive systems and deploy through the command line as described below in the section deploy module configurations.

Project configuration files are located in project directory var/shops/<shop-id>/, here “<shop-id>” represents Sub-shop ID. In case you don’t use Sub-shop functionality, it will always be only one directory.

Each directory with a shop configuration has class_extension_chain.yaml file with the module class extension chain and a separate subdirectory modules for module configurations, configuration for every module is in a separate file where filename is the module id: var/environment/<shop-id>/modules/<module-id>.yaml

.
└── var
    └── configuration
        └── shops
           └──1
                    └──class_extension_chain.yaml
                    └──modules
                      └──oepaypal.yaml
                      └──oegdproptin.yaml

Configuration might be different in different environment (testing, staging or productive). To solve this problem OXID eShop uses another directory with configuration files located in var/environment/<shop-id>/.

Example structure you can see bellow:

.
└── var
    └── configuration
        └── shops
           └──1
           └──2
           └── ...
        └── environment
           └──1
           └──2
           └── ...

Configuration files

These files contains information of all modules which are installed. During the installation process all of the information from module metadata.php is being transferred to the configuration files. For example you have OXID eShop without any modules, so var/configuration/shops/modules/ will be empty. When you will run installation let’s say for OXID eShop PayPal module, files in var/configuration/shops/ will be filled with information from metadata.php. An example of stripped down configuration file:

Example: var/configuration/shops/modules/1/oepaypal.yaml

id: oepaypal
path: oe/oepaypal
version: 6.0.0
activated: false
title:
  en: PayPal
description:
  de: 'Modul für die Zahlung mit PayPal.'
  en: 'Module for PayPal payment.'
lang: ''
thumbnail: logo.jpg
author: 'OXID eSales AG'
url: 'https://www.oxid-esales.com'
email: [email protected]
templates:
  order_paypal.tpl: views/admin/tpl/order_paypal.tpl
templateBlocks:
  -
    template: deliveryset_main.tpl
    block: admin_deliveryset_main_form
    file: /views/blocks/deliveryset_main.tpl
  -
    template: widget/sidebar/partners.tpl
    block: partner_logos
    file: /views/blocks/widget/sidebar/oepaypalpartnerbox.tpl

moduleSettings:
  blOEPayPalStandardCheckout:
    group: oepaypal_checkout
    type: bool
    value: true
  blOEPayPalExpressCheckout:
    group: oepaypal_checkout
    type: bool
    value: true
events:
  onActivate: '\OxidEsales\PayPalModule\Core\Events::onActivate'
  onDeactivate: '\OxidEsales\PayPalModule\Core\Events::onDeactivate'
controllers:
  oepaypalexpresscheckoutdispatcher: OxidEsales\PayPalModule\Controller\ExpressCheckoutDispatcher
  oepaypalstandarddispatcher: OxidEsales\PayPalModule\Controller\StandardDispatcher
classExtensions:
  OxidEsales\Eshop\Core\ViewConfig: OxidEsales\PayPalModule\Core\ViewConfig
  OxidEsales\Eshop\Application\Component\BasketComponent: OxidEsales\PayPalModule\Component\BasketComponent

Also the file with the module class extension chain will be generated.

Example: var/configuration/shops/1/class_extension_chain.yaml

OxidEsales\Eshop\Core\ViewConfig:
  - OxidEsales\PayPalModule\Core\ViewConfig