Please post all pre-sales questions of all products on this forum

Adding address finder to checkout form

  • Steve Williams
  • Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 8 months ago - 5 years 8 months ago #116129 by Steve Williams
Adding address finder to checkout form was created by Steve Williams
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
Attachments:
Last edit: 5 years 8 months ago by Steve Williams.

Please Log in or Create an account to join the conversation.

  • Giang Dinh Truong
  • Offline
  • Administrator
  • Administrator
More
5 years 8 months ago #116136 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Adding address finder to checkout form
Hello Steve,

Thank you for interesting in our EShop Shopping Cart extension. I read your question. Actually, if you want to add that custom code to process the Address field in EShop, you must also insert it into somewhere in the source code of EShop.

It maybe implemented by overwrite to the layout of Eshop so you will not loss it if you upgrade EShop in the future.

Sincerely, Giang

Please Log in or Create an account to join the conversation.

  • Steve Williams
  • Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 8 months ago #116186 by Steve Williams
Replied by Steve Williams on topic Adding address finder to checkout form
Hi Giang,
Would be able to assist me as to where I would need to put that code? By the way, I have purchased eShop and would also be looking to import products from Hikashop into eshop. I have seen an import plugin/addon, would this be able to import the products? I would prefer not to have to create the items again. Also what about the orders currently in Hikashop, would we have to leave them there, or could these also be imported? So many questions I know, but your product looks so good that I am betting that it will all work out. I just wish I had chosen eShop before doing Hikashop :( . All the best,
Steve

Please Log in or Create an account to join the conversation.

  • Giang Dinh Truong
  • Offline
  • Administrator
  • Administrator
More
5 years 7 months ago #116538 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Adding address finder to checkout form
Hello Steve,

Thank you for purchasing EShop.

1. Regarding putting the custom code, please submit a new ticket to EShop category so I can check and find a solution and guide you there.

2. For migrating data (categories, products, images, etc) from HikaShop into EShop: If you can export that data from HikaShop into Excel file, then you can use EShop Import Pro tool to import data from Excel file into EShop.

3. Regarding orders, there is nothing to migrate orders from HikiaShop into EShop now.

Sincerely, Giang

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham NgocGiang Dinh TruongMr. Dam