1. Home
  2. Docs
  3. Custom Code Samples
  4. Checkout Map
  5. How to prevent map from auto-filling checkout fields

How to prevent map from auto-filling checkout fields

By default LPAC will fill in the checkout fields automatically when a user selects their location on the map. The plugin has some logic for knowing when to fill out the billing fields versus the shipping field but in some rare cases you might not want any fields filled out automatically and would rather just have a user select their location on the map.

To do this we can make use of the lpac_fill_checkout_fields filter. The following snippet shows how to prevent the map from filling out the fields:

PHP
function lpac_cc_enable_checkout_autofill(){
  return false;
}
add_filter('lpac_fill_checkout_fields', 'lpac_cc_enable_checkout_autofill');
Was this article helpful to you? Yes No