0

I just have this button here in the Catalog > Products page

I just want to be able to remove/hide it programmatically.

  • Can you please provide more infomation? as from what you have put you want to remove the filters from the product grid within the admin – Dava Gordon Aug 14 '19 at 14:57
  • That's correct, I just want to hide/remove the button. – davidelias16 Aug 15 '19 at 4:41
0

you can rewrite product_listing.xml.

path:vendor/magento/modulecatalog/view/adminhtml/ui_component/product_listing.xml

remove code in the product_listing.xml:

<filters name="listing_filters">
            <filterSelect name="store_id" provider="${ $.parentName }">
                <settings>
                    <options class="Magento\Store\Ui\Component\Listing\Column\Store\Options"/>
                    <caption translate="true">All Store Views</caption>
                    <label translate="true">Store View</label>
                    <dataScope>store_id</dataScope>
                </settings>
            </filterSelect>
 </filters>
| improve this answer | |
  • never edit vendor, as next time you run composer update the file changed will be reveted. if your going to impliment this id suggest you create a module under app and do it that way – Dava Gordon Aug 16 '19 at 7:17
-1

Search for this button code in phtml , where it is rendered. Create simple module: 1.add to system.xml select with yes /no. 2.create helper, that will check this setting. 3.add your helper to phtml file. 4. Add a construction if with checking your value from admin configuration ( this is doing by helper). And check - if in admin it is value = 1(yes,hide it) , u should not render it.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.