• Resolved tonymuraca

    (@tonymuraca)


    I need the field shipping_phone to come throught at checkout and need it to automatically populate in that form field as we are not allowing the customer to change addresses. Right now all other fields populate when selecting from the drop-down, but shipping_phone field does not change its data. Anyway to add this to the address book fields?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Matt Harrison

    (@matt-h)

    Right now the plugin uses this code to handle setting the value of all shipping fields https://github.com/hallme/woo-address-book/blob/6ee0d69d9c234b698107b7cca7fcc58a4ba288c7/assets/js/scripts.js#L221-L250

    Right now it just sets the value attribute on the input for all fields for all of the fields except for custom logic for country and state dropdowns.

    This may need to be extended to handle cases for custom fields that are not just standard text input or hidden fields.

    Could you provide the html of your shipping_phone input field?

    And any details on how you are creating it could be helpful.

    Thread Starter tonymuraca

    (@tonymuraca)

    <p class=”form-row form-row-wide” id=”shipping_phone_field” data-priority=”110″><label for=”shipping_phone” class=””>Shipping Phone</label><span class=”woocommerce-input-wrapper”><input type=”text” class=”input-text ” name=”shipping_phone” id=”shipping_phone” placeholder=”” value=””></span></p>

    I added that field with the checkout field editor that was supposed to work with this plugin.

    Thanks for the speedy reply!

    • This reply was modified 4 years, 5 months ago by tonymuraca.
    • This reply was modified 4 years, 5 months ago by tonymuraca.
    Thread Starter tonymuraca

    (@tonymuraca)

    We just need to pass the correct stored data with each address for shipping_phone, shipping1_phone, shipping2_phone etc. when an order is processed. We synced all of this information to the database and just need it to come through at checkout.

    We do not allow the user to input these fields for our type of business they are determined by our accounting software, we just need them to update when the address book drop down is changed. Right now shipping_phone is not updated

    • This reply was modified 4 years, 5 months ago by tonymuraca.
    • This reply was modified 4 years, 5 months ago by tonymuraca.
    Plugin Author Matt Harrison

    (@matt-h)

    Based on that HTML, it looks like it should work to me.

    I can test it out tomorrow on a local install. Or if you have a demo site I can see it at I can take a look. Feel free to email it to [email protected] if you don’t want to post a link publicly.

    Thread Starter tonymuraca

    (@tonymuraca)

    Thanks Matt, appreciate the help. We just have the live site at the moment but could try and replicate it if needed. As of right now we only get the default shipping_phone from customers, it looks as though when selecting an address from the drop down it does not know to update that field for some reason. I have been in the database and all of the shipping phone numbers are correct otherwise. Thanks again

    Plugin Author Matt Harrison

    (@matt-h)

    Seeing the live site would be fine if it is possible to have an account. Otherwise I’ll use that plugin on a site and try to replicate it tomorrow.

    Thread Starter tonymuraca

    (@tonymuraca)

    The problem there is our customer accounts are sync’ed through our accounting software, so you can become a new user on the site but you won’t see pricing or be able to access the checkout page.

    Thread Starter tonymuraca

    (@tonymuraca)

    Hey Matt, just wondering if you had a change to try and replicate this issue yet? Thanks again for the help.

    Plugin Author Matt Harrison

    (@matt-h)

    I’ve done some testing so far and haven’t been able to replicate it yet.

    Currently I have the following settings in the Checkout Field editor and it swaps them out just fine on checkout.

    View post on imgur.com

    Thread Starter tonymuraca

    (@tonymuraca)

    Just realized the plugin I used is slightly different, Checkout Field Editor and Manager for WooCommerce. I still think this should work, but maybe I will try using checkout field editor instead and see if I have any luck. Thanks

    Plugin Author Matt Harrison

    (@matt-h)

    Do you have a link to the plugin you used?

    Thread Starter tonymuraca

    (@tonymuraca)

    Plugin Author Matt Harrison

    (@matt-h)

    I see. I just tried that plugin and it doesn’t inject them into the standard billing / shipping address hooks so it doesn’t see them as existing. It might be possible to fix at some point but it would take a dive into that plugin’s code to figure out how it works.

    Thread Starter tonymuraca

    (@tonymuraca)

    Sounds good, I am creating a staging site now to test…hopefully the plugin change will make the difference. I appreciate all your help!

    Thread Starter tonymuraca

    (@tonymuraca)

    That plugin change worked! all is well and good. I will leave a message to the creator of the other plugin so they know that they aren’t hooking into that field. Thanks again Matt!

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Adding an auto-populating field’ is closed to new replies.