Created
December 27, 2016 22:29
-
-
Save bekarice/fa032ee4eeac5082427451fc34380924 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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