Skip to content
Advertisement

Disable auto-complete fields (auto-fill) on Woocommerce checkout except for some fields

I use below code to disable Autocomplete Fields in the woocommerce checkout page:

JavaScript

Above code disables all autocomplete fields. How about I want to enable autocomplete for specific fields like Billing Country and Shipping Country?

Advertisement

Answer

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.

JavaScript

Add/Remove items from $item_to_set_null array as you require.

Code is tested and WORKS.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement