Browse articles

Show pay-later or installment text in the cart

Show "or 3 payments of $9.00" next to the checkout button and keep it in sync with the cart total, with your provider's widget or Custom HTML.

Last updated

A line like "or 3 interest-free payments of $9.00" right above the checkout button reminds customers they can split the payment. Because the cart total changes while the customer edits the cart, the text has to update with every change. This recipe shows two ways to do that with Custom HTML (Professional plan).

Most pay-later providers (Afterpay, Klarna, Scalapay and others) offer a messaging widget that calculates the installments and shows their own terms. Use it whenever you can: a split you calculate yourself can differ from what the provider actually charges.

  1. Get the widget code

    Copy the cart or product messaging code from your provider's dashboard or documentation.

  2. Add it to the cart

    Go to Cart designerCustom HTML, tick Enable on Above checkout button and paste the code. If the widget scans the page for its markup, also tick Widget mode.

  3. Keep the amount in sync

    Widgets that read the amount from an attribute need the current cart total after every change. Ask the AI generator, for example: "Set the data-amount attribute of the afterpay-placement element to the cart total in currency units, and update it on every cart change."

For Scalapay there is a step-by-step guide: Scalapay.

Option 2: your own text

If your provider has no widget, show the text yourself. Ask the AI generator something like: "Show 'or 3 installments of {amount} with' followed by this logo: (link to your logo in Shopify Files). {amount} is the cart total divided by 3 in the store's currency. Update it on every cart change."

Or paste this code into Above checkout button and change the number of installments and the logo link:

<div class="tw-flex tw-items-center tw-justify-center tw-mt-1 tw-text-sm tw-text-primary">
  <span>or 3 installments of <b class="installment-amount"></b> with</span>
  <img src="https://cdn.shopify.com/s/files/YOUR-LOGO.png" alt="Payment provider" class="tw-ml-2 tw-h-4 tw-object-contain" />
</div>

<script>
  (function () {
    var INSTALLMENTS = 3;

    function formatMoney(cents) {
      var currency = (window.Shopify && window.Shopify.currency && window.Shopify.currency.active) || "USD";
      return new Intl.NumberFormat(document.documentElement.lang || undefined, {
        style: "currency",
        currency: currency
      }).format(cents / 100);
    }

    function updateInstallments(cart) {
      var root = window.eliteCartDocumentOrShadowRoot || document;
      var amount = root.querySelector(".installment-amount");
      if (!amount || !cart) return;
      amount.textContent = formatMoney(Math.ceil(cart.total_price / INSTALLMENTS));
    }

    updateInstallments(window.EliteCart.getCurrentCart());

    if (!window.__ecInstallmentsBound) {
      window.__ecInstallmentsBound = true;
      window.EliteCart.onCartChange(updateInstallments);
    }
  })();
</script>

The code reads the customer's currency from your store, so it stays correct in every market. Upload your logo under Content → Files in Shopify and copy its link.

Good to know

  • Check your provider's rules for how the amount must be stated (minimum and maximum order values, rounding, legal wording). Their widget handles this for you; your own text doesn't.
  • Keep window.eliteCartDocumentOrShadowRoot and the window.__ecInstallmentsBound line when you edit the code. They make it work with Shadow DOM and stop the listener from being added twice. See Custom HTML for developers.

Still stuck?

Chat with us and we'll help you get your cart live. Or email contact@elitecart.app.