LogoLogo
  • 👋Function Junction
    • Introduction
    • Why should I use it?
    • Shopify Function Examples with Function Junction
  • Getting Started
    • Shopify Scripts Are Ending: How to Migrate Shopify Scripts to Function Junction
    • Function Junction Overview
  • Templates
    • Shopify Function Product Discount Template
    • Shopify Function Discount by Customer Tag Template
    • Shipping discount
    • Order discount
    • Free shipping to VIP customers
    • Shopify Function Bundle Discount Template
  • ✨Function Types
    • Creating and publishing
    • Discounts
      • Conditional discounts
      • Shipping discounts
      • Tiered discounts
      • Bundle discounts
      • Bundle fixed price
    • BOGO (Buy One, Get One)
    • Cart and checkout validations
    • Customize payment options at checkout
  • FAQ
    • Frequently asked questions
  • Privacy Policy
Powered by GitBook
On this page
  • In this section:
  • Creating a cart & checkout validation function
  • Step 1 of 3:
  • Step 2 of 3:
  • Step 3 of 3:
  • Example of a cart & checkout validation function
Export as PDF
  1. Function Types

Cart and checkout validations

Learn about cart and checkout validation functions

PreviousBOGO (Buy One, Get One)NextCustomize payment options at checkout

Last updated 2 days ago

Cart and checkout validation lets you control when a customer can proceed to checkout by applying custom rules to their cart.

For example, you can require a minimum spend of $20, prevent checkout if a restricted item is in the cart for certain regions, or limit the total number of items purchased. This feature is useful for enforcing shipping restrictions, setting purchase limits, or applying order rules without impacting every customer.

In this section:


Creating a cart & checkout validation function

Step 1 of 3:

  1. From the Function Junction dashboard, click Create a function.

  2. Beside Cart & Checkout Validation, click Continue.

  3. Under Function name, give your discount a unique name so you can identify it later.

  4. Under Condition type, click the drop-down and select one of the following:

    1. Standard: The most commonly used and well-balanced settings.

    2. Delivery: For conditions that are more related to shipping and delivery.

  5. Click Next.

Step 2 of 3:

  1. Define the condition that activates the function:

    1. From the drop-down menu, select the condition that you want the cart validation to be based on like cart subtotal is greater than $15

    2. Optional: Click Add a condition to add any additional conditions that you want.

    3. Click Next.

Step 3 of 3:

  1. Define the error messages to be displayed to the customer when the condition is met.

    1. Under Customer flow, click the drown-down menu and select the condition that triggers the cart validation error message.

    2. Under Error message, enter the message that you want to display to customers.

    3. Under Display location, click the drop-down menu and select where you want the message to be displayed to the customer.

  2. Optional: If you want to add additional error messages for different locations, click Add error message and repeat steps 1a through 1c.


Example of a cart & checkout validation function

In this example, Akio wants to set up a minimum order value of $50 required for customers to check out.

  • Function name: In this case, Akio would give his cart validation function a name like Minimum spend cart validation so that he can identify it later.

  • Condition type: Since he wants this to apply to a minimum spend, not related to delivery, he would leave the condition type set to Standard.

  • Conditions: In step 2, because he wants this to be exclusive to carts with at least $50 worth of product he needs to add the condition:

    • if cart subtotal is less than $50

  • Error messages: In step 3, Akio would enter the error messages he wants to present customers when they reach certain stages of the checkout.

    • Customer flow: He wants the error message to come up any time during customer interaction with the cart or checkout process, so he leaves Customer flow set to All

    • Error message: He wants the error to read Unable to complete checkout, cart total needs to meet $50 so he would add this message under Error message.

    • Display location: He wants the error message to be displayed in the customer's cart so he leaves the Display location set to Cart.

✨
Creating a cart & checkout validation function
Example of a cart & checkout validation function