SyliusPickupPointPlugin
SyliusPickupPointPlugin copied to clipboard
Js label fetcher is missing
This issue is detailed here as well : https://github.com/Setono/SyliusPickupPointPlugin/pull/50#issuecomment-851886998 The following piece of code fixes that, but I think it should be in the main asset too.
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.setono-sylius-pickup-point-label').forEach((elt) => {
fetch(elt.dataset.url)
.then((response) => response.json())
.then((response) => {
elt.innerHTML = `<strong>Livraison point relais</strong><br/>
${response.name}<br/>
${response.full_address}<br/>
`
elt.style.display = 'block';
})
})
})