Customizing Shipwire with Rules

The Rules modules provides an amazing amount of flexibility in configuring many aspects of the Drupal, Commerce, Ubercart and Shipwire modules. Complex logic can be expressed using rules to suit most business needs. The Shipwire modules currently support Rules with the following Events, Actions, and Conditions.

Shipwire Rules events <

Rules events are split out by store module to ensure proper work-flow but follow a similar pattern. When payment is made on a store order the shipment will be immediately created or processed using batch submission depending on module settings. At this point the shipment which includes the basic shipping rate data:

  • Shipping method (One day, Two day. Ground, International etc)
  • Costs (with currency)
  • Originating Warehouse code
  • Carrier company and service code
  • Products shipped
  • Shipping address

Shipment Fulfilled<

The store order has been submitted to Shipwire to be fulfilled (shipped). The shipment now contain additional data:

  • Messages – Any messages that indicate a problem or shipment hold.
  • Shipwire ID – the unique ID used by Shipwire to identify a shipments.
  • Date Submitted –Unix time stamp indicating when the shipment was submitted.

Shipment Shipped<

The shipment has successfully left a warehouse. Additional data includes:

  • Date shipped – This is misnomer as this date will either be the date that the Shipwire warehouse processed the shipment or the date that the tracking script discovered that the shipment was shipped. Unfortunately Shipwire does not provide the actual date that the shipment was shipped.
  • Date expected – Again this is a misnomer as Shipwire may not provide the actual date that the shipment may be received. It will contain the expected delivery delay plus the current date if the shipment is not tracked by the shipment carrier or the estimated delivery date provided by the carrier if they support tracking information.
  • Tracking number and link -If the shipment carrier provides tracking information then a tracking number and link will be provided.

Shipment Delivered<

Unfortunately this rule can only be relied upon if the shipment carrier supports shipment tracking. When the carrier supplies the information then it will be the actual date that the shipment was delivered. Otherwise it will be a calculated date adding the date the shipment was submitted and the expected shipment time.

Loading Shipment or Order data in Rules<

Shipment events only pass shipment and order IDs as variables. This is by design to reduce server processing time. It is up to the rule to load the appropriate data about shipments or orders when needed. Data for orders and shipments can be loaded using the 'Fetch entity by id' action.

  • Select the entity type to load which can be:
    • Order for Ubercart order
    • Commerce Order for commerce order
    • Shipwire shipment for the shipment.
  • Add the identifier data selector which will be:
    • order-id for Ubercart order
    • commerce-order-id for Commerce order
    • shipwire-shipment-id for the Shipwire shipment id
  • Provide variable name:
    • commerce-order for Commerce Order
    • uc_order for Ubercart order
    • shipwire_shipment for Shipwire shipment

After loading an entity in this manner all the entity properties will be exposed for use in subsequent actions.

Add your comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
  .d95H8b.    .d99@Hb.    .d8@88b.   MM5988MMH    .dHS5@b.  
d8SP YEHb d@9P Y9Hb d88P Y89b M5E dM9P YHEb
M9@ YSEb. d85P S@5 8S9 E85 HMM
@9HdS9Mb. "YM9H5S" .d9@P @MSS@8Mb. YE9b. dEH9
SE8P "Y59b .d5P""YSb. .od95MP" "Y89b "Y@99PE8H
S@M HHE 9ME E@5 dMSP" HH5 MSH
YHMb d98P YH5b d5EP 9@M" YEEb d8HP YS5b d8EP
"Y5@9SP" "Y@SH9P" @@888ES55 "YE@8HP" "Y8SE@P"