Select Page
Edit on
Codepen.io

Apply Order Level Tags


x
38
 
1
<!--
2
    DEMO INFO
3
    fastspring.builder.tag() allows you to attach custom attributes as key value pairs
4
        to orders.
5
-->
6
<button id="push-button" onclick="fastspring.builder.tag({'myKey':'myValue'});">Add Tag</button>
7
8
<!--
9
        DEMO EFFECTS
10
-->
11
<br>
12
<br>
13
<div>
14
        Order Level Tags: <span id="key"></span>
15
</div>
16
17
<!--
18
        DEMO SETUP
19
                - Initialize the Store Builder Library
20
                - data-data-callBack function that allows us to parse the response and
21
                    display the tags that were attached to the order
22
-->
23
<script
24
        id="fsc-api"
25
        src="https://sbl.onfastspring.com/sbl/1.0.2/fastspring-builder.min.js"
26
        type="text/javascript"
27
        data-storefront="fastspringexamples.test.onfastspring.com/popup-fastspringexamples"
28
        data-data-callback="dataCallbackFunction">
29
</script>
30
<script type="text/javascript">
31
    function dataCallbackFunction(fsdata)
32
    {
33
        if (fsdata.tags)
34
        {
35
            document.getElementById("key").append(JSON.stringify(fsdata.tags));
36
        }
37
    }
38
</script>
1
 
1
1
 
1

Related Topics