Shipping Restrictions
From €0.00
To €350.00
In stock
Whitelist-based shipping method restrictions by ZIP code or postcode. Only explicitly allowed carriers are shown to customers at checkout based on their delivery address. Admin UI, GraphQL-compatible, and sub-millisecond query performance.
Shipping Restrictions for Magento 2
Control exactly which shipping carriers appear at checkout depending on the customer's delivery ZIP code. Ideal for local delivery zones, regional logistics contracts, or country-specific carrier availability. Uses a whitelist model — if a carrier is not explicitly allowed for a ZIP code, it is hidden.
How It Works
- Customer enters a shipping address at checkout
- A plugin intercepts each carrier's
collectRates()call - The module queries the restrictions table for the (ZIP code + carrier code) pair
- If a record exists, the carrier is allowed; if not, it is blocked
- The customer only sees the carriers you have explicitly permitted for their area
Whitelist vs. Blacklist
The module uses a whitelist approach — zero config means all carriers are blocked for a given ZIP. You explicitly define which carriers to allow per zone. This prevents accidental exposure of carriers to regions you don't service.
Supported Carriers (out of the box)
- Flat Rate (
flatrate) - Free Shipping (
freeshipping) - Table Rate (
tablerate) - Any custom carrier via plugin configuration
Admin Interface
Manage restrictions at System → Shipping Restrictions:
- Add / edit / delete restriction rules
- Search and filter by ZIP code or carrier code
- Bulk import via CSV for large zone configurations
Performance
- Dedicated table
magendoo_shippingrestrictions_shippingrestriction - Composite index on
(zip_code, carrier_code)— queries complete in < 1 ms - Separate indexes on
zip_codeandcarrier_codefor partial lookups - Dedicated log file at
var/log/shipping_restrictions.logfor debugging
Compatibility
- Standard Magento checkout
- GraphQL checkout (compatible with headless and PWA storefronts)
- Multi-store / multi-website setups
Installation
composer require magendoo/module-shippingrestrictions
bin/magento module:enable Magendoo_ShippingRestrictions
bin/magento setup:upgrade && bin/magento cache:flush
Requirements
- Magento 2.4.x
- PHP 8.1 or higher
License: MIT | View on GitHub