Hello all,
Previous ticket: Client addresses integrated into the Square orders form?
I’ve been struggling to get the user’s order address to show up in the mobile app under the transactions field. I’ve opened multiple tickets, but no matter what I try, I can’t get the address to populate.
Here’s the relevant code snippet:
checkout_options: {
ask_for_shipping_address: true,
},
"merchant_support_email": "[email protected]",
"pre_populated_data": {
"buyer_address": {
"address_line_1": shippingDetails.streetAddress,
"country": shippingDetails.country,
"postal_code": shippingDetails.postalCode,
"locality": shippingDetails.city
}
}
And here’s the HTML form:
<label for="street-address">Street address</label>
<input type="text" id="street-address" name="street-address" autocomplete="street-address" required enterkeyhint="next">
<div>
<label for="city">City</label>
<input required type="text" id="city" name="city" autocomplete="address-level2" enterkeyhint="next">
</div>
<div>
<label for="postal-code">ZIP or postal code</label>
<input class="postal-code" id="postal-code" name="postal-code" autocomplete="postal-code" enterkeyhint="next">
</div>
<div>
<label for="country">Country or region</label>
<select id="country" name="country" autocomplete="country" enterkeyhint="done" required>
<option></option>
<option value="AE">United Arab Emirates</option>
<option value="GB">United Kingdom</option>
<option value="US">United States</option>
<option value="UM">US Outlying Islands</option>
<option value="VI">US Virgin Islands</option>
</select>
</div>
The code works fine with no errors, but I still can’t get the address to appear. Any ideas on what might be going wrong? Thanks for any help!