commerce_product_validate_sku

  1. commerce
    1. 7
Versions
7 commerce_product_validate_sku($sku)

Checks to ensure a given SKU does not contain invalid characters.

Parameters

$sku The string to validate as a SKU.

Return value

TRUE or FALSE indicating whether or not the SKU is valid.

Code

modules/product/commerce_product.module, line 677

<?php
function commerce_product_validate_sku($sku) {
  // Do not allow commas in a SKU.
  if (strpos($sku, ',')) {
    return FALSE;
  }

  return TRUE;
}
?>