OXID eShop Component

Note

Watch a short video tutorial on YouTube: Components & Services.

OXID eShop component is a simple way for a project to add reusable code to the application via Composer packages. You can write classes that have new or extended functionality and you may wire these classes together in your Composer package by using the Service Container.

In contrast to modules, components do not need to be activated but just installed by Composer.

How it works

On installation the OXID Composer plugin will include your components services.yaml file in a file named generated_services.yaml that is read when the DI container is assembled. You will find this file in var/generated but you should not alter it manually.

Component type

It’s necessary that component would have oxideshop-component type in composer.json file:

{
    "type": "oxideshop-component",
}

Installation

When requiring a package with Composer the OXID eShop Composer Plugin checks the package type. If the type is oxideshop-component then the package is installed as an OXID eShop component.

composer require vendor/package

During the installation the services.yaml file is imported into the Service Container. After that, the component is globally and permanent active.

Uninstallation

To uninstall a OXID eShop component, it’s necessary to execute Composer’s remove command:

composer remove vendor/package