How to create plugin configuration in Shopware?
Plugin configuration enables the admin user to control the plugin’s features and its configurations from Shopware backend. It’s easy to create plugin configurations in Shopware and utilize the stored configuration in the store. Before that, you must know how to create a custom plugin in Shopware.
Create config.xml file inside your plugin directory
Minimal configuration
German Minimal configuration
title
Title
1
Title is the main primary section to enter
Go to your store configuration page to update the value for the title field. You can find it under Extensions > My Extension > Shop Finder. You will have output similar to shared screenshot below:
If you have output with the above code, you have successfully created configuration for your plugin. It is simple process to create admin interface without any knowledge of backend architecture. Use the
Configuration elements:
<Card>: Cards are simply a wrapper for your field that groups similar configurations in a single place. You can add a number of cards and add a number of fields there.
Shopware has a rich set of input fields here is a list of those input fields:
- text
- textarea
- text-editor
- url
- password
- int
- float
- bool
- checkbox
- datetime
- date
- time
- colorpicker
- single-select
- multi-select
Advanced custom input field
Shopware does not only limit to general fields for store configuration, you can declare complex configuration with
- sw-entity-single-select
- sw-entity-multi-id-select
- sw-media-field
- sw-text-editor
- sw-snippet-field
Example of store configuration file
File name:
Minimal configuration
German Minimal configuration
isenable
1
true
title
Hey Default value
Title
1
Title is the main primary section to enter
mailMethod
smtp
Advanced Configuration
Erweiterte Einstellungen
apikey
Your secret token for xyz...
Dein geheimer Token für xyz...
exampleProduct
product
exampleMultiProductIds
product
pluginMedia
textEditor
snippetField
myPlugin.test.snippet
