Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • getsimio.com
French
US English (US)
FR French
  • Accueil

Modifier le thème Shopify

Written by etienne.dubujet

Updated at July 10th, 2025

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Introduction
  • Configuration du compte
    Paramétrer le compte WhatsApp Synchroniser vos applications
  • Collecter des optins
    Général Collecter via Shopify Collecter via Klaviyo Collecter via une publicité Meta
  • Créer des automations
    Général Créer une automation avec Shopify Créer une automation avec Klaviyo Créer une automation avec Splio
  • Créer des campagnes
  • Pour aller plus loin
+ More
  1. Accéder au thème Shopify

  1. Trouver le fichier d’une page produit
  2. Ajouter le code pour collecter le numéro
<input
  class=""
  type="text"
  id="phone-number"
  name="phone-number"
  placeholder="Numéro de téléphone"
>
<button
  type="button"
  id="whatsapp-button"
  style="display:block;width:100%;font-size:16px;font-weight:700;margin-top:10px;line-height:21px;"
  class="bttn"
  disabled
>
  Recevoir une alerte sur WhatsApp
</button>

4. Puis ajouter le code qui transmet cette information à Simio

<!-- SIMIO BACK IN STOCK -->
<script>
    const phoneNumberInput = document.getElementById('phone-number');
    const whatsappButton = document.getElementById('whatsapp-button');

    function handleWhatsAppAlert() {
        whatsappButton.disabled = true;
        whatsappButton.textContent = 'Inscription en cours...';

        const phoneNumber = phoneNumberInput.value.trim();
        const customerId = "{{à demander au support}}";

        if (phoneNumber.length > 8) {
          whatsappButton.disabled = true;
          whatsappButton.textContent = 'Inscription en cours...';

          fetch('https://app.getsimio.com/backinstock/subscribe', {
              method: 'POST',
              headers: {
                  'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                  phoneNumber: phoneNumber,
                  customerId: customerId,
                  variantId: {{ product.selected_or_first_available_variant.id }},
              })
          })
          .then(response => {
              if (response.ok) {
                  return response.text();
              }
              throw new Error('Erreur lors de la requête.');
          })
          .then(data => {
              whatsappButton.textContent = "C'est noté, on vous préviendra dès son retour !";
          })
          .catch(error => {
              console.error(error);
              whatsappButton.textContent = "Une erreur s'est produite";
          });
      }
  }

    phoneNumberInput.addEventListener('input', function() {
        if (phoneNumberInput.value.trim().length > 8) {
            whatsappButton.textContent = "Recevoir une alerte sur WhatsApp";
            whatsappButton.removeAttribute('disabled');
        } else {
            whatsappButton.setAttribute('disabled', 'true');
        }
    });

    whatsappButton.addEventListener('click', handleWhatsAppAlert);
</script>

<!-- --------- -->

 

5. Ajuster le style à votre site

 

Cet article vous a-t-il été utile ?

Oui
Non
Give feedback about this article

Articles connexes

  • 📐 Format et dimensions sur WhatsApp
  • ❤️‍🔥 Best practice : les meilleures campagnes et automations
  • 👨‍👩‍👦‍👦 Importer des contacts via CSV dans Simio
  • 🌶️ Bien débuter : warm up
  • ℹ️ Pré-requis pour configurer son compte

© 2025 SIMIO Logo Simio by Alcmeon Logo Alcmeon

WhatsApp LinkedIn
Expand