config.xml
file that describes your configuration options. You can find detailed information about the possibilities and the structure of the config.xml
in the according documentation page. To include a config.xml
file in your app put it into the Resources/config
folder:Extensions > My extensions
. For development purposes you can use the administration component to configure plugins to provide configuration for your app, therefore use the URL {APP_URL}/admin#/sw/extension/config/{appName}
.SystemConfig
and you can use the key {appName}.config.{fieldName}
to identify the values. There are two possibilities to access the configuration values from your app. If you need those values on your app-backend server, you can read them over the API. If you need the configuration values in your storefront twig templates you can use the systemConfig()
-twig function./api/_action/system-config
route. You have to add the prefix for your configuration as the domain
query parameter. Optionally you can provide a SalesChannelId
, if you want to read the values for a specific SalesChannel, as the salesChannelId
query param. The API call will return a JSON-Object containing all of your configuration values. A sample Request and Response may look like this.system_config:read
permission to access this API.config
(see Shopware Twig functions). An example twig template could look like this:config
service provides an app()
method, that can be used to access your app's configuration. When using this method you don't need to provide the {appName}.config
prefix and your app does not need any additional permissions.get()
method, to access any configuration value and not just the ones of your app.system_config:read
permission to use the config.get()
method.