Minishop2: german umlauts (ä, ö, ü)

When saving a new contact/customer german umlauts (ä, ü, ö) are filtered out.
Can I change this?
Is it in the class
msorderhandler
, function
validate($key, $value)
?

case 'receiver':
                // Transforms string from "nikolaj -  coster--Waldau jr." to "Nikolaj Coster-Waldau Jr."
                $tmp = preg_replace(
                    array('/[^-a-zа-яёЁ\s\.]/iu', '/\s+/', '/\-+/', '/\.+/'),
                    array('', ' ', '-', '.'),
                    $value
                );
                $tmp = preg_split('/\s/', $tmp, -1, PREG_SPLIT_NO_EMPTY);
                $tmp = array_map(array($this, 'ucfirst'), $tmp);
                $value = preg_replace('/\s+/', ' ', implode(' ', $tmp));
                if (empty($value)) {
                    $value = false;
                }
                break;
Thank you for your help.
Fabian Christen
29 июня 2018, 13:18
modx.pro
774
0

Комментарии: 2

Василий Наумкин
29 июня 2018, 16:21
0
Yes, you can extend this class and change any method — see russian example.

Also you can improve this validator and send PR to miniShop2 repository =)
    Fabian Christen
    29 июня 2018, 16:24
    0
    Fast and precise as always!
    Thank you very much.
      Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
      2