Op basis van een postcode een andere url open tbv een bestelsite voor een groep van restaurants zoals op <https://mrsushi.nl>
Add this in a code module
<input type="tel" maxlength="4" id="input_postcode"
class="input_postcode" placeholder="4 cijfers postcode"
style="height: 55px; padding-top: 5.8px; padding-left: 7px;
border:1px solid #000000; background: #ffffff; color: #000000; ">
<button class="nu-bestellen">ZOEKEN</button>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('.nu-bestellen').click(function(){
var zipcode = jQuery('#input_postcode').val();
//LET OP: op 2 plekken postcodes wijzigen, hier en de volgende functie
var region_city000 = ['0000'];
var region_city001 = ['1011', '1012', '1017', '1018'];
var region_city002 = ['6811', '6812', '6813', '6814'];
var region_city999 = ['9401', '9402', '9403', '9404'];
// Open in new tab with:
// window.open("https://www.google.nl");
// Open in same tab with:
// window.location.href = "https://www.google.nl";
if (jQuery.inArray(zipcode, region_city000) !== -1){
window.open("https://www.google.nl");
}
else if (jQuery.inArray(zipcode, region_city001) !== -1){
window.location.href =
"http://amsterdam.mrsushi.nl/index.php?postcode="+postcode;
}
else if (jQuery.inArray(zipcode, region_city002) !== -1){
window.location.href =
"http://arnhem.mrsushi.nl/index.php?postcode="+postcode;
}
else if (jQuery.inArray(zipcode, region_city999) !== -1){
window.location.href =
"http://assen.mrsushi.nl/index.php?postcode="+postcode;
}
else {
window.location.href = "https://mrsushi.nl/eten-bestellen/";
}
});
});
</script>Code language: HTML, XML (xml)