Free Ride for Craft CMS

Configuration

A rule

FieldWhat it does
Name / HandleHow the rule is known in the CP and on the command line. The handle is unique per store
What this rule doesOffer a free shipping method, Waive the cost of the chosen method, or Block free shipping
Customer-facing nameWhat the customer sees at checkout. Blank falls back to the Default method label setting
Hide other shipping methodsMethod rules only — see Usage
Methods to waiveWaiver rules only. Nothing selected means "whichever method they chose"
DescriptionWritten onto the order's shipping adjustment, so whoever reads the order later knows why
Order conditions / Customer conditionsAll must pass — see below
SitesNothing selected means every site
Start date / End dateA campaign window, inclusive of both ends

A rule's position in the list is its precedence. Drag to reorder.

Conditions

Every order condition Commerce already offers is available — Item Subtotal, Discounted Item Subtotal, Total Qty, Total Weight, coupon code, purchasable, shipping zone and the rest — except the ones that only have an answer after checkout. A cart is never completed, paid, or in an order status, so those are left out rather than offered as conditions that can never pass.

Free Ride adds its own:

ConditionAsks
Shipping Postal Codeis one of / is not one of a list like 28105, 282*, 10000-19999
Shipping Countrythe shipping address's country, without modelling a zone first
Shipping State / Provincea plain list — NC, SC, GA — codes or names, case-insensitive
Cart Product Typesincludes any of / includes only / includes none of
Cart Contains Something Related Towhether anything in the cart is related to the elements you pick — a category, a collection entry
Largest Item Dimensionthe longest single length, width or height of any line item
Distinct Itemsline items, not quantity — three of one thing is one
Day of Weekevaluated now, in the system timezone
Time of Dayis between / is not between two times like 22:00 and 02:00; windows wrap midnight

Postal code lists

Separate codes with commas, semicolons or new lines. Spaces inside a code are ignored, so SW1A 1AA and sw1a1aa are the same code.

  • 28105 — exact
  • 282* — anything starting 282
  • 10000-19999 — a numeric range, inclusive. A US ZIP+4 like 10001-1234 is compared on its first five digits.

Customer conditions

User groups, and anything else Craft's user condition builder knows. Any customer condition means a guest order can never match — there is no user to ask.

Settings

Settings → Plugins → Free Ride, or Free Ride → Settings for admins.

SettingDefaultWhy you would change it
Default method labelFree ShippingWhat a free method is called when its rule has no customer-facing name
Amount remaining messageSpend {remaining} more for free shipping{remaining} becomes the formatted amount, in the order's currency
Quantity remaining messageAdd {remaining} more item(s) for free shippingUsed when the nearest threshold is Total Qty
Weight remaining messageAdd {remaining} more for free shippingUsed when the nearest threshold is Total Weight
Qualifying messageYour order qualifies for free shipping.Shown once the cart has it
Use estimated addressesonOff means address conditions wait for a real shipping address
Log decisionsoffOn while setting rules up; noisy afterwards

{remaining} is a plain substitution, not Twig — nothing a store editor types into a message is ever rendered as a template.

Permissions

  • Manage free shipping rules — the Rules screen
  • Use the simulator — the Simulator screen

Settings are admin-only and follow allowAdminChanges.

Moving rules between environments

Rules are stored in the database, like Commerce's own shipping methods, so they don't travel with project config. Export and import them instead:

php craft freeride/rules/export --store=us --file=rules.json
php craft freeride/rules/import --store=us --file=rules.json

Import matches on handle within the store: an existing rule is updated in place, a new handle is created. Running the same file twice is safe. Import never deletes a rule that isn't in the file.

Two things are environment-specific, so check them after an import: Sites are stored as site IDs, and conditions that point at elements (a product type, a related category) reference them as that environment saved them. If IDs differ between environments, re-pick those in the CP.