• Resolved Fenga

    (@fungzhao)


    Hi,

    I am making a registration form which will capture billing and shipping address.

    I was wondering if there was any custom code that can be added so that I can haver a tick box that says Billing and Shipping Address is the same, and if so then copy the value of billing address to shipping address?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @fungzhao,

    I hope you are keeping well and thank you for reaching out to us.

    I am afraid, this is not possible out of the box. However, I have pinged our developers to check if we can help you with this. We shall update you here if a workaround could be provided for this.

    Best Regards,
    Nebu John

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @fungzhao

    I just got feedback from our developers. Could you try this additional code, please?

    https://gist.github.com/wpmudev-sls/ceff1d0609fe344f068a34eb4c719d4a

    To add it to site:

    – create an empty file with a .php extension (e.g. forminator-copy-shipping-to-billing.php)
    – copy and paste that code into this file

    – adjust form ID and fields’ IDs in this lines

    Line #21
    let form_id = 104;

    Line #26 to #28

    _address_id1 = 'address-1',
    _address_id2 = 'address-2',
    _checkbox_id = 'checkbox-1',

    – save file and upload it to the site via FTP, cPanel File Manager or similar way, to the “/wp-content/mu-plugins/” folder; if there’s no “mu-plugins” folder in “wp-content”, create an empty one first.

    Give it a try please and let us know if it works for you.

    Best regards,
    Adam

    Thread Starter Fenga

    (@fungzhao)

    Hi Adam,

    Thank you for the assistance, the custom code provided by dev is about half working, there is a couple of issues, which can be seen by the screenshot below.
    https://snipboard.io/LVsuSe.jpg

    Issue 1
    The country field (which is a select field) is not copying over to address-2 country. Everything else works, as you can see in the screenshot

    Issue 2
    Address 2 field labels are not appearing above the input field after it has been populated which you can see causes overlap text. From what I can tell, using the code does not cause the forminator field div to have the class “forminator-is_filled” added to it.

    If there is a chance for them to have a look, it will be greatly appreciated

    Thanks

    Thread Starter Fenga

    (@fungzhao)

    Hi Adam,

    I have managed to fix the code and everything works now.

    The change I made was on line 25, I updated the code to trigger the change event after setting the value.

    _ad2_field.val( $(this).val()).change();

    This propagated the change and made everything else work

    Many Thanks and if you can pass on my thanks for the dev as well

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @fungzhao

    We are happy to hear it worked.

    Best Regards
    Patrick Freitas

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Handling Billing and Shipping Address’ is closed to new replies.