How to fetch plugin configuration based on Shop Language selected?

Description:  I am building a plugin for my shop which has multiple languages. The plugin has a text field. I want to fetch the configuration setting based on the shop language selected. For example for english I need to fetch the text in english and vice versa for German.

Problem:  The text setting for the main shop (English) gets fetched only. Even when the language selected is German the shop fetches only Englsih text (Main shop text).

Code:

My element type is text and scope is shop

 

 

//Get configuration $config = $controller->get(‘shopware.plugin.cached_config_reader’)->getByPluginName(‘PluginName’); //Fetch url from configuration $videoLink = $config[‘videoLink’]; //Assign to frontend $controller->View()->assign(‘videoLink’, $videoLink);

I have looked through documentation but can’t find anything that talks about it. Any help would be appreciated.

Hallo ,

 

$config = $controller->get('shopware.plugin.cached_config_reader')->getByPluginName('PluginName', Shopware()->Shop());

VG,

Ahmad

2 Likes