Questions tagged [filter]

Denotes questions about filtering in Magento (layered navigation, collection filtering)

308 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
2answers
1k views

Get empty result when trying to get filterable attribute for particular category

I need to retrieve all filterable attributes for category. I'm using that snippet: $category = Mage::getModel('catalog/category')->load($categoryId); $layer = Mage::getModel('catalog/layer'); $...
7
votes
1answer
2k views

Custom /catalogsearch/ filters

Beforehand I have to tell: I'm a total n00b on Magento and what I need to know is more a "common practice" or "standard" about how is something achieved in Magento since I have to ...
5
votes
1answer
315 views

Magento2 : How to set filter for an insert listing component while loading edit view form

I want to display all contacts of a supplier on the supplier edit page. For this, I use an insert listing component and I include the contact grid in a field set. How can I use the supplier_id to ...
5
votes
0answers
1k views

How to add filtering to custom table field column in Customers admin grid in Magento2?

Added custom columns from custom table to Customers grid using JOIN in the following method: \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection::_beforeLoad: protected function ...
4
votes
0answers
206 views

Magento API complex filter value from another key value

I have a custom soap api for my magento 1 website, the problem is i dont know what array value to pass as the filters parameter so the parameter will work like this: $collections = Mage::getModel('...
4
votes
0answers
1k views

Get active filters in Category/View Block in Magento 2

I want to return all active filters in a custom View Block in module catalog. While the categories are returned in the layered navigation view, this always returns an empty result: class CategoryView ...
4
votes
3answers
3k views

Add Filter to magento 2 category product collection

a similar problem. If i want filter product collection, create plugin for Layer (if use event the result will be the same). The collection is correct and show only 2 products. But the Pagination ...
4
votes
0answers
175 views

Magento 2 addProductsFilter to Stock Item collection

In Magento 1 you were able to add a product filter to a Stock Item collection in the Mage_CatalogInventory_Model_Resource_Stock_Item_Collection class. This functionality appears to be missing along ...
4
votes
0answers
290 views

Need to create Ajax Category filter

Need to create ajax filter for category. Please help me to create AJAX category filter. I don't want any use extension. My Magento version : 1.9
3
votes
0answers
86 views

Change default price filter behaviour for pwa in magento 2.3.4 using graphql

I have a requirement in which i need to customise the default price filter in magento and change the behaviour so that the price ranges will be constant and need to show all the ranges after a price ...
3
votes
1answer
165 views

Filter renderer column data

I've one grid similar to product grid. <?php namespace LazyCoder\WarehouseListing\Block\Adminhtml\Grid; use Magento\Backend\Block\Widget\Grid\Extended; use Magento\Backend\Block\Template\Context; ...
3
votes
0answers
83 views

Magento 2 - Layered navigation not shown if there is only category in categories filters

In Search page, when I query some string it does not show the layered navigation filters when resultant products set belong to one category. So I want to show that particular category in categories ...
3
votes
0answers
121 views

Magento 2 : Filter is not showing in front end in my custom module

i'm creating filter for Frontend in custom module. I'm following this module grid https://belvg.com/blog/ui-grid-component-on-the-front-end-in-magento-2.html But it's not showing in Front end. ...
3
votes
1answer
615 views

Filter to the magento admin grid column with renderer value

I got stuck into the magento admin grid. I need to put the filter on the grid column. which has value YES and NO. But YES and NO are decided from the many conditions. I have one renderer file for ...
3
votes
0answers
2k views

Magento 2 filter not working on custom column

Magento 2 Filter is not working. In the below code column created through layout xml are getting filter, but on column created via column class file filter is not working. I have found that one ...
3
votes
1answer
3k views

Magento2: How to use Magento\Framework\Api\FilterBuilder?

I am able to use the addFilter in the searchCriteriaBuilder like this: $this->searchCriteriaBuilder->addFilter( 'name', 'M%', 'like' ); For example in this code I can get all the ...
3
votes
0answers
409 views

Magento 2: products collection with multi-selected values of multiple attributes

I have numbers of custom attributes with multiple selected values in magento catalog. I need to filter products by multiple attributes having multiple selected values. eg: Attribute set having a ...
3
votes
0answers
493 views

Magento 2 How to filter shared wishlist items function?

I want to add a new filter in shared wishlist items. I have used the preference method to override the block method. The problem is that the addFieldToFilter is not working. How can I achieve it? ...
3
votes
0answers
613 views

Magento filter search result by custom text

I have created one module Popular Search. In this module I am adding custom popular keywords like, Shirt Jeans Dress Now on search result page, I want to filter the result with these keyword. I have ...
3
votes
0answers
964 views

Magento2: How to show Product Weight on Filter

Need to show Product Weight on Category Page Filter, so Customer can also filter via Weight. A user can also enter the weight in Text Box & Search, so it's vice versa between Slider & Textbox....
3
votes
0answers
610 views

Display Country of Manufacturer on Category Page Navigation Filter

When we add a product from Admin. We have field "Country of Manufacturer". Would like to display that as Navigation Filter on Frontend. From Admin -> Product Attribute By Inspect Element, able to ...
3
votes
1answer
733 views

Magento 2 filter_condition_callback

How can I perform the same logic of filter_condition_callback of Magento 1 in Magento 2 I have a country column which I save comma separated values in db I have managed to create the filter but I am ...
3
votes
2answers
4k views

How to add collection filter to gridContainer in Magento 2?

I need to add a collection filter to my grid. I do few search on Internet but unfortunately it can't resolve my case. I'm using gridContainer instead of usual way. Here is my files: layout.xml <...
3
votes
1answer
850 views

How to prevent bots from appearing in "Online Customers" in backend?

Checking the "Online Customers" in Magento's backend shows a lot of bot IP addresses. These bots include bots like google crawler. Is there a way to filter those out, so I can see only real visitors? ...
3
votes
0answers
3k views

Range in custom attribute in magento, layered navigation

I want to show custom attribute in range in layered navigation like the price is shown in range £20.00 - £30.00 £30.00 - £40.00 £40.00 - £50.00 i want custom attribute Length in Range 1.00 ...
3
votes
0answers
375 views

REST products web service filter by Price Attribute

Magento 1.9 provides a web service for products but the response parameters that are different for customer/guest and admin. The problem is that there is a price field in Admin response that gives ...
2
votes
0answers
100 views

Add caption or helper text to admin filter in magento 2

I added a filter in my admin panel. But i want to add a helper text before or after the input field. Like the 'more information about...' in this screenshot: Right now the field config I have is ...
2
votes
1answer
340 views

How to print raw sql query by applying filter on searchCriteriaBuilder in Magento 2

How to print raw SQL query by applying filters on searchCriteriaBuilder ? I am using the following method, but it's giving error: "Uncaught Error: Call to undefined method Magento\Framework\Api\...
2
votes
0answers
53 views

Filter category products by quantity - Magento 2.3

My store allows backorders, so some of the products have quantity of 0. I want to create a switch on the category page on front-end for "hide out of stock products" which filters out ...
2
votes
0answers
94 views

magento 2 keep the applied filters in opened state

I wish to make changes in the layered navigation filter, so that all the applied filters are visible(opened state). For example I am selecting red in color filter, all other options in color filter ...
2
votes
0answers
97 views

How to use the null- or notnull-operator with (complex) filter in Magento (1.9) API SOAP v2

For example: sales_order_list api function filter operators Possible solutions: value = "notnull" value = "" value = null value = "true" value = "1" use simple filter anything else?!?! Who knows?
2
votes
0answers
38 views

How do i add quick filters to the admin grids?

I've been trying to add a new filter category for an already existing column when I discovered the existence of Quick Filters. My question is twofold: is Quick Quickfilters compatible with the ...
2
votes
0answers
83 views

Magento 2.3: How to create a custom filter?

I'm having a requirement that is related to filtering the products. By default, when the user clicks on the category, it will be redirected to the corresponding product listing page. But my ...
2
votes
0answers
201 views

Filter for Magento Admin Grid All "NULL" Values

Is there a way to create a filter for NULL values in Magento Custom Admin Grid?
2
votes
1answer
396 views

How to Create Custom Grid Filter Show All "NULL" Values in Specific Column

How can I make a filter for null values of my order ID <column name="order_id"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> ...
2
votes
0answers
114 views

Magento 2: How to add product QTY in layered navigation filter?

I need to add qty filter in Layered Navigation so Customer can filter products using qty. I have implemented using product stock status but due to backorders. I need to display products based on ...
2
votes
0answers
171 views

filter product list follow condition in custom module magento 2

public function createCollection() { /** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Collection */ $collection = $this->productCollectionFactory->create(); if ($...
2
votes
1answer
295 views

Magento 2 Product Filter By Category & Multiple Product Attributes

I'm currently building a custom product filter via Ajax. I've got the basics working but now I'm trying to filter via category and a specific product attribute. Here is my code $collection = $this-&...
2
votes
0answers
16 views

How to have irregular price filter ranges?

If I configure manual price ranges, I can define the step, but that step is a constant for all ranges. Is there a way to have, for example, USD 1 to USD 199 USD 200 to USD 499 USD 500 to USD 5,000 ...
2
votes
0answers
40 views

How can I get all filter combinations and their links for all categories in Magento 2?

I have a problem and I do not know how to solve it. The client wants to get links of all filter combinations for the category, and make a check on index and follow. And if there is a parameter index ...
2
votes
1answer
35 views

How do you correctly specify a filter to get all orders that have been updated since date

I have tried to create a filter to get all updated orders since date... rest/V1/orders/searchCriteria[filter_groups][0][filters][0][field]=updated_at&searchCriteria[filter_groups][0][filters][0][...
2
votes
0answers
109 views

Solved: Layered Navigation of Parent Categories

The layered navigation of the Child Categories it's working okay. The problem is with Parent Categories. I'm trying to have the same filters on Parent Categories but i still can't solve it. What I ...
2
votes
0answers
358 views

Custom column in Product Grid not being filtered?

I have created a custom column in Product gird by a module, which shows Parent product's SKU there. It's working fine but when I try to filter it Magento gives "Something went wrong with processing ...
2
votes
2answers
61 views

Load selected category products in list page magento2

I have loaded a custom template in the category view page. with content all categories in the drop down. I am looking for functionality once drop down changes the corresponding category products ...
2
votes
1answer
1k views

How can I remove the category filter from category page that do not have further any categories?

I am using Porto Theme (Magento 2) for building an e-commerce website. I have some categories that has sub-categories, so when I go to that sub-categories page, then it is showing the category filter ...
2
votes
0answers
376 views

Magento 2 Filter admin grid collection by default

In Magento 2.2.5, I want to filter the custom grid using custom attribute. I followed this link. But it is not working. Is any alternate solution there.
2
votes
0answers
34 views

Bulk Ordering a Product with Many Possible Configurations

I am building a website that sells different types of fasteners (nuts, bolts, screws, etc). The issue is that each product has many, many different variations. For instance, a hex head cap screw ...
2
votes
0answers
153 views

Magento2 : Quantity filter not working properly in product grid

In magento2 admin panel, I want to filter all product which have quantity zero or no (empty/blank) value. But when I filter by quantity from 0 to 0 then, it is returning all products. When I filter ...
2
votes
0answers
257 views

Filter the configurable products based on the child product's color in Magento 2

In Magento 2 How to filter the configurable products based on the child product's color. For example, if the parent has 4 children with Green, Red, Yellow and Black colors. If I select green in the ...
2
votes
1answer
3k views

Filters and results not working properly

Filters are not working properly, not all the attributes like 'size' are in the sidebar. Also, when selecting an option to filter on, there are no products found for this selection but in the backend, ...

1
2 3 4 5
7