Skip to content

Product Metafields Guide

Detailed guide to product metafields used by the MUP app.

Required Metafields

custom.total_units

Type: Number (decimal)
Required: Yes (or provide ABV + Volume)
Description: Total alcohol units per item

How to add: 1. Go to Product → Metafields 2. Add custom.total_units 3. Enter the units value (e.g., 2.5)

Example values: - 2.5 (for a 500ml can at 5% ABV) - 9.0 (for a 750ml bottle at 12% ABV) - 1.32 (for a 330ml bottle at 4% ABV)

Optional Metafields

custom.abv_percentage

Type: Number (decimal)
Required: No (only if not using total_units)
Description: Alcohol by volume percentage

How to add: 1. Go to Product → Metafields 2. Add custom.abv_percentage 3. Enter the ABV value (e.g., 5.0 for 5%)

Example values: - 4.0 (4% ABV - typical beer) - 5.0 (5% ABV - standard beer) - 12.0 (12% ABV - wine) - 40.0 (40% ABV - spirits)

custom.volume_ml

Type: Number (integer)
Required: No (only if not using total_units)
Description: Product volume in milliliters

How to add: 1. Go to Product → Metafields 2. Add custom.volume_ml 3. Enter the volume (e.g., 500 for 500ml)

Example values: - 330 (330ml can/bottle) - 500 (500ml can/bottle) - 750 (750ml bottle) - 1000 (1 liter bottle)

Calculation Priority

The app uses metafields in this order:

  1. custom.total_units - If present, used directly (highest priority)
  2. custom.abv_percentage + custom.volume_ml - Calculated if total_units is missing
  3. No data - Product skipped (no MUP enforcement)

Multiple Variants

Each product variant can have different metafield values:

Example: - Variant 1: 330ml can → total_units: 1.32 - Variant 2: 500ml can → total_units: 2.5 - Variant 3: 750ml bottle → total_units: 9.0

Make sure to add metafields to each variant that needs MUP enforcement.

Viewing Metafields

In Shopify Admin: 1. Go to Products 2. Select a product 3. Scroll to Metafields section 4. View all metafields for that product

In Product API: Metafields are accessible via: - Shopify Admin API - Storefront API - Cart transform function

Troubleshooting

Metafield not appearing? - Verify metafield definition exists (run "Setup Metafields") - Check namespace is custom and key matches exactly - Ensure you're viewing the correct product variant

Value not being used? - Check data type matches (number, not text) - Verify value is saved (not just entered) - Ensure product is published

Calculation wrong? - Double-check ABV and volume values - Verify formula: (ABV% × Volume ml) / 1000 - Compare with manual calculation

For more help, see Troubleshooting.