Extend the Spryker Core functionalityEdit on GitHub
To extend the Spryker Core functionality and to use the Spryker Engine to develop a project, you must understand the folder structure used in Spryker Commerce OS.
The project consists of two parts: Spryker Core and Project implementation. They both follow the same structure and the project implementation goes on top of the Spryker Core functionalities.
The following schema shows how a request is handled:
Project structure overview
The code is divided into three parts:
src/folder contains the code of the current project.
vendor/spryker/folder contains the Spryker OS.
vendor/spryker-eco/folder contains the Spryker Ecosystem modules, which are distributed separately from the core.
vendor/spryker-sdk/folder contains the development tools.
vendor/spryker-shop/folder contains the Shop App (Yves).
All projects, SprykerCore and SprykerEco parts follow a very similar directory structure:
For example, if
CustomerFacade is extended on the project side, it has the following locations and namespaces:
In Spryker Core:
On the Project layer:
As it can be observed from the preceding example, the location of the file reflects the namespace it’s located in.
SprykerEco modules can be treated as Spryker Core in the context of replacing.
Depending on where and how the code is intended to be used, it can be placed in one of the following folders:
Client: The code placed here handles communication between Yves and Zed.
Shared: The code placed here is used both by Yves and Zed (to avoid code duplication).
Zed: The code here is meant only for the backend application.
Yves: The frontend code.
Glue: The code placed here handles communication between Glue API and Client.
Each module contains one folder for every layer of the application:
Extending SprykerCore Functionality
To extend the functionality of a class from SprykerCore, a new class with the same name must be added to the corresponding location on the project side.
Replacement rules, described in the Extend the core document work for the next classes in the Spryker module:
The following example illustrates how
CategoryFacade can be extended on the project side:
class CategoryFacade extends AbstractFacade
use Spryker\Zed\Category\Business\CategoryFacade as SprykerCategoryFacade;
class CategoryFacade extends SprykerCategoryFacade
For submitting the form