Skip to main content

Overview

This tutorial shows you how to add a checkbox beneath the checkout button that requires customers to agree to your store’s terms and conditions. When unchecked, the checkout and express payment buttons are disabled. This is a great way to ensure legal compliance, set clear expectations, and add professionalism to your cart experience.

What this customization does

  • Adds a terms and conditions checkbox under the checkout button
  • Prevents customers from checking out until they agree
  • Blocks the standard checkout button. On Version 1 of the express payments module it also greys out the express buttons — see the note below if you’re on Version 2
  • Supports fully customizable text and link
This customization requires basic HTML, JavaScript, and CSS. It is best for store owners or developers with beginner coding knowledge.
The express-button half is Version 1 only. The script looks for #upcart-additional-checkout-buttons and the CSS styles .upcart-express-pay-button — both belong to the Version 1 express payments module. Version 2 renders #upcart-express-payments and clones Shopify’s own buttons, which carry neither selector, so express checkout stays clickable even when the box is unticked. The standard checkout button is blocked on both versions.

Step 1: Add custom HTML

  1. Go to Upcart > Cart Editor > Settings > Custom HTML
  2. Paste the following in Above announcements/rewards:
Legacy note: window.upcartOnCartLoaded callbacks still work but are deprecated and log console warnings. Use upcartSubscribeCartLoaded for all new scripts.
  1. Paste the following in Below checkout button. Update the link and text to match your store’s terms:

Step 2: Add custom CSS

  1. Go to Upcart > Cart Editor > Settings > Custom CSS
  2. Paste the following to control styling:
You can change the colors to match your branding by updating color, background-color, and opacity values.

Final result

When customers open the cart:
  • Checkout and express buttons are disabled until the checkbox is ticked
  • A red warning message appears if they try to proceed without agreeing
  • Once the box is checked, all buttons become active

Need help?

For advanced implementations or more complex requirements, we recommend working with a Shopify Expert. Upcart’s support team does not assist with writing or troubleshooting custom code. See Shopify Experts