Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Author FAKTOR VIER

    (@faktorvier)

    Hi @piersert

    This plugin should be compatible with every multilanguage plugin, but the texts are currently only translated in german and english. If you need your own translation, you can use the following hook though:

    add_filter('F4/WCSF/get_salutation_options', function($options, $settings) {
    	$options['mr'] = 'Your own text for Mr.';
    	$options['mrs'] = 'Your own text for Mrs.';
    	return $options;
    }, 10, 2);
    Thread Starter piersert

    (@piersert)

    1. Does it store the title in the database?
    2. Is there a radio option?

    Plugin Author FAKTOR VIER

    (@faktorvier)

    Hi @piersert

    1. Yes, the selected salutation is stored in the database
    2. No, there is currently no option for radiobuttons. We’ll add this in the near future.

    Thread Starter piersert

    (@piersert)

    Hi,

    Thank you for adding the radio that it’s best option only for 2 selections Mr. Mrs.

    Thread Starter piersert

    (@piersert)

    1. Does it also store the multilingual values by adding the hook in the functions.php?

    Thread Starter piersert

    (@piersert)

    How to change the title ‘salutation’ to ‘title’?

    Thread Starter piersert

    (@piersert)

    and also placeholder if possible?

    Plugin Author FAKTOR VIER

    (@faktorvier)

    1. Does it also store the multilingual values by adding the hook in the functions.php?

    The plugin does not store the translated value, it stores the code you use in the array (for example it stores “Mrs” and not “Mrs.”). But everywhere the value is displayed it automatically shows the translated value.

    You can change “salutation” to “title” with the following hooks (not tested, but should work… Let us know if its not working correctly):

    add_filter('F4/WCSF/address_billing_field_salutation', 'change_salutation_label');
    add_filter('F4/WCSF/address_shipping_field_salutation', 'change_salutation_label');
    add_filter('F4/WCSF/customer_meta_field_billing_salutation', 'change_salutation_label');
    add_filter('F4/WCSF/customer_meta_field_shipping_salutation', 'change_salutation_label');
    add_filter('F4/WCSF/admin_field_field_billing_salutation', 'change_salutation_label');
    add_filter('F4/WCSF/admin_field_field_shipping_salutation', 'change_salutation_label');
    
    function change_salutation_label($field) {
    	$field['label'] = 'Title';
    	return $field;
    }

    You can also change the placeholder with the following hook:

    add_filter('F4/WCSF/get_salutation_options', function($options, $settings) {
    	$options[''] = 'Custom placeholder';
    	return $options;
    }, 10, 2);
    Thread Starter piersert

    (@piersert)

    Hi,

    everything seems to work fine except the translations of the email confirmation address that is only shown in German and English and not in the other languages. Customers that order in French, they are receiving the the title Mr. or Mrs in the email confirmation.

    Is there any way to fix it?

    Plugin Author FAKTOR VIER

    (@faktorvier)

    Hi @piersert

    How exactly have you overwritten the salutation values? We’ve just tested it and it works perfectly on our test system. Can you provide some of your code? Or do you have an plugin installed that may have some conflicts with the address formatting in emails?

    Thread Starter piersert

    (@piersert)

    AS I explain the code you provided overwrite the woocommerce admin but not the email confirmation. The English and German work but not Italian and French.

    It seems that your code only works for German and English

    Thread Starter piersert

    (@piersert)

    Hi,

    Can you please let me know?

    Your code outside Checkout page seems to work only for English and German, but not for other languages.

    Kind regards

    Plugin Author FAKTOR VIER

    (@faktorvier)

    Hi @piersert

    As we already answered before, we tested this with multiple languages and it works on our site. Thats why we asked you for more informations (code snippets etc.) so we can try to recreate the problem thats currently only occuring on your installation.

    The DEFAULT labels are only translated in English and German, thats true. But as we can see from your question earlier, you already know how to change the translations, so we assume that you added your own translations. Are your own translations not working? Or do you work with our default translations? If so, you can overwrite those (again) with the following snippet:

    add_filter('F4/WCSF/get_salutation_options', function($options, $settings) {
    	$options['mr'] = __('Your own translatable label for mr', 'your-textdomain');
    	$options['mrs'] = __('Your own translatable label for mrs', 'your-textdomain');
    	return $options;
    }, 10, 2);
    Thread Starter piersert

    (@piersert)

    Hi,

    We added the following translation working only on checkout page for all languages:

    add_filter(‘F4/WCSF/get_salutation_options’, function($options, $settings) {
    if ( ICL_LANGUAGE_CODE == ‘de’ ) {$options[‘mrs’] = ‘Frau’;
    $options[‘mr’] = ‘Herr’; }
    if ( ICL_LANGUAGE_CODE == ‘fr’ ) {$options[‘mrs’] = ‘Madame’;
    $options[‘mr’] = ‘Monsieur’; }
    if ( ICL_LANGUAGE_CODE == ‘it’ ) {$options[‘mrs’] = ‘Signora’;
    $options[‘mr’] = ‘Signor’; }
    return $options;
    }, 10, 2);

    You should translate your core code to other languages, in order to reproduce the translations not only on checkout, but also in other sections

    Kind regards

    Plugin Author FAKTOR VIER

    (@faktorvier)

    Thanks for the code snippet. Normally the translations made with this hook should appear on every page correctly, even in the email. We’ll take a closer look if there are any incompatibilities with WPML in the email output and get back to you as soon as we find anything.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Multilingual’ is closed to new replies.