Created
May 10, 2018 18:43
-
-
Save mrgrt/5fb88c5f757d7f3e39ab5bd9759a2d36 to your computer and use it in GitHub Desktop.
Change "choose an option" in WooCommerce.
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 | |
//Customise the dropdown 'choose an option' | |
add_filter('woocommerce_dropdown_variation_attribute_options_args', 'wcvdc_dropdown_choice', 10); | |
// Displays the custom "Choose an option" on the front end | |
function custom_dropdown_choice( $args ){ | |
global $product; | |
$args['show_option_none'] = "Select a: " . strtolower(wc_attribute_label($args['attribute'],$product)); | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment