Hi,
Hope this will work
- Create a custom Shopify app with customer/metafield access
- Build a secure API endpoint to update visited stadiums
- Add frontend JavaScript to call that endpoint
JavaScript example
document.querySelectorAll('.mark-visited').forEach(button => {
button.addEventListener('click', async () => {
const stadiumId = button.dataset.stadiumId;
const customerId = window.customerId; // Pass this from Liquid if needed
const res = await fetch('https://your-backend.com/mark-visited', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ customerId, stadiumId })
});
const data = await res.json();
if (data.status === 'success') {
button.textContent = 'Besøgt';
}
});
});
- Use metafields to store and show visited stadiums
- Protect everything with login checks and access control