Initial Setup
Complete setup guide for configuring the MUP Compliance App for the first time.
Overview
The initial setup process involves:
-
Setting up metafield definitions
-
Creating the levy product
-
Configuring MUP settings
-
Activating the cart transform function
-
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
-
Navigate to MUP Settings in the app
-
Click the "Setup Metafields" button in the secondary actions
-
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
-
Go to MUP Settings
-
Click "Create Levy Product" button next to the levy variant ID field
-
The product will be created automatically with:
- Title: "MUP Levy"
- Handle: "mup-levy"
- Product Type: "Fee"
- 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_productmetafield - You can use an existing product if preferred - just enter its variant ID manually
Step 3: Configure MUP Settings
Required Settings
- Levy Product Variant ID
- Should be auto-filled if you created the levy product in Step 2
-
Format:
gid://shopify/ProductVariant/123456789or just123456789 -
Minimum Unit Price
- Default:
0.65(Scotland's MUP) -
Enter as decimal number (e.g.,
0.65) -
Enable MUP Enforcement
- Check to enable MUP rules
- 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
-
Go to Shopify Admin → Settings → Checkout
-
Scroll to Checkout rules section
-
Click "Add a checkout rule"
-
Select "Cart validation" as the rule type
-
Find and select "MUP Validation" function
-
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
-
Go to Products in Shopify Admin
-
Select a product
-
Scroll to Metafields section
-
Add
custom.total_unitswith the alcohol units value -
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
- Product Setup - Add alcohol units to all products
- Health Check - Scan catalog for missing data
- MUP Settings - Fine-tune settings
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.