- Choosing a selection results in a full page refresh.
- Press the space key then arrow keys to make a selection.
- Use left/right arrows to navigate the slideshow or swipe left/right if using a mobile device
document.addEventListener("DOMContentLoaded", function() {
const notifyForm = document.getElementById("notify-me-form");
if (notifyForm) {
notifyForm.addEventListener("submit", function(event) {
event.preventDefault();
let email = document.getElementById("notify-email").value;
let productId = "";
fetch(`/admin/api/2023-04/products/${productId}/metafields.json`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Requested-With": "XMLHttpRequest"
},
body: JSON.stringify({
metafield: {
namespace: "notify_me",
key: "emails",
value: email,
type: "json"
}
})
})
.then(response => response.json())
.then(data => {
document.getElementById("notify-message").style.display = "block";
notifyForm.reset();
})
.catch(error => console.error("Error:", error));
});
}
});