Skip to content

Instantly share code, notes, and snippets.

@fridaynext
Created January 27, 2017 22:43
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 fridaynext/4e166a0ae1883a224c983cc77e0ddc16 to your computer and use it in GitHub Desktop.
Save fridaynext/4e166a0ae1883a224c983cc77e0ddc16 to your computer and use it in GitHub Desktop.
<?php
// Add text to ticket sales "from - to" products
function add_membership_text( $price ) {
$this_variable_product = new WC_Product_Variable( get_the_ID() );
$prices = $this_variable_product->get_variation_prices( false );
$min_price = current( $prices['price'] );
$max_price = end( $prices['price'] );
$price = '<span class="member-price">' . $min_price . '</span> TBNA Membership Rate <br />';
$price .= '<span class="member-price">' . '$30' . '</span> Non-Member Rate';
return $price;
}
add_filter( 'woocommerce_variable_price_html', 'add_membership_text', 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment