This package provides a attribute install command based on a yaml config. This is intended to work with the composer skeleton of shopware 5
Install the package:
$ composer require avarel/sw-attribute-installer
Enable it in your ./app/services.xml:
<imports>
<import resource="../vendor/avarel/sw-attribute-installer/src/Resources/services.xml"/>
</imports>
Define a YAML file anywhere you want.
Configure your fields:
attributes:
s_articles_attributes:
recommended_retail_price:
type: 'float'
label: 'UVP'
displayInBackend: true
rating_image:
type: 'single_selection'
label: 'Image'
displayInBackend: true
entity: 'Shopware\Models\Media\Media'
s_categories_attributes:
is_bold:
type: 'boolean'
label: 'Kategoriename fettgeschrieben darstellen?'
displayInBackend: true
Use this command to install the attributes
$ php ./bin/console avarel:attributes:install /path/to/attributes.yml