Skip to content

Instantly share code, notes, and snippets.

@fridaynext
Created January 27, 2017 22:01
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/8f785211797837b508b5091cd051d2ad to your computer and use it in GitHub Desktop.
Save fridaynext/8f785211797837b508b5091cd051d2ad to your computer and use it in GitHub Desktop.
<?php
// Get variation price for Ticket Sales
$the_min_price = null;
function this_variation_price( $price, $min_or_max = 'min', $display = false ) {
global $the_min_price;
$the_min_price = $price;
}
add_filter( 'woocommerce_get_variation_price', 'this_variation_price', 10, 1 );
// Add text to ticket sales "from - to" products
function add_membership_text( $price ) {
global $the_min_price;
$price = '<span class="member-price">' . $the_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, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment