\n var addyConfig = { 'key': '{$addy_api_key}', hidePostCode: '$addy_hide_postcode', hideRural: '$addy_hide_rural', hideUndeliver: '$addy_hide_undeliver', enableLocation: '$addy_enable_location', filterPostcodes: '{$addy_filter_postcodes}', filterRegions: '{$addy_filter_regions}', notFound: '{$addy_not_found}' };\n";
}
add_filter('woocommerce_get_settings_checkout', 'addy_settings', 10, 1);
function addy_settings($settings) {
$settings[] = array('name' => __( 'Addy\'s NZ Address Autocomplete Settings', 'text-domain' ),
'type' => 'title',
'desc' => __( 'Configure your address autocomplete and validation settings below:', 'text-domain' ),
'id' => 'addy-api-settings' );
$settings[] = array(
'name' => __( 'Addy API Key', 'text-domain' ),
'desc_tip' => __( 'Get your Addy API Key from www.addy.co.nz', 'text-domain' ),
'id' => 'addy-api-key',
'type' => 'text',
'default' => __( 'demo-api-key', 'text-domain' ),
'desc' => __( '
Get your Addy API key from www.addy.co.nz or use the demo key \'demo-api-key\'.', 'text-domain' ),
);
$settings[] = array(
'name' => __( 'Exclude PO Box addresses', 'text-domain' ),
'id' => 'addy-hide-postcode',
'type' => 'checkbox',
'desc' => __( 'Check this box if you do not deliver to PO Box addresses', 'text-domain' ),
);
$settings[] = array(
'name' => __( 'Exclude Rural addresses', 'text-domain' ),
'id' => 'addy-hide-rural',
'type' => 'checkbox',
'desc' => __( 'Check this box if you do not deliver to rural addresses', 'text-domain' ),
);
$settings[] = array(
'name' => __( 'Exclude Non-Mail addresses', 'text-domain' ),
'id' => 'addy-hide-undeliver',
'type' => 'checkbox',
'desc' => __( 'Check this box if you only ship to mail delivery addresses', 'text-domain' ),
);
$settings[] = array(
'name' => __( 'Enable Location Services', 'text-domain' ),
'id' => 'addy-enable-location',
'type' => 'checkbox',
'desc' => __( 'Enable reverse geocoding to return "Addresses near me"', 'text-domain' ),
);
$settings[] = array(
'name' => __( 'Postal Codes Filter', 'text-domain' ),
'id' => 'addy-filter-postcodes',
'type' => 'text',
'desc' => __( '
A dash separated list of supported postcodes (e.g. 0622-1010-7550).
Leave blank to support NZ wide coverage. See Postcode List', 'text-domain' ),
);
$settings[] = array(
'name' => __( 'Region Filter', 'text-domain' ),
'id' => 'addy-filter-regions',
'type' => 'text',
'desc' => __( '
A dash separated list of supported regions (e.g. 1-2-3-4).
Leave blank to support NZ wide coverage. See Region List', 'text-domain' ),
);
$settings[] = array(
'name' => __( 'Not Found Message', 'text-domain' ),
'id' => 'addy-not-found',
'type' => 'textarea',
'placeholder' => __('e.g. Address not found. We only deliver to postcodes: 0622 and 1010.'),
'desc' => __( 'Add a message to inform the user what to do when an address could not be located.
Leave blank to use the default message.', 'text-domain' ),
);
$settings[] = array( 'type' => 'sectionend', 'id' => 'addy-api-settings' );
return $settings;
}
}
?>