I have several Hikashop websites and these work ok although I am really sick of having to change settings via php and thought i would look at eShop. I really like what I am seeing at present and If I can make some changes in eShop, i think I will migrate all of our sites to you guys. What I would like to know is, can I insert the code widget below to be able to lookup and auto populate the address fields in eShop? Code is as follows:
(function() {
var widget, initAF = function() {
widget = new AddressFinder.Widget(
document.getElementById(''),
'ADDRESSFINDER_DEMO_KEY',
'AU', {
"address_params": {
"paf": "1"
},
"show_locations": true,
"location_params": {
"location_types": "street, locality, state"
}
}
);
widget.on('result:select', function(fullAddress, metaData) {
document.getElementById('').value = metaData.address_line_1;
document.getElementById('address_line_2').value = metaData.address_line_2;
document.getElementById('suburb').value = metaData.locality_name;
document.getElementById('state').value = metaData.state_territory;
document.getElementById('postcode').value = metaData.postcode;
});
};
function downloadAF(f) {
var script = document.createElement('script');
script.src = '
api.addressfinder.io/assets/v3/widget.js
';
script.async = true;
script.onload = f;
document.body.appendChild(script);
};
document.addEventListener('DOMContentLoaded', function() {
downloadAF(initAF);
});
})();
I realise we would have to match the field names to autopopulate but I am wondering where to insert this code to get it to work. I have it working in Hikashop although couldn't get it to work when editing an address or shipping address form as I am not a developer/coder. The above script works really well and even locates PO Box addresses in Australia which is what my client requires. I also notice that the input fields on the checkout form are not very tall, would I be able to modify these also? Thanking you for your time in this, all the best, Steve
Edited because I had the address in one field instead of multiple fields