Created
December 27, 2016 18:48
-
-
Save bekarice/33c3858b0c2e744fd2f503b840820284 to your computer and use it in GitHub Desktop.
2 Examples on how to change variation SKU separators w/ Product SKU Generator
This file contains hidden or 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 this line if needed | |
/** | |
* Example 1: Changes the separator between variations in a generated SKU | |
* | |
* @param string $separator the original separator | |
* @return string the new separator | |
*/ | |
function sv_wc_replace_variation_sku_separator( $separator ) { | |
return '_'; | |
} | |
add_filter( 'wc_sku_generator_attribute_separator', 'sv_wc_replace_variation_sku_separator' ); | |
// OR | |
// Example 2: Removes the separator between variations in a generated SKU | |
add_filter( 'wc_sku_generator_attribute_separator', '__return_empty_string' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment