# Eventixa Core Template Overrides

Eventixa core templates are loaded through the centralized `Eventixa\Frontend\TemplateLoader` and registered in `Eventixa\Templates\TemplateRegistry`.

Premium-only templates such as invoices and PDF tickets are intentionally excluded from core and should be registered by the Premium addon.

## Override location

Copy any core plugin template from:

```text
eventixa/templates/{area}/{template}.php
```

to your active child theme or theme at:

```text
your-theme/eventixa/{area}/{template}.php
```

Examples:

```text
your-theme/eventixa/events/archive.php
your-theme/eventixa/events/single/template-1.php
your-theme/eventixa/venues/single-venue.php
your-theme/eventixa/organizers/single-organizer.php
your-theme/eventixa/account/index.php
your-theme/eventixa/emails/default.php
```

## Helper functions

```php
$path = eventixa_locate_template( 'venues/single-venue.php' );
$html = eventixa_render_template( 'venues/single-venue.php', array( 'venue' => $venue ) );
$part = eventixa_get_template_part( 'events/list-event', '', array( 'item' => $item ) );
$meta = eventixa_template_registry()->get( 'events/archive.php' );
```

## Render hooks

Every template render fires common hooks:

```php
do_action( 'eventixa_before_template_part', $template, $args, $file, $metadata );
do_action( 'eventixa_after_template_part', $template, $args, $file, $metadata );
```

Template-specific hooks are also available. For example `venues/single-venue.php` becomes:

```php
do_action( 'eventixa_before_template_part_venues_single_venue', $args, $file, $metadata );
do_action( 'eventixa_after_template_part_venues_single_venue', $args, $file, $metadata );
```

## Filters

```php
apply_filters( 'eventixa_template_name', $template, $loader );
apply_filters( 'eventixa_template_theme_candidates', $candidates, $template, $loader );
apply_filters( 'eventixa_plugin_template_path', $path, $template, $loader );
apply_filters( 'eventixa_template_args', $args, $template, $file );
apply_filters( 'eventixa_rendered_template', $html, $template, $args, $file );
apply_filters( 'eventixa_template_registry', $templates );
```

## Premium/addon registration

Premium and future addons should register their own template metadata with:

```php
add_filter( 'eventixa_template_registry', function ( array $templates ): array {
    $templates['premium/invoice.php'] = array(
        'version' => '1.0.0',
        'area'    => 'premium',
        'label'   => 'Invoice',
    );

    return $templates;
} );
```

Core does not load or ship Premium templates.
