Change one behaviour, or take over the WooCommerce fields entirely. All hooks are part of the stable public API.
Actions
| Action | When |
|---|
vafw_loaded | The plugin has loaded. Receives the API version (1). |
Filters
| Filter | What it changes |
|---|
vafw_settings | The settings in use: picker, strict, hide_postcode, reorder, rest (1 / 0). |
vafw_woocommerce_enabled | Return false to handle the WooCommerce address fields yourself. |
vafw_find_ward | The ward found for what was typed: ( $ward, $province, $text ). Also used by checkout validation. |
vafw_address_format | The Vietnamese address format (WooCommerce placeholders). |
vafw_load_picker | Whether to load the picker on the current page (default: checkout, cart and My Account). |
vafw_rest_enabled | Turn the REST API on or off. |
vafw_data_dir, vafw_data_url | Where the JSON data is read from — for example a copy kept outside the plugin folder. |
Examples
Keep the postcode visible
add_filter( 'vafw_settings', function ( $settings ) {
$settings['hide_postcode'] = 0;
return $settings;
} );
Turn off the REST API
add_filter( 'vafw_rest_enabled', '__return_false' );
Load the picker on a custom page
add_filter( 'vafw_load_picker', function ( $load ) {
return $load || is_page( 'order-form' );
} );