function commerce_bulk_bulk_creator_sku_alter in Commerce Bulk 8
Implements hook_TYPE_alter().
Allows to alter auto SKU generated by the commerce_bulk.variations_creator service before saving it on a product variation. Note that SKU must be unique across entire Drupal site.
See also
\Drupal\commerce_bulk\BulkVariationsCreator::getAutoSku()
File
- ./
commerce_bulk.module, line 45 - Contains commerce_bulk.module.
Code
function commerce_bulk_bulk_creator_sku_alter(&$sku, $settings, $variation) {
// Do required changes using variables passed.
// $prefix = $settings['prefix'];
// $suffix = $settings['suffix'];
// $sku = "{$prefix}_ALTERED_SKU_{$suffix}";
// Note that return value is not required as the $sku is passed as reference.
}