跳到内容

Sri Lankan Cities for WooCommerce

v1.0.0

Thushara Lakshan · 2026年7月3日 上架

Adds Sri Lanka's 25 districts to WooCommerce checkout, suggests cities for the chosen district, and autofills postal codes.

正在使用
90+
评分
5.0 / 5
累计下载
638
最近更新
2026年7月3日
1 条评价需要 WordPress 6.5+已测试到 7.0.9PHP 7.4+

截图

Classic checkout — the required District dropdown with all 25 Sri Lankan districts.
Classic checkout — the required District dropdown with all 25 Sri Lankan districts.
Pick a known city and the postal code fills in automatically — shipping switches to the matching district zone.
Pick a known city and the postal code fills in automatically — shipping switches to the matching district zone.
The block checkout is fully supported: district, city suggestions and postcode autofill.
The block checkout is fully supported: district, city suggestions and postcode autofill.
Ship by district — districts appear as regions in WooCommerce → Settings → Shipping.
Ship by district — districts appear as regions in WooCommerce → Settings → Shipping.

WooCommerce ships Sri Lanka with no districts and the State field hidden. This plugin makes checkout work the way Sri Lankan addresses actually work: 101, Main Street, Negombo, Gampaha, 11500, Sri Lanka.

  • Adds all 25 districts as a required District dropdown, keyed by ISO 3166-2:LK codes so couriers and shipping plugins interoperate.
  • Suggests cities for the selected district while the customer types — 288 verified cities across all 25 districts.
  • Autofills the postal code when a known city is picked — still editable, and it never overwrites a code the customer typed themselves.
  • Lets you build district-based shipping zones (WooCommerce Settings Shipping Add zone pick districts).
  • Works on both the classic (shortcode) checkout and the block checkout.

Safety and design

  • No external services. No data leaves your site, nothing is tracked, no account is needed.
  • No AJAX endpoints, no database writes, no extra checkout fields — WooCommerce validates the district server-side automatically.
  • Everything fails safe: without WooCommerce the plugin does nothing; with JavaScript blocked, the district dropdown still works and city/postcode are normal manual fields.
  • Block-checkout updates go through WooCommerce’s official wp.data store API.

Data provenance

Every autofilled postal code was verified against Sri Lanka Post and independent directories (July 2026). Cities whose codes could not be fully verified are left out — for those, the city field simply works as a plain text box.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums