• Resolved ricardhh10

    (@ricardhh10)


    Hi, first of all thanks for the plugin, it is very useful.

    I have a problem, I have a field “Provincia” that I created with this code to get the value of $state_name_full

    add_filter(‘woe_get_order_value_customer_details’, function ($value, $order, $fieldname) {

    $country_states = WC()->countries->get_states( $order->get_billing_country() );
    $state_name_full = $country_states[ $order->get_billing_state() ];

    $value = ‘Provincia: ‘ . $state_name_full. “\n”;
    return $value;
    }, 10, 3);

    When exporting it, the value is displayed correctly except when it has accents, which is displayed like this:
    https://i.imgur.com/jXK1JgZ.png (the word is Cádiz).

    How could I correct it? the type of file I am exporting is .xlsx

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author algol.plus

    (@algolplus)

    Hello

    please, switch format to CSV and open generated file in any TEXT editor.

    Will you see Cádiz ?

    Thread Starter ricardhh10

    (@ricardhh10)

    Hi, I finally solved it, in case it helps anyone, I added this line of code before saving it in $value:

    $state_name_full = html_entity_decode($state_name_full, ENT_QUOTES, ‘UTF-8’);

    Plugin Author algol.plus

    (@algolplus)

    ok, but @ricardhh10 I used your original code and I saw “Cádiz” in Excel file.

    Thread Starter ricardhh10

    (@ricardhh10)

    for some reason it didn’t appear right, maybe I had something wrong configured, but it’s fixed now, thanks for replying! 🙂

    Plugin Author algol.plus

    (@algolplus)

    👍

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Problem with displaying accents’ is closed to new replies.