Last active
December 16, 2015 18:39
-
-
Save simonlk/5479380 to your computer and use it in GitHub Desktop.
WooCommerce - change "Choose an option" to be the name of the attribute
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
// Looks up the slug of the attribute and manually replaces it with the text | |
// Within single-product/add-to-cart/variable.php replace the line: | |
// <option value=""><?php echo __( 'Choose an option', 'woocommerce' ) ?>…</option> | |
<option value=""> | |
<?php | |
if ($name == 'pa_colour') { | |
$attr_name = 'Colour'; | |
} elseif ($name == 'pa_size') { | |
$attr_name = 'Size'; | |
} | |
echo $attr_name . ':'; | |
?> | |
</option> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
All I get is : showing instead of color or size.