One-Page Checkout (OPC) Bug – Billing and Shipping Address Fields Getting Mixed Up
After testing on localhost, I was finally able to reproduce the issue.
Steps to reproduce: (during testing this would happen randomly)
- Go to One-Page Checkout with different billing and shipping addresses.
- Click Edit on the billing address.
- While the billing editor is open, click Edit on the shipping address so both address forms are open simultaneously.
- Make changes to either address.
- Click Save Changes on one of the forms.
Actual result:
Address information can become mixed between the two forms.
For example, I tested:
Billing: United States — Wellington, Florida
Shipping: Netherlands — Vlijmen, North Brabant
After saving, the Netherlands shipping address displayed the city as Miami instead of Vlijmen, while the street address, postal code, and country remained from the Netherlands address.
Expected result:
Each address editor should operate independently. Saving the billing address should not modify the shipping address, and vice versa.
Alternatively, OPC could prevent both address editors from being open simultaneously.
Additional findings:
I checked the completed order information in phpMyAdmin and the Zen Cart admin during earlier tests, and the stored billing and shipping states were correct.
I also investigated the address_format table, but that turned out to be a separate issue involving how certain countries display provinces. I restored those changes and reproduced this problem again with the original configuration.
This appears to be related to how OPC handles the two address forms when both are open, possibly involving JavaScript field selectors or AJAX processing.
Has anyone encountered this behavior, and could the OPC address-editing JavaScript be allowing values from the two forms to interfere with each other?