You are here

function uc_order_condition_delivery_postal_code in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_order/uc_order.ca.inc \uc_order_condition_delivery_postal_code()
1 string reference to 'uc_order_condition_delivery_postal_code'
uc_taxes_update_6 in uc_taxes/uc_taxes.install

File

uc_order/uc_order_workflow.inc, line 218
This file contains the Workflow-ng hooks and functions necessary to make the order related entity, conditions, events, and actions work.

Code

function uc_order_condition_delivery_postal_code($order, $settings) {

  // Trim the wildcard off the pattern.
  $pattern = rtrim($settings['pattern'], '*');

  // Return TRUE if the delivery postal code begins with the pattern.
  return strpos($order->delivery_postal_code, $pattern) === 0;
}