I want to remove the color and price filter only for the specific category in Magento 2.4.3-p1.
I created a separate XML file (catalog_category_view_id_{category_id}.xml) and apply the below code.
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="sidebar.main">
<referenceBlock name="catalog.leftnav">
<action method="hide">
<argument name="name" xsi:type="string">price</argument>
</action>
<action method="hide">
<argument name="name" xsi:type="string">color</argument>
</action>
</referenceBlock>
</referenceContainer>
</body>
</page>
I get the below error.
1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid method Magento\LayeredNavigation\Block\Navigation::hide
Any help would be appreciated.
Thanks in advance.