Description
Türkçe
Türkiye İl İlçe Mahalle Eklentisi, WooCommerce ödeme sayfasındaki varsayılan adres alanlarını Türkiye adres sistemiyle değiştirir. Eklentiyle birlikte 81 il, 973 il-ilçe ilişkisi ve 31.863 mahalle kaydı gelir; CSV yüklemeniz gerekmez.
Özellikler
- Alan sırası: Ülke, İl, İlçe, Mahalle, Açık adres, (Posta kodu), Telefon.
- İlçe ve mahalle listeleri AJAX ile yüklenir; sayfa yavaşlamaz.
- Hem klasik ödeme sayfasını hem de WooCommerce blok tabanlı (Checkout Block) ödeme sayfasını destekler.
- Mahalle,
address_1alanına yazılmaz; sipariş meta alanlarında ayrı saklanır.address_2değiştirilmez. - Otomatik posta kodu: mahalle seçilince posta kodu otomatik doldurulur (mahallelerin yaklaşık %96’sında posta kodu vardır, müşteri değiştirebilir).
- Yönetim panelinde “Posta Kodu Ekle / Düzenle” bölümü: posta kodu olmayan mahallelere kod girin veya mevcut kodu değiştirin.
- Yönetim panelinden yeni il, ilçe ve mahalle ekleyebilirsiniz.
- Fatura bilgileri (isteğe bağlı, Ayarlar’dan açılır): Bireysel için T.C. Kimlik No; Kurumsal için firma ünvanı, vergi dairesi ve Vergi Kimlik No. Numaralar sağlama basamağına göre hem tarayıcıda hem sunucuda doğrulanır.
- Vergi dairesi, seçilen il ve ilçeye göre GİB’in resmi listesinden (860 daire, 18.06.2026) otomatik seçilir; listeden değiştirilebilir, listede olmayan bir ad da yazılabilir.
- Blok ödeme sayfasında alanlar WooCommerce’in kendi alanlarıyla aynı yapıdadır; tema ile uyumlu görünür.
- T.C. Kimlik No yalnızca siparişe yazılır, müşteri profiline kaydedilmez, e-postalarda gösterilmez; yalnızca yöneticiler görür. Doğrulama sağlama basamağına dayanır, numaranın kişiye ait olduğunu kanıtlamaz.
- Ayarlar: il / ilçe / mahalle zorunluluğu, il ve ilçeyi yan yana gösterme, posta kodunu gösterme / gizleme, ikinci adres satırını gösterme / gizleme, kargo eklentileri için “Mahalle Mahallesi, açık adres” biçimi.
- Sipariş ekranında, e-postalarda ve “Hesabım > Adresler” sayfasında mahalle bilgisi görünür.
- Giriş yapmış müşterinin kayıtlı il / ilçe / mahalle bilgisi ödeme sayfasında otomatik seçilir.
- Yüksek Performanslı Sipariş Depolama (HPOS) ve PHP 8.4 uyumlu.
- Güvenlik: yetki ve nonce kontrolleri, hazırlanmış SQL sorguları, kaçışlanmış çıktılar.
- Performans: il listesi önbelleğe alınır, ilçe / mahalle yanıtları tarayıcıda saklanır, veri kurulumu toplu yazılır.
English
Türkiye İl İlçe Mahalle Eklentisi (Turkey Province District Neighborhood) replaces the default WooCommerce checkout address fields with the Turkish address system. 81 provinces, 973 province-district relations and 31,863 neighborhood records are bundled, so no CSV upload is needed.
Features
- Field order: Country, Province, District, Neighborhood, Street address, (Postcode), Phone.
- District and neighborhood lists are loaded with AJAX, keeping pages fast.
- Works with both the classic checkout and the WooCommerce Checkout Block.
- The neighborhood is not written into
address_1; it is stored separately in order meta.address_2is never modified. - Automatic postcode: selecting a neighborhood fills in the postcode (about 96% of neighborhoods have one; customers can edit it).
- Admin section “Posta Kodu Ekle / Düzenle”: add or change the postcode of any neighborhood, optionally listing only those without one.
- Add provinces, districts and neighborhoods from the admin screen.
- Invoice details (optional, enabled in Settings): T.C. Kimlik No for individuals; company name, tax office and Vergi Kimlik No for companies. Numbers are checksum-validated in the browser and on the server.
- The tax office is selected automatically from the chosen province and district using the official GİB list (860 offices, 2026-06-18); it can be changed, and a name not in the list may be typed.
- In the Checkout Block the fields use WooCommerce’s own field markup and look identical to core fields.
- The T.C. Kimlik No is stored on the order only (not in the customer profile, not in emails, visible to admins). Validation is checksum-based and does not prove ownership.
- Settings: require province / district / neighborhood, show province and district side by side, show or hide the postcode, show or hide the second address line, optional “Neighborhood Mahallesi, street address” format for cargo plugins.
- The neighborhood is shown on the order screen, in emails and under My Account > Addresses.
- The saved province / district / neighborhood of a returning customer is pre-selected at checkout.
- Compatible with High-Performance Order Storage (HPOS) and PHP 8.4.
- Security: capability and nonce checks, prepared SQL queries, escaped output.
- Performance: cached province list, browser-cached district / neighborhood responses, batched data import.
Bundled data: 81 provinces, 973 province-district relations and 31,863 unique neighborhood records (data/turkiye-il-ilce-mahalle.csv).
Support
Developer: 3rkadir — 3rkadir@gmail.com
Installation
- Upload the ZIP file at Plugins > Add New > Upload Plugin.
- Activate the plugin. WooCommerce must be active.
- Configure the plugin at WooCommerce > Türkiye İl İlçe Mahalle Eklentisi.
If you are upgrading from the older “WooCommerce Türkiye Adres Sistemi” (version 1.2.3 or earlier), deactivate and delete the old plugin first. Your settings and address data are kept.
FAQ
-
Will my existing orders change?
-
No. Addresses saved in older orders in the “Neighborhood Mahallesi, address” format are left as they are and are not merged again.
-
Where can I read the neighborhood?
-
In the order meta fields
_billing_neighborhoodand_shipping_neighborhood(and the_tr_*copies).get_billing_address_1()returns only the street address. -
Is the data removed when the plugin is deleted?
-
No. Deleting the plugin removes only its settings. The province, district and neighborhood tables are kept.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Türkiye İl İlçe Mahalle Eklentisi” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Türkiye İl İlçe Mahalle Eklentisi” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.3.5
- New: optional invoice details (T.C. Kimlik No, Vergi Kimlik No, company, tax office) with server and browser validation.
- New: tax office list from GİB (860 offices) with automatic selection by province and district.
- Improved (Checkout Block): fields reuse WooCommerce’s own markup for an identical look; selectors sit right above the street address field.
- Improved (classic): searchable province / district / neighborhood lists; bottom sheet on phones.
- Fix: README tag limit (5).
1.3.4
- Plugin renamed to “Türkiye İl İlçe Mahalle Eklentisi” (slug unchanged, settings and data are kept).
- Plugin Check: batched import query annotated (no behaviour change; all values are still passed through $wpdb->prepare()).
- README now in Turkish and English.
1.3.3
- Fix (Checkout Block): “Lütfen il seçiniz” / “Lütfen mahalle seçiniz” errors although province, district and neighborhood were selected. The selections now travel inside the order request itself (Store API checkout extension data) instead of the WooCommerce session, which concurrent cart requests could overwrite.
- Fix (Checkout Block): validation ran on every draft-order update while the customer was still filling in the form; it now runs only when the order is actually placed.
- Fix (Checkout Block): the Store API now uses the same Turkey locale as the block form, so WooCommerce’s own “state” field is never demanded server-side.
- Fix (Checkout Block): saved address of a returning customer is pre-selected and its stored neighborhood is accepted; billing falls back to the shipping selection when “use same address” is on.
- Fix: a slow answer for an earlier province/district can no longer overwrite the list of the current one (classic and block).
- Classic checkout: saved district and neighborhood of returning customers are restored.
- Checkout Block: plugin selectors are hidden and WooCommerce’s own fields are shown again when a country other than Türkiye is chosen.
- PHP 8.4: explicit CSV escape argument, typed static properties, no deprecated calls.
- Performance: province list cached (transient), settings memoised, district/neighborhood lists cacheable by the browser for 10 minutes, bundled data imported in batches of 500 rows, and the import can no longer start from a customer’s checkout AJAX request.
1.3.2
- Bundled data: 188 more neighborhoods now have a postcode (about 97% in total). Re-importing never overwrites a postcode that is already stored or was edited manually.
1.3.1
- New admin section to add or edit the postcode of existing neighborhoods (province > district > neighborhood, optionally only those without a postcode).
- The “add neighborhood” form accepts an optional postcode.
1.3.0
- New: automatic postcode. Selecting a neighborhood fills in the postcode (classic checkout and Checkout Block). Can be turned off in the settings.
- Bundled data now includes postcodes. Existing sites are upgraded automatically the first time an administrator opens the dashboard; stored data is kept.
1.2.4
- Plugin renamed to “Türkiye Adres Sistemi for WooCommerce” (slug: turkiye-adres-sistemi-for-woocommerce) to comply with the WordPress.org trademark rules.
- Database queries now use
%iidentifier placeholders with$wpdb->prepare()for table names (requires WordPress 6.2). - AJAX endpoints verify the nonce with
check_ajax_referer(). - The settings array is sanitized with
map_deep(). - Removed the discouraged
load_plugin_textdomain()call. - Readme rewritten in English and “Tested up to” added.
1.2.3
- New setting: pass the neighborhood to shipping integrations together with the address (off by default).
1.2.2
- Wider, 3-row street address field in the classic checkout; admin support info and settings shortcut; WordPress coding standards fixes.
1.2.1
- Fixed the district list not loading in the classic checkout; pinned the street address field name and order.
1.2.0
- New field order, separate neighborhood and street address storage, postcode and second address line settings, order/email/My Account display, rewritten Blocks adapter.