Hello,
I need help to add pincode checker into product details page.
Anyone can share me code how to add pincode checker and any API integration to this functionality.
Please find attached image I want this type of pincode checker.
Please share me step by step code.
Thank You
Hello Daniel,
Thank you for your message.
I have a js code but it is not working.
I have already premium theme.
Please share here code details if you can help.
If you need current code structure I will share here.
const sourePincode = pincode add later;
var accessToken = null;
var getTokenSettings = {
“url”: “https://app.com my url add later”,
“method”: “POST”,
“timeout”: 0,
“headers”: {
“Content-Type”: “application/json”
},
“data”: JSON.stringify({
“username”: “abc@gmail.com”,
“password”: “abc123”
}),
};
$.ajax(getTokenSettings).done(function (response) {
accessToken = response.access_token;
});
function getEDDForPincodes(destPincode) {
var settings = {
“url”: “https://app.com add later”,
“method”: “POST”,
“timeout”: 0,
“headers”: {
“Authorization”: Bearer ${accessToken},
“Content-Type”: “application/json”
},
“data”: JSON.stringify({
“srcPin”: sourePincode,
“destPin”: destPincode
}),
};
$.ajax(settings).done(function(response) {
return response.edd.max;
});
}