import wixLocation from 'wix-location'; import {fetch} from 'wix-fetch'; $w.onReady(function () { // Fetch the user's location details fetch('https://api.ipgeolocation.io/ipgeo?apiKey=4241935f677c411086fc50788f269d98', { method: 'get' }) // Check if the request was successful .then((httpResponse) => { if (httpResponse.ok) { return httpResponse.json(); } }) .then((json) => { // Set the user's countryCode as a const if(["IN", "HK", "CN"].includes(json.country_code2) || !["NA", "EU", "OC"].includes(json.continent_code) && wixLocation.path !== "blocked-page"){ // Redirect to "Not Available" page wixLocation.to("/blocked-page"); } }); })
 

Duckling Bouquet

$40.00Price