• I have added the following code in my theme’s child function.php. But I don’t get the city list. What am I doing wrong in here?

    add_filter( ‘wc_city_select_cities’, ‘my_cities’ );
    function my_cities( $cities ) {
    $cities[‘QR’] = array(
    ‘Doha’,
    ‘Abu az Zuluf’,
    ‘Abu Thaylah’,
    ‘Ad Dawhah al Jadidah’,
    ‘Al Arish’,
    ‘Al Bida`
    ash Sharqiyah’,
    ‘Al Ghanim’,
    ‘Al Ghariyah’,
    ‘Al Ghuwairiyah’,
    ‘Al Hilal al Gharbiyah’,
    ‘Al Hilal ash Sharqiyah’,
    ‘Al Hitmi’,
    ‘Al Jasrah’,
    ‘Al Jumaliyah’,
    ‘Al Ka`biyah’,
    ‘Al Khalifat’,
    ‘Al Khor’,
    ‘Al Khawr’,
    ‘Al Khuwayr’,
    ‘Al Mafjar’,
    ‘Al Qa`abiyah’,
    ‘Al Wakrah’,
    ‘Al Adhbah’,
    ‘An Najmah’,
    ‘Ar Rakiyat’,
    ‘Al Rayyan’,
    ‘Ar Ru’ays’,
    ‘As Salatah’,
    ‘As Salatah al Jadidah’,
    ‘As Sani`’,
    ‘As Sawq’,
    ‘Ath Thaqab’,
    ‘Dukhan’,
    ‘Ras Laffan Industrial City’,
    ‘Umm Bab’,
    ‘Umm Sa’id’,
    ‘Umm Salal Ali’,
    ‘Umm Salal Mohammed’
    );
    return $cities;
    }

    • This topic was modified 8 years, 3 months ago by mayasl.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author mantish

    (@mantish)

    Hi mayasi
    Do you get any errors?

    The only strange thing I see in the code is the quotes, but that could be just a copy/pasting issue

    Thread Starter mayasl

    (@mayasl)

    // City list //
    add_filter( 'wc_city_select_cities', 'qatar_cities' );
    function qatar_cities( $cities ) {
        $cities['QR'] = array(
                    'Doha',
                    'Abu az Zuluf',
                    'Abu Thaylah',
                    'Ad Dawhah al Jadidah',
                    'Al Arish',
                    'Al Bida ash Sharqiyah',
                    'Al Ghanim',
                    'Al Ghariyah',
                    'Al Ghuwairiyah',
                    'Al Hilal al Gharbiyah',
                    'Al Hilal ash Sharqiyah',
                    'Al Hitmi',
                    'Al Jasrah',
                    'Al Jumaliyah',
                    'Al Ka biyah',
                    'Al Khalifat',
                    'Al Khor',
                    'Al Khawr',
                    'Al Khuwayr',
                    'Al Mafjar',
                    'Al Qa abiyah',
                    'Al Wakrah',
                    'Al Adhbah',
                    'An Najmah',
                    'Ar Rakiyat',
                    'Al Rayyan',
                    'Ar Ru ays',
                    'As Salatah',
                    'As Salatah al Jadidah',
                    'As Sani',
                    'As Sawq',
                    'Ath Thaqab',
                    'Dukhan',
                    'Al Jumaliyah',
                    'Al Ka biyah',
                    'Al Khalifat',
                    'Al Khor',
                    'Al Khawr',
                    'Al Khuwayr',
                    'Al Mafjar',
                    'Al Qa abiyah',
                    'Al Wakrah',
                    'Al Adhbah',
                    'An Najmah',
                    'Ar Rakiyat',
                    'Al Rayyan',
                    'Ar Ru ays',
                    'As Salatah',
                    'As Salatah al Jadidah',
                    'As Sani',
                    'As Sawq',
                    'Ath Thaqab',
                    'Dukhan',
                    'Ras Laffan Industrial City',
                    'Umm Bab',
                    'Umm Sa id',
                    'Umm Salal Ali',
                    'Umm Salal Mohammed'
        );
        return $cities;
    }

    Does the code look good now?

    No, I don’t get any error messages. Also I don’t get the drop-down list of cities in the checkout page.

    Plugin Author mantish

    (@mantish)

    Hi, the code does look good. Please check if QR is the correct code for your country

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘List doesn’t show’ is closed to new replies.