• Resolved stl_on_web

    (@stl_on_web)


    Hello, the prices are displayed like “€ 10,00”.
    How can I display like “10,00 €”.

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author Jeroen Schmit

    (@slimndap)

    Hi!

    You can achieve this by adding the following to the functions.php file of your theme:

    /**
     * Changes the prices summary of events by placing the currency symbol behind ticket prices.
     * 
     * @param 	string		$prices_summary The current summary.
     * @param 	WPT_Event	$event			The event.
     * @return								The new summary.
     */
    function place_currency_symbol_behind_price( $prices_summary, $event ) {
    	global $wp_theatre;
    	
    	$prices = $event->prices();
    	
    	ob_start();
    
    	if ( count( $prices ) ) {
    		$price = number_format_i18n( (float) min( $prices ), 2 );
    		
    		$currency_symbol = '';
    		if (!empty( $wp_theatre->wpt_tickets_options['currencysymbol'] ) ) {
    			$currency_symbol = $wp_theatre->wpt_tickets_options['currencysymbol'];
    		}
    		
    		if ( count( $prices ) > 1 ) {
    			printf( 'from %s %s',  $price, $currency_symbol);
    		} else {
    			printf( '%s %s',   $price, $currency_symbol);
    		}
    	}
    
    	return ob_get_clean();
    }
    
    add_filter( 'wpt/event/prices/summary', 'place_currency_symbol_behind_price', 10, 2);
    • This reply was modified 7 years, 2 months ago by Jeroen Schmit.
Viewing 1 replies (of 1 total)
  • The topic ‘Display price in Euro’ is closed to new replies.