Document types

If your plugin or AdditionalBundle brings new document types you can easily define them via json file. They will be installed, updated and uninstalled automatically. If a document type is in use it won't be uninstalled.

For each document type you want to add you need to create a json file in the Resources/document_types/ directory of your plugin or AdditionalBundle. The name of the file must be identical to the technical name.

Resources/document_types/my_document_type.json
{
    "technicalName": "my_document_type",
    "fileNamePrefix": "my_type_",      // optional
    "fileNameSuffix": "_my_suffix",    // optional
    "config": {                        // optional
        "key": "value"
    },
    "translations": {
        "de-DE": {
            "name": "Mein Dokumenttyp"
        },
        "en-GB": {
            "name": "My document type"
        }
    }
}

dustin/shopware-utils will automatically install your document type and a global document base configuration.

The config key can hold an object with base document config values.

Run bin/console plugin:update <PluginName> to update document types.

Last updated