eventsmanager

custom placeholder to show price and tax

Sep 10th, 2013
423
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Additional custom placeholder to list ticket break into price and tax
  3. */
  4. add_filter('em_event_output_placeholder','em_event_output_placeholder_tax',1,3);
  5. function em_event_output_placeholder_tax($replace, $EM_Event, $result){
  6. switch( $result ){
  7. case '#_PRICETAX':
  8. $replace = '';
  9. foreach( $EM_Event->get_tickets()->tickets as $EM_Ticket ){
  10. $replace .= "Ticket name: ".$EM_Ticket->ticket_name."<br/>";
  11. $replace .= "Price: ".em_get_currency_formatted($EM_Ticket->get_price_without_tax())."<br/>";
  12. $replace .= "Tax: ".em_get_currency_formatted(round($EM_Ticket->get_price_without_tax() * get_option('dbem_bookings_tax')/100,2))."<br/><br/>";
  13. }
  14. break;
  15. }
  16. return $replace;
  17. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×