monsieurbiz / SyliusSettingsPlugin

Provide some custom settings to your favorite Sylius shop!
MIT License
23 stars 18 forks source link

Be able to set default value on the channel #57

Closed maximehuran closed 1 year ago

maximehuran commented 1 year ago

It could be nice to set default values on the channel scope.

monsieurbiz_sylius_settings:
    plugins:
        app.my_plugin:
            vendor_name: Monsieur Biz
            vendor_url:
            plugin_name: My Plugin
            description: My amazing plugin
            icon: rocket
            use_locales: false
            classes:
                form: App\Form\Type\SettingsType
            default_values:
                value_1: 'value_1'
                value_2: 'value_2'
            MY_CHANNEL_CODE_values:
                value_1: 'value_1_1'
                value_2: 'value_2_2'
jacquesbh commented 1 year ago

Hi @maximehuran !

Your issue will be fixed by #60.

maximehuran commented 1 year ago

It's not the same as fixtures. Are fixtures the only way to do that ?

maximehuran commented 1 year ago

Maybe by changing the YAML format :

monsieurbiz_sylius_settings:
    plugins:
        app.my_plugin:
            vendor_name: Monsieur Biz
            vendor_url:
            plugin_name: My Plugin
            description: My amazing plugin
            icon: rocket
            use_locales: false
            classes:
                form: App\Form\Type\SettingsType
            default_values:
                default:
                    value_1: 'value_1'
                    value_2: 'value_2'
                MY_CHANNEL_CODE:
                    value_1: 'value_1_1'
                    value_2: 'value_2_2'
maximehuran commented 1 year ago

I't good from now to work with fixtures and commands