You are here

function commerce_autosku_commerce_product_insert in Commerce AutoSKU 7

Implements hook_commerce_product_insert().

File

./commerce_autosku.commerce.inc, line 56
Contains Drupal Commerce specific hook implementations. Included automatically.

Code

function commerce_autosku_commerce_product_insert($product) {
  if (_commerce_autosku_is_temporary_sku($product->sku)) {
    unset($product->is_new);

    //Trigger immediate resave now that we have the ID.
    commerce_product_save($product);

    //Reset is_new in case anyone needs it after us.
    $product->is_new = TRUE;
  }
}