Skip to content

Initial Setup

Complete setup guide for configuring the MUP Compliance App for the first time.

Overview

The initial setup process involves: 1. Setting up metafield definitions 2. Creating the levy product 3. Configuring MUP settings 4. Activating the cart transform function 5. Adding alcohol unit data to products

Step 1: Setup Metafield Definitions

Metafields are used to store MUP configuration and product alcohol unit data.

Via Admin UI

  1. Navigate to MUP Settings in the app
  2. Click the "Setup Metafields" button in the secondary actions
  3. Wait for confirmation that metafields are created

What Gets Created

Shop-level metafields: - custom.mup_levy_product - Levy product variant ID - custom.minimum_unit_price - Minimum price per unit (default: 0.65) - custom.mup_enforcement_enabled - Enable/disable enforcement

Product variant-level metafields: - custom.total_units - Alcohol units per item - custom.abv_percentage - ABV percentage (optional, for calculation) - custom.volume_ml - Volume in milliliters (optional, for calculation)

Step 2: Create Levy Product

The levy product is used to add MUP charges as child line items in the cart.

Via Admin UI

  1. Go to MUP Settings
  2. Click "Create Levy Product" button next to the levy variant ID field
  3. The product will be created automatically with:
  4. Title: "MUP Levy"
  5. Handle: "mup-levy"
  6. Product Type: "Fee"
  7. Tags: mup, levy, compliance, scotland

Important Notes

  • The levy product is automatically published to the Online Store sales channel
  • The variant ID is automatically saved to custom.mup_levy_product metafield
  • You can use an existing product if preferred - just enter its variant ID manually

Step 3: Configure MUP Settings

Required Settings

  1. Levy Product Variant ID
  2. Should be auto-filled if you created the levy product in Step 2
  3. Format: gid://shopify/ProductVariant/123456789 or just 123456789

  4. Minimum Unit Price

  5. Default: 0.65 (Scotland's MUP)
  6. Enter as decimal number (e.g., 0.65)

  7. Enable MUP Enforcement

  8. Check to enable MUP rules
  9. Uncheck to disable (useful for testing)

Save Settings

Click "Save Settings" to persist your configuration.

Step 4: Add Validation Function to Checkout Rules

The validation function must be added to your checkout rules to block non-compliant orders.

Steps

  1. Go to Shopify AdminSettingsCheckout
  2. Scroll to Checkout rules section
  3. Click "Add a checkout rule"
  4. Select "Cart validation" as the rule type
  5. Find and select "MUP Validation" function
  6. Click "Save"

Verification

After adding the validation function: - It will run automatically at checkout - Blocks checkout if MUP violation detected - Shows error message to customer

Note: The validation function is automatically deployed with the app, but must be added to checkout rules manually.

Step 5: Add Alcohol Unit Data to Products

Products need alcohol unit data for MUP calculations. See the Product Setup Guide for detailed instructions.

Quick Method

  1. Go to Products in Shopify Admin
  2. Select a product
  3. Scroll to Metafields section
  4. Add custom.total_units with the alcohol units value
  5. Save

Bulk Method

Use the Health Check feature to: - Identify products missing data - View which products need alcohol unit information

Verification Checklist

  • [ ] Metafield definitions created
  • [ ] Levy product created and variant ID saved
  • [ ] MUP settings configured
  • [ ] Validation function added to checkout rules
  • [ ] At least one test product has alcohol unit data
  • [ ] Tested adding product to cart with Scotland region selected

Next Steps

Troubleshooting

Metafields not appearing? - Run "Setup Metafields" again (safe to run multiple times) - Check Shopify Admin → Settings → Custom data for metafield definitions

Levy product not working? - Verify product is published to Online Store sales channel - Check that variant ID is correct in settings - Ensure product is not draft or archived

Validation not blocking checkout? - Verify validation function is added to checkout rules - Check that function is enabled in checkout rules - Ensure MUP enforcement is enabled in settings

For more help, see Troubleshooting.