import { window, rendering } from "@wix/site-window"; import { getCountryFromCoords } from 'backend/location.web.js'; $w.onReady(async () => { if ((await rendering.env()) === "browser") { try { const geo = await window.getCurrentGeolocation(); console.log('Full Geolocation Object: ', geo); const longitude = geo.coords.longitude; const latitude = geo.coords.latitude; const countryName = await getCountryFromCoords(longitude, latitude); if (countryName) { $w('#subheading').text = "We detected you are accessing our site from"; $w('#country').text = countryName; } else { $w('#country').text = "Could not determine your country." } } catch (error) { $w('#country').text = "Failed to get your location. Make sure Geolocation is enabled and try again later."; } } });
top of page

All Products

This is your category description. It’s a great place to tell customers what this category is about, connect with your audience and draw attention to your products.
This is your category description. It’s a great place to tell customers what this category is about, connect with your audience and draw attention to your products.
bottom of page