Viewing 5 replies - 1 through 5 (of 5 total)
  • I am trying to do this too. Plugin works great, it just seems to be a big disconnect from where the standard address details are shown.

    Hi! I actually figured this one out on my lonesome this morning, basically you need to navigate to wherever you installed this plugin, and open the “checkout-address-autofill-template.php” file in a code editor.

    Find this section of code, on lines 2226:

    if(get_option(‘wc_af_show_below’) == ‘1’) :
    add_action(‘woocommerce_after_checkout_billing_form’, array($this, ‘wcaf_custom_checkout_field’));
    else :
    add_action(‘woocommerce_before_checkout_billing_form’, array($this, ‘wcaf_custom_checkout_field’));
    endif;

    — So from here, what I did is simply changed both values to “before” LOL. Probably not the best way, but it does work! So now, your code would look like this instead:

    if(get_option(‘wc_af_show_below’) == ‘1’) :
    add_action(‘woocommerce_before_checkout_billing_form’, array($this, ‘wcaf_custom_checkout_field’));
    else :
    add_action(‘woocommerce_before_checkout_billing_form’, array($this, ‘wcaf_custom_checkout_field’));
    endif;

    — Hope that helps! If someone finds a neater, cleaner way to do it, please feel free to correct me.

    • This reply was modified 5 years, 6 months ago by kristinadowns.
    Thread Starter Ward

    (@yward)

    @kristinadowns Thank you so much for sharing.

    Sadly this plugin had several issues and conflicts with others plugins that I’m using, for example it caused a front-end JS conflict, so i wrote a MU plugin to only activate it on check out.
    Then the issue about the positioning of the plugin form.

    I stopped using this plugin and opted to use a plugin that auto-completes cities, states and what not from a drop down list rather than auto fill it, for me this is perfect for stuff like shipping zones as it unifies the way people write the names and avoids spelling mistakes from avoiding any function I built that rely on accurate address.

    The only downside of the new solution is that the new plugin only has 3 countries information included, so I had to make the data for my country manually by using templates for the existing ones.
    Here’s the plugin for those who maybe interested:
    https://www.ads-software.com/plugins/states-cities-and-places-for-woocommerce/

    Thanks for sharing your solution kristinadowns

    Plugin developers – can you advise… does the plugin support template overrides? for instance is there a folder in our theme directory we can move the template file too so it doesn’t get overwritten in future updates!

    Thanks!

    • This reply was modified 5 years, 4 months ago by elextric.
    • This reply was modified 5 years, 4 months ago by elextric.
    • This reply was modified 5 years, 4 months ago by elextric.

    Hello

    is there a solution for moving the field down a bit?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change field order’ is closed to new replies.