Select Page
Methods Documentation
Edit on
Codepen.io

fastspring.builder.add(productId)

Takes product ID as input, adds product to cart.


x
29
 
1
<!--
2
    DEMO INFO
3
    Add will change the selected attribute of a product from false to true. It will not change
4
    the quantity of an item.
5
-->
6
7
<!-- Configure an add button to add an item to the cart. -->
8
<button onclick="fastspring.builder.add('phot-io-main-app');">Add to cart</button>
9
10
<!--
11
    DEMO EFFECTS
12
-->
13
<br /><br />
14
<div>
15
    Is phot-io-main-app in cart:
16
    <span data-fsc-item-path="phot-io-main-app" data-fsc-item-selected></span>
17
</div>
18
19
<!--
20
    DEMO SETUP
21
        - Initialize the Store Builder Library
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-continuous="true">
29
</script>
1
 
1
1
 
1

Related Topics