pino  
                
                  
                    23. Juli 2019 um 10:03
                   
                  1 
               
             
            
              tach zusammen,
ich brauch eine select-box, der werte aus einer plugin konfiguration anzeigt.
die konfiguration sieht in etwa so aus:
xxxx;yyyy;zzzz
ich muss also die konfiguration auslesen und den einträg exploden um eine liste für die select-box zu erhalten.
geplant ist eigene komponente der mir die einträge dieser konfiguration in einer select-box anzeigt.
             
            
              
            
           
          
            
              
                simkli  
              
                  
                    29. Juli 2019 um 16:53
                   
                  2 
               
             
            
              Hallo pino,
also die Plugin-Config deines Plugins bekommst du über die API via:
/api/v1/system-config?domain=DeinPluginName.config
Du kannst alle Endpunkte dir unter /api/v1/_info/swagger.html ansehen.
VG
edit: wenn du sowieso einen Vue Component gebaut hast:
// innerhalb deines Components
inject: ['systemConfigApiService'],
created() {
    this.systemConfigApiService
    .getConfig('DeinPluginName.config')
    .then(data => {
        console.log(data['CONFIG_NAME']); // dein Plugin Wert des Keys CONFIG_NAME
    });     
}
 
             
            
              
            
           
          
            
              
                pino  
              
                  
                    30. Juli 2019 um 12:56
                   
                  3 
               
             
            
              danke simkli,
ich hatte mir eine eigene ajax abfrage gebaut, aber das ist viel besser.
this.systemConfigApiService.getValues('myPlugin.config').then((response) => {
    // response = {myPlugin.config.myConfig: {...}, myPlugin.config.myConfig2: {...}}
    let config = response['myPlugin.config.myConfig'];
    this.doSomething(config);
}).catch(() => {
    let config = 'my default value';
    this.doSomething(config);
});
 
             
            
              
            
           
          
            
              
                NacScha  
              
                  
                    1. Dezember 2021 um 11:28
                   
                  4 
               
             
            
              
Hello, I tried this in Shopware 6.4.1.0, but this doesn’t seem to work anymore.
Is there an other solution?
             
            
              
            
           
          
            
              
                pino  
              
                  
                    1. Dezember 2021 um 11:54
                   
                  5 
               
             
            
              try this:
this.systemConfigApiService.getValues('DeinPluginName.config').then((data) => {
    console.log(data['CONFIG_NAME']);
});
 
            
              
            
           
          
            
              
                NacScha  
              
                  
                    1. Dezember 2021 um 12:10
                   
                  6 
               
             
            
              @pino 
Shopware.Service('privileges')
    .addPrivilegeMappingEntry({
        category: 'permissions',
        parent: 'settings',
        key: 's1_dev_protection_permissions',
        roles: {
            viewer: {
                privileges: [
                    'plugin:read',
                    'system_config:read'
                ],
                dependencies: []
            },
            editor: {
                privileges: [
                ],
                dependencies: [
                ]
            },
            creator: {
                privileges: [
                ],
                dependencies: [
                ]
            },
            deleter: {
                privileges: [
                ],
                dependencies: [
                ]
            }
        }
    });
is something wrong with this?
             
            
              
            
           
          
            
              
                pino  
              
                  
                    1. Dezember 2021 um 12:54
                   
                  7 
               
             
            
              ACL is not the problem, because you have to check by your self:
if(this.acl.can('system.system_config')){
    this.systemConfigApiService.getValues('DeinPluginName.config').then((data) => {
        console.log(data['CONFIG_NAME']);
    });
}
401 means you are not logged in or you have a wrong token.
             
            
              
            
           
          
            
              
                NacScha  
              
                  
                    1. Dezember 2021 um 13:19
                   
                  8 
               
             
            
              
I don’t know how, but this problem got solved. Maybe it was a problem with the administration watcher and it got solved after restarting it.
It is working fine now, but I had to do one change
if(this.acl.can('system.system_config')){
    this.systemConfigApiService.getValues('DeinPluginName.config').then((data) => {
        console.log(data['DeinPluginName.config.CONFIG_NAME']);
    });
}
 
            
              
            
           
          
            
              
                NacScha  
              
                  
                    1. Dezember 2021 um 15:13
                   
                  9 
               
             
            
              @pino   Do you have any information, if the plugin configuration is stored inside a vuex-Store (for more reactivity) ?