Snippets

loopingo Shopify Integration - Boxed

Created by Friedrich Roell last modified
<script>
    (function() {
        Shopify.Checkout.OrderStatus.addContentBox(`<div id="loopingo-integration-container"></div>`)

        let user_data = {
            token         : "00000000-0000-0000-0000-000000000000",
            order_id      : "{{ checkout.order.name }}",
            voucher_code  : "{{ checkout.discounts.first.code }}",
            email         : "{{ checkout.email }}",

            country       : "{{ checkout.billing_address.country_code }}",
            postal_code   : "{{ checkout.billing_address.zip }}",
            order_amount  : "{{ checkout.order.total_price | money_without_currency }}",

            first_name    : "{{ checkout.billing_address.first_name }}",
            last_name     : "{{ checkout.billing_address.last_name }}",
            city          : "{{ checkout.billing_address.city }}",
            street        : "{{ checkout.billing_address.street }}"
        }  

        let props = document.createElement('script')
        props.setAttribute('type', 'text/props')
        props.innerText = JSON.stringify(user_data)
        
        setTimeout(() => document.getElementById('loopingo-integration-container').appendChild(props), 10)
    })();
</script>
<script async src="https://integration.loopingo.com/bundle_v1.js" type="text/javascript"></script>

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.