Skip to content

Amasty module conflict with custom module

I have added a custom module for layered navigation in frontend.
It has a custom controller with endpoint https://example.com/wheels/index/result/?make=Alfa+Romeo&year=2021&model=Giulia&tire_size_select=225%2F50R17&fitmentlevel=4lift

I give this error after installing amasty layered navigation module.
enter image description here

The code where this error is origination is this.
app/code/Amasty/Shopby/view/frontend/templates/layer/widget/fromto.phtml

<?php
/**
 * @author Amasty Team
 * @copyright Copyright (c) 2023 Amasty (https://www.amasty.com)
 * @package Improved Layered Navigation Base for Magento 2
 */
/**
 * @var AmastyShopbyBaseModelFilterSetting $filterSetting
 * @var AmastyShopbyBlockNavigationWidgetFromTo $block
 * @var MagentoFrameworkEscaper $escaper
 */

$postfix = '_' . uniqid();
$filterCode = $escaper->escapeHtml($filterSetting->getAttributeCode());
$min = $escaper->escapeHtml($fromToConfig['min']);
$max = $escaper->escapeHtml($fromToConfig['max']);
$from = $fromToConfig['from'];
$to = $fromToConfig['to'];
$step = $fromToConfig['step'];
$fromToType = $block->getWidgetType();
$hideDigitsAfterDot = $filterSetting->getHideZeros();
?>

The block being used here is this app/code/Amasty/Shopby/Block/Navigation/FilterRenderer.php

use MagentoCatalogModelLayerFilterFilterInterface;

 public function render(FilterInterface $filter)
{
    $this->filter = $filter;
    $setting = $this->settingHelper->getSettingByLayerFilter($filter);

    if ($filter instanceof AmastyShopbyModelLayerFilterCategory) {
        $categoryTreeHtml = $this->getCategoryTreeHtml($filter);
        $this->assign('categoryTreeHtml', $categoryTreeHtml);
        $template = $this->getCustomTemplateForCategoryFilter($setting);
    } else {
        $template = $this->getTemplateByFilterSetting($setting);
    }

    $this->setTemplate($template);
    $this->assign('filterSetting', $setting);

    if ($this->filter instanceof AmastyShopbyApiDataFromToFilterInterface) {
        $fromToConfig = $this->filter->getFromToConfig();
        $this->assign('fromToConfig', $fromToConfig);
    } 

    $html = parent::render($filter)
        . $this->getTooltipHtml($setting)
        . $this->getShowMoreHtml($setting);
    return $html;
}

as you can see, how could be the filter

$filter instanceof AmastyShopbyApiDataFromToFilterInterface 

when Use statement is like this? confusing!

    use MagentoCatalogModelLayerFilterFilterInterface;