You are here

function _uc_coupon_match_sku in Ubercart Discount Coupons 6

Same name and namespace in other branches
  1. 7.3 uc_coupon.module \_uc_coupon_match_sku()
  2. 7.2 uc_coupon.module \_uc_coupon_match_sku()
1 call to _uc_coupon_match_sku()
uc_coupon_calculate_discounts in ./uc_coupon.module
Find items that a coupon will apply to and calculate the discounts.

File

./uc_coupon.module, line 745
Provides discount coupons for Ubercart.

Code

function _uc_coupon_match_sku($model, $skus) {
  foreach ($skus as $match) {
    if (preg_match('/^' . str_replace('\\*', '.*?', preg_quote($match, '/')) . '$/', $model)) {
      return TRUE;
    }
  }
  return FALSE;
}