Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<label for="nyp">
<?php
global $product;
$text = '';
switch ( $product->id ) {
case 1:
$text = 'Text for product ID 1';
break;
case 2:
$text = 'Text for product ID 2';
break;
default:
$text = stripslashes ( get_option( 'woocommerce_nyp_label_text', __( 'Name Your Price', 'wc_name_your_price' ) ) );
break;
}
printf( _x( '%s ( %s )', 'In case you need to change the order of Name Your Price ( $currency_symbol )', 'wc_name_your_price' ), $text, get_woocommerce_currency_symbol() );
?>
</label>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.