You are here

function _commerce_autosku_needs_temporary_sku in Commerce AutoSKU 7

Check if a product needs a temporary value.

1 call to _commerce_autosku_needs_temporary_sku()
commerce_autosku_commerce_product_presave in ./commerce_autosku.commerce.inc
Implements hook_commerce_product_presave().

File

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

Code

function _commerce_autosku_needs_temporary_sku($product, $settings) {
  if (isset($product->is_new) && $product->is_new) {
    $tokens = token_scan($settings['pattern']);
    return isset($tokens['commerce-product']['product-id']);
  }
  return FALSE;
}