You are here

function commerce_autosku_cleanstring in Commerce AutoSKU 7

API helper to reduce a SKU to a set of allowed characters.

1 call to commerce_autosku_cleanstring()
commerce_autosku_generate_sku in ./commerce_autosku.module
Generates a SKU for the product passed in using the given pattern.

File

./commerce_autosku.module, line 221
Module hooks and helper functions for commerce_autosku

Code

function commerce_autosku_cleanstring($string) {
  if (module_exists('transliteration')) {
    $string = transliteration_get($string);
  }
  return preg_replace(COMMERCE_AUTOSKU_DISALLOWED, COMMERCE_AUTOSKU_REPLACEMENT, $string);
}