So here is my problem;
I got a price in a Number (decimal) field in a node. I need to process this number in some way, depending on the interactions of the users, then send it back (through an ajax request) as an integer, but also with the corresponding currency sign format. It is stored in the prefix / suffix settings fields.
I should mention that this should also work with price translations and their prefixes / suffixes.
I have the price now in this way;
$ node = Drupal :: entityTypeManager () -> getStorage (& # 39; node & # 39;) -> load ($ node_id);
$ language = Drupal :: languageManager () -> getCurrentLanguage () -> getId ();
$ translate_node = $ node-> getTranslation ($ language);
$ price = $ translation_node-> get (& # 39; field_price & # 39;) -> getValue ()['value'];
So now I want to build a variable with the prefix / suffix translated based on the selected language.
I tried this, but it does not show the correct translated prefix;
$ translate_node-> get (& # 39; field_price & # 39;) -> getSettings ()['prefix']