Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save simonlk/5479380 to your computer and use it in GitHub Desktop.
Save simonlk/5479380 to your computer and use it in GitHub Desktop.
WooCommerce - change "Choose an option" to be the name of the attribute
// 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' ) ?>&hellip;</option>
<option value="">
<?php
if ($name == 'pa_colour') {
$attr_name = 'Colour';
} elseif ($name == 'pa_size') {
$attr_name = 'Size';
}
echo $attr_name . ':';
?>
</option>
@tylertylerday
Copy link

All I get is : showing instead of color or size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment