Uname: Linux webm012.cluster130.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 8.0.30 [ PHP INFO ] PHP os: Linux
Server Ip: 145.239.37.162
Your Ip: 216.73.216.190
User: dreampi (1009562) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : checkout.js
function setAmeliaFieldValue(selector, value) {
  let element = document.querySelector(selector);

  if (typeof element !== 'undefined' && element) {
    const valueSetter = Object.getOwnPropertyDescriptor(element, 'value').set;
    const prototype = Object.getPrototypeOf(element);
    const prototypeValueSetter = Object.getOwnPropertyDescriptor(prototype, 'value').set;

    if (valueSetter && valueSetter !== prototypeValueSetter) {
      prototypeValueSetter.call(element, value);
    } else {
      valueSetter.call(element, value);
    }

    element.dispatchEvent(new Event('input', { bubbles: true }));
  }
}

document.addEventListener('DOMContentLoaded', function() {
  if ('ameliaCustomer' in window) {
    let ameliaCustomerInterval = setInterval(
      function () {
        if (document.body.classList.contains('woocommerce-checkout')) {
          clearInterval(ameliaCustomerInterval);

          Object.keys(ameliaCustomer).forEach((key) => {
            setAmeliaFieldValue('#' + key, ameliaCustomer[key]);
          })
        }
      }, 500
    )
  }

  if ('ameliaNote' in window && window.ameliaNote.length) {
    const injectCustomContent = () => {
      document.querySelectorAll('.wc-block-components-product-details').forEach((el) => {
        if (!el.querySelector('.amelia-custom-html')) {
          const div = document.createElement('div');
          div.className = 'amelia-custom-html';
          div.innerHTML = '<div>' + window.ameliaNote[0] + '</div>';
          el.appendChild(div);
        }
      });
    };

    injectCustomContent();

    // Use MutationObserver to handle async block rendering
    const observer = new MutationObserver(injectCustomContent);
    observer.observe(document.body, { childList: true, subtree: true });
  }
});
© 2026 GrazzMean-Shell