Skip to content

Extensions Overview

The MUP Compliance App includes several Shopify extensions that work together to enforce Minimum Unit Pricing.

What Are Extensions?

Extensions are custom code that runs in your Shopify store to add functionality. The MUP app includes:

  1. Cart Transform - Adds levy charges automatically
  2. Validation Function - Blocks checkout for violations
  3. Checkout UI - Provides customer guidance
  4. Region Selector - Lets customers select their UK region

How Extensions Work Together

Customer adds product to cart
Cart Transform checks if levy needed
Adds levy if price < MUP floor
Customer goes to checkout
Validation Function checks compliance
Blocks checkout if violation detected
Checkout UI shows guidance

Extension Details

Cart Transform (mup-cart-transform)

What it does: - Runs automatically when products are added to cart - Calculates if MUP levy is needed - Adds levy as child line item

When it runs: - Customer adds product to cart - Customer changes quantity - Cart is updated

Requirements: - Customer must have uk_region = "scotland" - Product must have total_units metafield - MUP enforcement must be enabled

Validation Function (mup-validation)

What it does: - Validates cart before checkout - Blocks checkout if MUP violation detected - Shows error message to customer

When it runs: - Customer attempts to checkout - Before payment processing

What it checks: - Product prices after discounts - Scottish address detection

Checkout UI (mup-checkout)

What it does: - Shows MUP information to customers - Displays levy summary - Provides repair actions

When it shows: - Customer is in checkout - Customer has selected Scotland - Levies are present in cart

Region Selector (uk-region-selector)

What it does: - Lets customers select UK region - Auto-detects region from postcode - Updates cart attribute

Where it appears: - Header (configurable) - Product pages (optional) - Cart page (optional)

Extension Status

All extensions are automatically deployed with the app. No manual activation needed per store.

Configuration

Extensions are configured through: - MUP Settings - App configuration - Theme Customizer - Region selector placement - Shopify Functions - Automatic (no config needed)

Troubleshooting

Extensions not working? - Verify MUP enforcement is enabled - Check customer has selected Scotland - Review browser console for errors

Cart transform not running? - Ensure products have total_units metafield - Verify region is set to Scotland - Check MUP settings are saved

Validation blocking incorrectly? - Review validation logic - Verify product prices and units

For detailed information on each extension, see: - Cart Transform - Validation Function - Checkout UI - Region Selector