-
-
Save Apina/c203ea36cf9e300e2230 to your computer and use it in GitHub Desktop.
Can be added to the event_list_display.php to show the early bird discount is in effect and the value of the discount or the value after discount.
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 | |
$early_full_cost = $event->event_cost; | |
$early_discount = $event->early_disc; | |
$early_perc = $event->early_disc_percentage; | |
$early_full_cost = $event->event_cost; | |
$perc_symbol = ""; | |
$currency_symbol = ""; | |
$early_date = $event->early_disc_date; | |
$early_currentdate = date('Y-m-d'); | |
if(strtotime($early_currentdate) < strtotime($early_date)){ | |
if ($early_discount === '') {} else { //if no discount amount then no early bird discount set so do nothing | |
if ($early_perc === 'Y') {$show_early = $early_discount; $perc_symbol = "%"; | |
echo '<p id="p_event_price-1" class="event_price early_bird_custom_all"><span class="early_bird_custom_title">Early Bird Discount: </span>' . number_format($show_early, 2, '.', '') . $perc_symbol .'</p>'; | |
} //else check to see if it is percentage and if so grab the percentage amount | |
else | |
{$show_early = $early_discount; $currency_symbol = ""; //$early_full_cost - $early_discount;} //if not percentage | |
// this will display the discounted price rather than the discount itself | |
//{$show_early = $early_full_cost - $early_discount; $currency_symbol = ""; //$early_full_cost - $early_discount;} //if not percentage | |
echo '<p id="p_event_price-1" class="event_price early_bird_custom_all"><span class="early_bird_custom_title">Early Bird Discount: </span>' . $org_options['currency_symbol'].number_format($show_early, 2, '.', '') . $perc_symbol .'</p>'; | |
} | |
} | |
} else {} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment