Skip to content

Multilingual WooCommerce issue #37

@Abdalsalaam

Description

@Abdalsalaam

Hi,
I'm using wc-city-select on multilingual WooCommerce website.

The issue is while user ordered, city will stored in the user language, and it will cause some issues with shipping plugins, city should be always English.

I tried to solve it by editing this :
foreach ( $this->dropdown_cities as $city_name ) { $field .= '<option value="' . $city_name. '" '.selected( $value, $city_name, false ) . '>' . $city_name .'</option>'; }

and replace it with:
foreach ( $this->dropdown_cities as $index => $city_name ) { $field .= '<option value="' . $index . '" '.selected( $value, $city_name, false ) . '>' . $city_name .'</option>'; }

and another edit on the cities array :
$cities['SA'] = array( 'Riyadh' => array( 'Riyadh' => __('Riyadh','wc_cities_p'), ));

by this way, index will be always in English language, and city will be compatible with WPML..etc

But, it actually didn't work because the first section does not appear on the HTML, I mean the billing_city or shipping_city select element always showing the original one.

where can I find this elements loop to edit it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions