<?php
use TourOperatorPro\Factory as FactoryAlias;
use TourOperatorPro\Html\TourOperatorProHtmlFrontend as TourOperatorProHtmlFrontendAlias;
use TourOperatorProBlock\block_tour_destination\block_tour_destination_helper;

$doc= FactoryAlias::getDocument();
require_once __DIR__.DS."block_tour_destination_helper.php";
$params=$this->item->params;


$destination_id=$params->get('filter_by_destination',0);

$list_tour=block_tour_destination_helper::get_tour_by_destination_id($destination_id);
TourOperatorProHtmlFrontendAlias::load_jquery_library('owlcarousel2');

$layout = $this->item->params->get('layout', 'default');
$plugin_name=TOUROPERATORPRO_PLUGIN_NAME;
$template_path=get_template_directory();
$block_name= basename(__DIR__);
$layout_name="tmpl/$layout.php";
$template1_path="$template_path/$plugin_name/frontend/blocks/$block_name/$layout_name";
$template2_path= __DIR__ . "/tmpl/$layout.php";
if(file_exists($template1_path)){
    require $template1_path;
}else{
    require $template2_path;
}
?>