<?php
/**
 * @package SJ HikaShop Search
 * @version 1.0.0
 * @license GNU/GPL
 */

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Helper\ModuleHelper;
use Joomla\CMS\Language\Text;

$hkshopHelper = JPATH_ADMINISTRATOR . '/components/com_hikashop/helpers/helper.php';
if (!file_exists($hkshopHelper)) {
    echo '<div class="alert alert-warning">' . Text::_('HikaShop component is not installed or not accessible.') . '</div>';
    return;
}

require_once $hkshopHelper;
require_once dirname(__FILE__) . '/helper.php';

$layout = $params->get('layout', 'default');
$categories = ModSjHikashopSearchHelper::getCategories($params);
$searchUrl = ModSjHikashopSearchHelper::getSearchUrl($params);

$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_QUOTES, 'UTF-8');

require ModuleHelper::getLayoutPath('mod_sj_hikashop_search', $layout);
