Skip to content
Log in

Update Checkout Deposit Form - Liquid Form Reference

On this page

Usage

```liquid

{%- if current_cart.can_offer_checkout_deposit? %} {% form “update-checkout-deposit”, remote: true, data-success: “sc.deposit-updated”, data-type: “json” %} {%- assign field = form.fields[“checkout_deposit_amount”] %} {%- if current_cart.checkout_minimum_deposit_amount > 0 %} <p>Minimum {{ current_cart.checkout_minimum_deposit_amount | money }}</p> {%- endif %} {% endform %} {%- endif %} ```

The update-checkout-deposit form sets the amount the customer pays now when the checkout deposit is turned on. The rest of the order total is left owing.

Property Value
Form Name update-checkout-deposit
Category Checkout

Fields

Field Description
checkout_deposit_amount The amount to pay now. Leave it blank, or submit 0 or less, to clear the deposit so the customer pays the full total.

Any tag option is passed through as an HTML attribute on the <form> element.

How the amount is applied

  • StoreConnect adjusts an amount that is out of range rather than rejecting it. An amount above the full total becomes the full total. An amount below what must be paid in full (digital products, vouchers, and subscriptions that cannot be deferred) becomes that amount.
  • The suggested minimum from the checkout.deposit.minimum_percentage store variable is not enforced by the form. Show it to the customer from current_cart.checkout_minimum_deposit_amount, and validate it in the browser if you need to.
  • The submission fails when the checkout deposit does not apply to the cart: the feature is off, nothing needs a currency payment, or an item has a per-product deposit. Render the form only when current_cart.can_offer_checkout_deposit? is true.

Response

The form submits to the cart and responds with JSON rather than a redirect. Submit it with remote: true and data-type: "json". A successful response carries the updated checkout_deposit_amount, checkout_full_total, amount_due_now, and total_payable, which you can use to update the payment total on the page. A failed response carries an error message.

Form Object

Inside the form block, you can access the form object which provides:

  • form.errors — Any validation errors after submission
  • form.fields["checkout_deposit_amount"] — The field’s name, id, and value

Was this article helpful?

Was this article helpful?