Skip to content

Instantly share code, notes, and snippets.

@bekarice
Created December 27, 2016 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bekarice/fa032ee4eeac5082427451fc34380924 to your computer and use it in GitHub Desktop.
Save bekarice/fa032ee4eeac5082427451fc34380924 to your computer and use it in GitHub Desktop.
<?php // only copy if needed
/**
* Adjust the format of generated SKUs
*
* @param string $sku the original complete SKU
* @param string $product_sku the parent product SKU
* @param string $variation_sku the SKU to represent a variation, if set
* @return string the updated complete SKU
*/
function sv_wc_alter_generated_sku( $sku, $product_sku, $variation_sku ) {
return $product_sku . $variation_sku;
}
add_filter( 'wc_sku_generator_variation_sku_format', 'sv_wc_alter_generated_sku', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment