Create complex validation rules
You can use Cart and Checkout Validation Functions to ensure that purchases meet certain criteria before customers can complete an order. In this tutorial series, you’ll use Shopify Functions to enforce product limits on store merchandise.
What you'll learn
Anchor link to section titled "What you'll learn"In this tutorial series, you’ll learn how to do the following tasks:
- Create a validation function.
- Add configuration using metafields.
- Build a validation settings user interface using Admin UI Extensions.
Requirements
Anchor link to section titled "Requirements"- You've created a Partner account.
- You've created a development store with the Checkout and Customer Accounts Extensibility developer preview enabled.
You've created an app that uses Shopify CLI 3.49.5 or higher. If you previously installed Shopify CLI, then make sure that you're using the latest version.
If you plan to create a UI for your extension, then start with the Remix app template.
You've installed Node.js 16 or higher.
You've installed your app on the development store with the Checkout and Customer Accounts Extensibility developer preview enabled.
Rust-specific requirements
Anchor link to section titled "Rust-specific requirements"The following requirements are specific to Rust-based development with Shopify Functions.
You've installed Rust.
On Windows, Rust requires the Microsoft C++ Build Tools. Make sure to select the Desktop development with C++ workload when installing the tools.
You've installed cargo-wasi:
Tutorial series
Anchor link to section titled "Tutorial series"Follow the tutorial series to go from "Hello World" to a functional custom validation experience.
Developer tools and resources
Anchor link to section titled "Developer tools and resources"Explore the following developer tools and resources to get familiar with building payment customizations.
- Get started with building validations.