Created
January 27, 2017 22:43
-
-
Save fridaynext/4e166a0ae1883a224c983cc77e0ddc16 to your computer and use it in GitHub Desktop.
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 | |
// 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