<?php
/**
 * The public-facing functionality of the plugin.
 *
 * Defines all hooks for the public side of the site.
 *
 * @package    Event_Monster
 * @subpackage Event_Monster/includes
 */
class Event_Monster_Free_Public {

    /**
     * The plugin version.
     * @var string
     */
    private $version;

    /**
     * Initialize the class and set its properties.
     */
    public function __construct( $version ) {
        $this->version = $version;
    }

    // We will move public-facing functions from em-core-functions.php here.
    // For example, if you have a function to display an event price,
    // it would become a method in this class.

    /**
     * Example: Get the formatted price for an event.
     *
     * @param int $event_id The ID of the event.
     * @return string The formatted price.
     */
    public function get_event_price_html( $event_id ) {
        $price = get_post_meta( $event_id, '_em_price', true );
        $currency = get_option('em_currency_symbol', '$');

        if ( empty( $price ) || $price == 0 ) {
            return __( 'Free', 'event-monster-premium' );
        }

        return esc_html( $currency . $price );
    }
}