Skip to content

Instantly share code, notes, and snippets.

@SiR-DanieL
Created December 7, 2016 05:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SiR-DanieL/9f4873a933d439754fb34cb708f8d59f to your computer and use it in GitHub Desktop.
Save SiR-DanieL/9f4873a933d439754fb34cb708f8d59f to your computer and use it in GitHub Desktop.
<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