lat9 / one_page_checkout

One-Page Checkout for Zen Carts v1.5.7a and later.
GNU General Public License v2.0
15 stars 11 forks source link

Prefilling a credit card results in the address section becoming active. #380

Closed jeking928 closed 1 year ago

jeking928 commented 1 year ago

Zen Cart 1.5.8a OPC 2.4.6beta3

When using Edge and using the browser pre-fill option to pre-fill the credit card fields, after the credit card fields are filled, the address section become active. My client says the Update button does not work, only the cancel. In my testing, both Cancel and Update are functional.

I can understand the pre-fill is trying to fill the address, it's part of the pre-fill settings. I don't know much about how the pre-fill works. Is there a way to prevent it from trying to prefill the address fields (without preventing it when actually trying to pre-fill the address fields)?

As reported here: https://www.zen-cart.com/showthread.php?220781-One-Page-Checkout-Support-Thread&p=1396310#post1396310

lat9 commented 1 year ago

Thanks, James. Hopefully, I'll get a chance to investigate soon.

jeking928 commented 1 year ago

I tested in Chrome and did not experience the same issue.

jeking928 commented 1 year ago

I have a developer I work with regularly who came up with this fix for this issue. It's worked in my testing so thought I'd share it.

includes/modules/pages/checkout_one/jquery.checkout_one.js

In the changeBillingFields function, add a conditional check of:

if ( jQuery('#address-form-bill').is(':visible') ) { // Existing function code here }

In the changeShippingFields function, add a conditional check of:

if ( jQuery('#address-form-ship').is(':visible') ) { // Existing function code here }

lat9 commented 1 year ago

Thanks, @jeking928; I'll give that a whirl!