<div class="container">
<div class="row justify-content-md-center mt-5">
<div class="col-12">
<div class="card">
<div class="card-body">
<h5 class="card-title">Inline checkout using auto-advance</h5>
<p class="card-text">
In this example the product <span class="badge badge-info">2Checkout Monthly Subscription</span> will be used, all billing fields will be prefileld with shopper data and the Inline Cart will auto-advance to the payment step using <span class="badge badge-info">TwoCoInlineCart.cart.setAutoAdvance(true)</span> <br/>
Click the button bellow to open the Inline Cart.
</p>
<a href="#" class="btn btn-success" id="buy-button">Buy now!</a>
</div>
</div>
</div>
</div>
</div>
window.document.getElementById('buy-button').addEventListener('click', function() {
TwoCoInlineCart.products.add({
code: "74B8E17CC0"
});
TwoCoInlineCart.billing.setData({
name: 'John Doe',
email: 'john.doe@2checkout.com',
country: 'FR',
});
TwoCoInlineCart.cart.setAutoAdvance(true);
TwoCoInlineCart.cart.checkout();
});