Select Page
Methods Documentation
Edit on
Codepen.io

fastspring.builder.update(productId,qty)

Takes product ID and quantity as input, updates specified product’s quantity in the cart. Example: (‘product-path’,1)


x
41
 
1
<!--
2
    DEMO INFO
3
    fastspring.builder.update() changes the quantity of a product.
4
-->
5
<select id="quantity">
6
    <option value="1">1</option>
7
    <option value="2">2</option>
8
    <option value="3">3</option>
9
    <option value="4">4</option>
10
    <option value="5">5</option>
11
</select>
12
13
<button onclick="fastspring.builder.update('phot-io-main-app', document.getElementById('quantity').value);">Update Quantity</button>
14
15
<!--
16
    DEMO EFFECTS
17
-->
18
<br /><br />
19
<div>
20
    Quantity: <span data-fsc-item-path="phot-io-main-app" data-fsc-item-quantity></span>
21
</div>
22
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 in 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