Recipes are built-in Function templates you can apply from the Function editor. Use them when you want a reliable starting point for a common computed attribute. To use a recipe, create a Computed Attribute, open Templates, choose the recipe, preview it on a product, and save.Documentation Index
Fetch the complete documentation index at: https://docs.uselayers.com/llms.txt
Use this file to discover all available pages before exploring further.
Discount Percentage
Discount Percentage
Description: The percentage discount calculated from compare-at price to current price. Returns 0 if no discount is available.Use case: Sort products by discount amount or filter for products on sale. Create “Biggest Discounts” collections or exclude heavily discounted items from premium merchandising.Input used: Price range.Output: Number.Example: A product with a compare-at price of 75 has a discount percentage of 25.
Variant Count
Variant Count
Description: The total number of variants for this product. Useful for filtering or sorting by product complexity.Use case: Identify products with many options (high variant count) or single-variant products. Filter out products with too many variants from certain collections.Input used: Variants.Output: Number.Example: A t-shirt available in 5 colors and 4 sizes (20 combinations) has a variant count of 20.
Average Margin
Average Margin
Description: Average profit margin across variants, calculated as (price - cost) / price for each variant with cost data. Excluded from the product if no variants have cost information (the formula evaluates to null).Use case: Sort products by profitability or filter for high-margin items. Create “Best Margin” collections for merchandising or exclude low-margin products from promotional campaigns.Input used: Variant price and cost.Output: Number.Example: A product with two variants (price=5 and price=10) has an average margin of 0.5 (50%).
SKU Coverage
SKU Coverage
Description: Ratio between available variants and total variants. Returns null when a product has no variants.Use case: Identify products that are partially unavailable or need catalog cleanup.Input used: Variant availability.Output: Number.Example: A product with 3 available variants out of 4 total variants has SKU coverage of 0.75.
Days Available
Days Available
Description: The number of days since the product became available, based on the product published date.Use case: Build “new arrivals” rules, identify aging products, or sort by freshness.Input used: Published date.Output: Number.Example: A product published on 2026-04-01 returns 40 on 2026-05-11.
Age of Newest Variant
Age of Newest Variant
Description: The number of days since the newest variant was created.Use case: Identify products with recently added variants or updated options.Input used: Variant creation dates.Output: Number.Example: If the newest variant was created on 2026-05-01, the value is 10 on 2026-05-11.