Active Products Validator
Validates that all products in the cart are active and available for purchase.
Overview
The Active Products Validator checks that every product and variant in the cart has an active status. If any product or variant is inactive, the validator returns an error for each affected SKU, preventing the cart from being converted to an order.
Identifier
| Property | Value |
|---|---|
| Connector ID | activeProductsValidator |
| Validation Type | Product |
| Validation Scope | LineItem |
Behavior
- Collects all SKU codes from the cart's line items
- Looks up the corresponding products
- If no products are found for the given SKUs, returns a "No hits" error
- For each product:
- If the product is a standalone SKU and is inactive, adds an error
- If the product has variants, checks that both the parent product and the matching variant are active
- Returns one validation error per inactive SKU
Error messages
| Condition | Message | Translation Key |
|---|---|---|
| No products found for SKUs | "No hits" | NoHits |
| Product or variant is inactive | "Inactive product: {skuId}" | InactiveProductValidatorErrorMessage |
Configuration
No additional properties required.
