I use below code to disable Autocomplete Fields in the woocommerce checkout page:
add_filter('woocommerce_checkout_get_value','__return_empty_string',10);
Above code disables all autocomplete fields. How about I want to enable autocomplete for specific fields like Billing Country and Shipping Country?
2
Answers
I recently found out that this can be done via javascript as well:
You found the correct hook
woocommerce_checkout_get_value
. You just had to add a callback function to it and write logic to return the value of your desire.Add/Remove items from
$item_to_set_null
array as you require.Code is tested and WORKS.