Select Page
Methods Documentation
Edit on
Codepen.io

fastspring.builder.promo(code)

Takes coupon code as input, applies it to the cart.


x
41
 
1
<!--
2
    DEMO INFO
3
    promo() will apply the buyer supplied promotion code to FastSpring. If FastSpring evaluates the code as valid it will change the pricing information to reflect the discount
4
-->
5
<!-- Define Input field to accept coupon code: -->
6
<input type="text" name="Coupon" id="coupon-code">
7
8
<!--Define to grab coupon code and send to FastSpring -->
9
<button onclick="fastspring.builder.promo(document.getElementById('coupon-code').value);">Apply Coupon</button>
10
11
<!--
12
    DEMO EXTRA INFO
13
-->
14
<br /><br />
15
<div>
16
    Coupon code for demo: free
17
</div>
18
19
<!--
20
    DEMO EFFECTS
21
-->
22
<br /><br/>
23
<div>
24
    Order Total: <span data-fsc-order-total></span>
25
</div>
26
27
<!--
28
    DEMO SETUP
29
        - Initialize the Store Builder Library
30
        - Add item to the cart
31
-->
32
<script
33
    id="fsc-api"
34
    src="https://sbl.onfastspring.com/sbl/1.0.2/fastspring-builder.min.js"
35
    type="text/javascript"
36
    data-storefront="fastspringexamples.test.onfastspring.com/popup-fastspringexamples">
37
</script>
38
39
<script type="text/javascript">
40
    fastspring.builder.add('phot-io-main-app');
41
</script>
1
 
1
1
 
1

Related Topics