1. Include sale.js in HTML page and configure it.
<script src="http://salejs.com/v1/cart.js"></script>
<script>
cartjs.initialize({
emailOrdersTo : 'your-shop@mail.com',
// Optional configuration options.
language : 'english', // 'russian' also available.
currency : '$',
requireName : true, // Require name in contact form.
requirePhone : true, // Require phone in contact form.
requireEmail : false, // Require email in contact form.
requireAddress : false, // Require address in contact form.
})
</script>
2. Add Cart Button
<a href="#" class="cart-button" style="display: none;">
<span class="cart-button-quantity"></span>
<span class="cart-button-label"></span>
<!-- Or put an image here instead of span elements with text. -->
</a>
3. Add Buy Buttons for Products
<a href="#" class="cart-buy-button"
data-name="Nexus"
data-price="450"
data-quantity="1"
>Buy $450</a>
or using JavaScript
cartjs.add({
name : "Nexus",
price : 450,
quantity : 1
})
4. Optionally you can alter position of Cart Popup
<style>
.bootstrap-widget .popover {margin-left: -10px !important;}
.bootstrap-widget .popover .arrow {margin-left: 10px !important;}
</style>
Also, use this page as example