Skip to main content

Order routing in X-Cart 5.6.x

Learn about assigning items to shipments

A
Written by Anna Verbichenko
Updated yesterday

When products are available from more than one location, order routing decides which location(s) will fulfill each item at checkout. It evaluates the shopper’s shipping address, locations that are allowed to ship to that address, and the enabled routing rules, then assigns items to one or more shipments accordingly.


Inputs that affect routing

Order routing considers:

  • Zones (Store → Localization → Zones) that match the customer’s shipping address.

  • Locations (Store → Locations) that have shipping enabled.

  • Shipping profiles & rules (Store → Shipping → Shipping profiles) that pair locations with zones.

  • Enabled routing rules (Store → Shipping → Order routing). At least one rule must be enabled.


Routing rules (how the logic works)

The system uses all enabled rules together, with internal weights.

  • Minimize split shipments — prioritize fulfilling the order from the fewest locations; if one location can ship the entire order, use it. Otherwise, prefer the combination that yields the fewest packages.

  • Shipping rules priority — when several locations within the same shipping profile can fulfill, prefer the location whose rule appears first in the profile.

  • Backorder items last (coded behavior) — items are routed from the Backorder warehouse only after other locations have been evaluated.

💡In the current implementation, Minimize split shipments has the highest weight.

If needed, weights can be customized by engineering as a paid customization.


How routing appears to shoppers

At checkout, items are grouped into one or more shipments based on the rules above. Each shipment shows the available shipping methods and charges based on the selected location’s configuration (provider API rates or Flat rates). The goal is to minimize the number of packages while honoring your shipping-profile priorities and reserving Backorder as a last resort.


Special behavior for warehouse-distributor (WD) locations

WD rate visibility

When routing chooses a WD location that uses API rates, each shipment shows the methods and charges returned by that provider (or your Flat rates if configured).

If a WD location has no API rates, methods and charges follow your store’s Flat rates setup.

Insufficient WD stock

If the chosen WD lacks sufficient quantity and the remaining quantity can be re-allocated to other eligible locations, the system redistributes.

If WD qty is short and cannot be reassigned, the shopper sees “Insufficient warehouse stock” with the affected items. Checkout returns an error so the shopper can adjust quantities.


Managing order routing

You can adjust the rules affecting order routing as follows:

  1. Go to Store → Shipping → Order routing.

    The Order Routing page opens.

  2. Review the rule descriptions and toggle the Minimize split shipments and/or Shipping rules priority rules on/off as needed. At least one rule must be on.

    💡In environments where the PHP FFI library is not enabled, the page shows a warning and only the Shipping rules priority rule is available (no toggle).

  3. Click Save changes.

  4. (Optional) In Store → Shipping → Shipping profiles, adjust the rule order within a profile to refine Shipping rules priority outcomes.


Can't find answers you're looking for?

Email us at support@x-cart.com. We will be happy to help!


Did this answer your question?