Linux 软件免费装
Banner图

VietAddr – Vietnam 2-Level Address for WooCommerce

开发者 vnwooplugins
更新时间 2026年10月7日 11:07
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPL-3.0-or-later
版权网址: 版权信息

标签

woocommerce address checkout phone vietnam

下载

0.2.0

详情介绍:

Since 1 July 2025 Vietnam uses a 2-level administrative system: 34 provinces/cities and 3,321 wards/communes/special zones. VietAddr turns the WooCommerce address form into two dependent dropdowns for Vietnamese addresses: Works with: Migrating from "Vietnam Checkout for WooCommerce" (woo-vietnam-checkout): Tools > "VietAddr: chuyển địa chỉ" converts saved customer addresses (old 3-level province/district/ward codes, or that plugin's 2-level codes) to the new format. It has a dry-run mode, backs up old values to the user meta _vnck_legacy_address, and lists the addresses that need a manual fix (for example, an old ward split between several new wards). WP-CLI: wp vnck migrate-legacy [--apply]. Tiếng Việt: Plugin thay ô địa chỉ của WooCommerce bằng 2 ô chọn Tỉnh/Thành phố → Xã/Phường/Đặc khu (34 tỉnh, 3.321 xã theo đơn vị hành chính từ 01/07/2025), ẩn mã bưu chính, kiểm số điện thoại Việt Nam. Dùng được với Checkout Block, checkout cổ điển, Tài khoản > Địa chỉ, màn sửa đơn trong admin, HPOS. Data Administrative units are bundled in data/vn-units.json (source: provinces.open-api.vn API v2, see data/SOURCE.md). The plugin makes no external requests: the browser loads the JSON file from your own site. Credits and data sources

安装:

  1. Upload the vietaddr folder to /wp-content/plugins/ or install the zip from Plugins > Add New.
  2. Activate the plugin. WooCommerce 8.0 or newer is required.
  3. Set the store country to Vietnam if needed. No settings page is required.

屏幕截图:

  • Order received page with ward and province names.
  • Admin order screen: ward dropdown filtered by province.

升级注意事项:

0.2.0 Adds Checkout block support. New addresses store the ward name instead of the ward code.

常见问题:

Does it replace the city/state fields in the Checkout block?

The block keeps the core fields. Province is the core state dropdown. For the ward, a small script places a dropdown over the core city field and writes the value through the WooCommerce Blocks data store. The server checks again when the order is placed, so an invalid ward or phone is rejected even without JavaScript.

Can I change the phone rule?

Yes, with the vnck_phone_pattern filter (PHP regular expression applied to the normalized number).

What happens to addresses saved by version 0.1.0?

Version 0.1.0 stored ward codes. They are still accepted and shown as ward names; the migration tool converts them to names.

What is removed when I delete the plugin?

The plugin creates no options or transients. Deleting it from Plugins (uninstall) removes only the user meta _vnck_legacy_address, the backup written by the migration tool. Customer and order addresses (WooCommerce billing/shipping fields) are kept. Deactivating the plugin removes nothing.

更新日志:

0.2.0 0.1.0