Documentation

Complete guide for Custom Shipping Rules v1.0.0

Getting Started

Custom Shipping Rules lets you define advanced shipping logic using condition-based rules.

Requirements

Magento 2.4.x
PHP 8.1+

Installation

composer require kevion/m2-custom-shipping-rules

php bin/magento setup:upgrade

php bin/magento cache:clean

Creating Rules

Navigate to **Stores → Shipping → Custom Shipping Rules** in the Magento admin.

Rule Conditions

Each rule supports the following conditions:

ConditionTypeExample
Cart TotalDecimalGreater than $100
WeightDecimalLess than 50 kg
QuantityIntegerAt least 10 items
Customer GroupSelectWholesale, VIP
Shipping DestinationTextPostcode prefix, Country
Date RangeDateActive from 2026-01-01 to 2026-12-31

Priority System

Rules are evaluated in priority order (lower number = higher priority). When a rule matches, its shipping methods are offered and lower-priority rules are skipped.

Rule Preview

Before publishing a rule, use the **Preview** button in the admin panel to test it against a real cart. The preview shows:

Which shipping methods would be offered
The matched conditions with values
Any conflicts with existing rules

Changelog

v1.0.02026-06-15
  • Initial public release
  • Condition-based rule engine (cart total, weight, qty, customer group)
  • Priority-based rule execution with conflict resolution
  • Time-based rules with configurable date ranges
  • Admin rule preview before publishing
  • Compatible with flat rate and table rate shipping