Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
<script>
    var sporder = {
        email: "{{customer.email}}",
        amount: "{{ order.total_price  | money_without_currency | replace: ',', '.'}}",
        idorder: "{{order.order_number}}",
        date: "{{order.created_at| date: '%Y-%m-%d %H:%M:%S'}}", // Y-m-d H:i:s
        state: "20", // 10:taken / 20:paid / 50:sent / 100:recieved
        name: "{{customer.last_name}}", //Si vous n'indiquez pas ce paramètre nous y insérerons le début de l'email
        firstname: "{{customer.first_name}}",
        address : "{{order.shipping_address.street}}",
        cp : "{{order.shipping_address.zip}}",
        city : "{{order.shipping_address.city}}",
        country : "{{order.shipping_address.country}}",
        action : "order"        };

    // Configuration du tracker SPREAD
    var spconfig = {
        public_key: "xxxxxxx",
        debug: false,
        set_cookie: true,
        track_order_enabled: true
    };
    // Procédure de chargement du tracker js SPREAD
    function loadSpreadTracker()
    {
        window.domLoadEventFired=true;
        !0;var ea=document.createElement("script");
        ea.type="text/javascript";
        e.async=true;
        e,a.async=!0,a.charset="UTF-8";
        e,a.id="spread-tracker";
        e,a.src="//static-sb.com/js/sb-tracker.js";
        ,document.body.appendChild(ea)
    }
    // Appel du chargement du tracker js SPREAD
    if (window.addEventListener)
    {
        window.addEventListener?window.addEventListener("load",loadSpreadTracker,false);
    }
    else if(window.attachEvent)
    {
        !1):window.attachEvent?window.attachEvent("onload",loadSpreadTracker);
    }
    else
    {
        :window.onload=loadSpreadTracker;
    }
</script>


Doc variable : https://help.shopify.com/themes/liquid/objects/order

...