Set billing details for the InLine Checkout

Overview

Pre-set the billing details for the InLine checkout.

Use case

  1. Add an HTML link or button in your page like the one below.

  2. Create a JavaScript click handler to execute the Inline client desired methods.

  3. Use theTwoCoInlineCart.products.add({code, quantity, options})method to prepare your catalog product.

  4. Call any of the following methods to pre-set the billing details:

    TwoCoInlineCart.billing.setName('John Snow');
      TwoCoInlineCart.billing.setEmail('[email protected]');
      TwoCoInlineCart.billing.setPhone('+33 892 70 12 39');
      TwoCoInlineCart.billing.setCountry('FR');
      TwoCoInlineCart.billing.setCity('Paris');
      TwoCoInlineCart.billing.setState('');
      TwoCoInlineCart.billing.setZip('75007');
      TwoCoInlineCart.billing.setAddress('Champ de Mars');
      TwoCoInlineCart.billing.setAddress2('5 Avenue Anatole');
  5. If you want to reset the billing details, call theTwoCoInlineCart.billing.reset()method.

  6. Use theTwoCoInlineCart.cart.checkout()method to display the cart on your page.

Sample request

HTML

JavaScript

Demo

After setting the billing details for the InLine cart using the above methods, your cart should look like this:

Last updated

Was this helpful?