We changed our privacy policy. Read more.

Questions tagged [product-sorting]

Denotes question regarding Magento Category Product sorting

Filter by
Sorted by
Tagged with
0
votes
0answers
24 views

Magento 2.4: Add Sort by Quantity (not stock status) on Category Page

I'm working on Magento 2.4.2 with Elasticsearch 7.6. I've tried to add a sorting option on the category page which will sort the products on the basis of quantity added in the product. I've checked ...
0
votes
0answers
20 views

Custom sorting option with Elastic search (Highest Discount Percentage)

I need to add Highest discount percentage sorting option in magento 2.4.2. I have implemented with this code but it is not working with elastic-search $collection->getSelect()->columns(['...
0
votes
0answers
10 views

Show Latest/New products first on Category Pages - Sorting Order

I want to show New product first on category pages. Right now all latest products are showing in last pages of categories. But i want to show on first page. anyone can help me on this issue. I am ...
0
votes
0answers
12 views

Getting Elasticsearch issue while adding new custom option in the sort PLP pages

I am facing one issue in my Magento 2.4.0 Commerce project. Please let me know if anyone has faced this before and you have any solution. It is coming when I try to add a non-product attribute or ...
0
votes
1answer
80 views

Order by price not working - Product listing

I have searched along the web for the solution and I have not found yet. Let me give you the context a little. I'm using Magento 2.3.6, where we got around 57800 products. When you go to the category ...
1
vote
1answer
36 views

Magento 2.3.5: Sorting Products with text type attribute with Flat Catalog Product Function on causes wrong sorting

I created a text type attribute called display_order with the following settings. Catalog Input Type for Store Owner - Text Field Used for Sorting in Product Listing - Yes The display_order text for ...
0
votes
2answers
184 views

Sort products by In stock in magento 2.4

Can we sort products In stock only. see the below screenshot.
0
votes
0answers
36 views

Sorting by position not working with Elastic Search 6+ on magento 2.3.3

When I use mysql as a default search engine in magento 2.3.3 everything works fine as it should but as I change the default search engine to Elastic Search 6+ the sort by position attribute does not ...
0
votes
1answer
143 views

Magento 2: Sort category page collection by custom attribute

I need to sort the product collection in category page by a custom attribute inventory_status. The attribute is of type int. I need to add the sort with the existing sorting applied. For example, if ...
0
votes
0answers
34 views

Specify Default Sort Direction for Specific Collection

I've created a module that adds a new sort by option called 'Date Enabled'. The aim of this option is to display the products that have the 'Date Enabled' attribute set in descending direction by ...
0
votes
1answer
123 views

Magento 2.4 : Sort Product by attribute value

i have configurable and simple product in my website with Attribute color: (Values - Red, Green, Blue) I want to sort product on the listing page with specific attribute value, for example, all ...
1
vote
0answers
423 views

Default sorting options Sort by 'rating' not working in Magento 2.4.1 in ElasticSearch 7.x

I have installed Magento 2.4.1 Open source edition with Elastic Search 7.x version. Magento admin -> Stores -> Attributes -> Product Find default 'rating' attribute and set 'Use in filter ...
1
vote
0answers
46 views

magento 2 sort child products according swatches in product view page

I wanna sort the child products of configurable according to display swatches. I wanna sort the child products in product page. Product page swatches display like this Green,White,Black When I use my ...
1
vote
2answers
1k views

Magento 2.4.1 sort by newest not working

I am using Magento 2.4.1 search engine is elasticsearch7 selected in catalog config. I wanted to add custom sorting options on the category page like sort by price low to high and newest etc. Now I am ...
0
votes
1answer
96 views

Column 'created_at' not imported

My goal is to sort products on the frontend from newest to oldest. The products CSV file contains the created_at column (e.g. 2020-10-31 14:05:44). Format seems to be correct. After the standard ...
0
votes
0answers
23 views

Sort products with most quantity first on product list page in Magento 2

I want to sort products with quantity in a way items with most quantity should be shown first and items with smaller quantity should be shown later. here is a similar solution but it is for Magento 1. ...
3
votes
3answers
837 views

Elastic Search (v7) changing Magento default product sort position in categories

We have installed Elastic Search 7 on a server running a Magento 2.3.5-p1 store and we can test it is successful (both in Magento 2 backend and on CLI) but when it is enabled, it changes the default ...
0
votes
1answer
51 views

Category Products - Sort By Newest

Since upgrading to Magento 2.4x and having to use ElasticSearch as default, I am unable to find a way to sort category products by newest (created_at). I have tried enabling used_in_sort_by for ...
1
vote
0answers
28 views

Sorting Products at Category Page

Is there a way to bulk update products position at Category Page importing a CSV file via System -> Data Transfer -> Import ? Cordially, Daniel Mas
0
votes
1answer
22 views

Unable to sort PLP with Configurable products based on discount (special_price)

I have configurable products in my PLP and I want to sort with "special_price" attribute. I edited the special_price attribute from admin and allowed it to be sortable in storefront. But I ...
0
votes
0answers
38 views

Order by SKU problem

I am trying to order products by SKU but I got it wrong The order is on the Order page (Checkout) This is a snippet of my code $this->_items->getSelect()->order('main_table.sku ASC'); $this-...
0
votes
1answer
63 views

Magento 2- Product list sorting issue for alphanumeric product name

I am facing problem in product list sorting by product name if the name is alphanumeric, Such as "Facewash, 50ml", "Facewash, 200ml" and "Facewash, 500ml". Expected result:- "Facewash,50ml", "...
1
vote
3answers
2k views

Set Default Sort By Name using Layout in Magento 2

I have added the listing of products on the custom page. By default sort by is Position. I have to change it to By default by Name. <referenceblock class="Magento\Catalog\Block\Product\ListProduct"...
0
votes
3answers
256 views

Magento 1.9 - How to set PLP Page Sort By Ascending order in back-end?

How to set sort by position Ascending order by default in the backend.
0
votes
3answers
336 views

Magento2: How to remove default sort option from category page?

I want to remove the default sort option from the category page. I have tried the below code but is not working. unset($options['position']); unset($options['name']); unset($options['price']); ...
1
vote
0answers
49 views

How to sort product by position, if every product has same position?

I read somewhere that if all product has same position it will sort by product id, but I don't think its sorting by Id. Here are a few screenshots I am sharing which I am sorting by position problem ...
0
votes
0answers
67 views

Default sorting option not working in magento 2.2.7?

I am using the default sorting option as product name but when the page loads for first time it is not working. It's only working when selecting an option from the sorting dropdown.
1
vote
3answers
1k views

Magento 2.3 Natural Sort Order for Numeric Attributes / Sort Order Wrong

I have a custom attribute (text field) - let's call it "size". It contains numeric values like 1,2,3,10,20,30. Products are sorted by this attribute on the category page. Expected sort order: 1,2,...
1
vote
1answer
803 views

Sorting attributes are not working Magento 2.3

I'm trying to apply sorting from the toolbar on listing page, but none of the sorting properties like price, new, name etc. are working. As you can see I have applied sort by price, but it's not ...
0
votes
0answers
143 views

Magento 2 : on page load product sorting not working

When I go on the category page, sorting does not work unless I select any value from dropdowns like position or price then it sorts the product. http://prntscr.com/q97trw Can anyone help me how can ...
3
votes
1answer
2k views

Magento 2 how to use elasticsearch for custom indexer? Custom sort stops working after enabling elasticsearch

I am a magento newbie and trying to implementing a custom sort on product listing page with the help of this: https://magento.stackexchange.com/a/230983/84727 On top of the solution i have built a ...
4
votes
1answer
412 views

Sort by product name not working as expected

I've bunch of products, Which names start with word "Bai" and afterwards some digits. Like, Bai-10, Bai-11, Bai-15 etc. I've set Default product listing sort by to "use config setting" and at ...
2
votes
0answers
40 views

Magento2: What is relavence sorting on search result page?

I want to know what is Relevance sorting in magento search result page, how it is working to sort the products
3
votes
1answer
690 views

Magento2 - catalog product listing collection sort by price with dynamic price calculation

product price is calculated dynamically based on certain conditions. while sorting with price it takes only default price not dynamically calculated price. the same issue with the price filter. I can ...
1
vote
1answer
1k views

How to change products sort order in magento 2?

In product list page I need to change the sorting order. I have a current order like: Description A-Z Price High To Low Price Low to High Description Z-A I need to change it to. Description A-Z ...
0
votes
1answer
52 views

Magento 2: Display out of stock items in the end in API

I am using a headless magento 2 approach for my store. I have made an API which accepts parameters like: category_slug, sort_by, sort_order, page_size, current_page and returns the products ...
0
votes
2answers
563 views

Magento 1.9: Change product order and direction on load?

I need on load product order newest and order desc , right now I need to filter it manually and for direction I need to click on arrow twice at product listing....Is there any way to do it ...
0
votes
1answer
810 views

Magento 2 - Custom sort order not working properly

I have created a custom plugin for sorting options for high to low & low to high price. High to low sort works fine but "low to high" sort order not showing correct results. app/code/Digital/...
0
votes
1answer
124 views

Magento 2 What is the different between setDefaultOrder and SetSortBy in layout xml?

I'm trying to set a default sort order to products listing in category page. I have seen people suggest using <action method="setDefaultOrder"> <argument name="...
1
vote
0answers
24 views

How to remove default options from sort order list?

How can I remove default options from de sort by list? For example, see the image? Is it possible to remove Best Sellers from the list?
3
votes
0answers
40 views

Magento 2 - Sort Products by newest

I need to sort the products in categories by newest. I've tried to do it with modifications on Models, but don't works.
1
vote
3answers
1k views

How to print Product collection mysql query in magento2

In my product page Price sorting not works properly. So i need to know which field value consider for sorting ? the issue occurs in configurable products.How do I print the actual MySQL code that gets ...
1
vote
0answers
476 views

Magento 2 sorting configurable products by special_price is not working

I have simple and configurable products on listing page. I am using special_price attribute for sorting. It is working for simple products but not working for configurable products. I have assigned ...
2
votes
1answer
26 views

Apply Check on default sort by options

I just need to apply a check on the default Sort By options. Not on all. only one. That when the user is not login, he cannot sort products by price. Anyone having any idea how to do it. Thanks
2
votes
0answers
363 views

Magento 2.1.10: Sort by Special Price doesn't working

I'm working on category page, and try to sort the products collection by Special Price. I've override setCollection() of \Magento\Catalog\Block\Product\ProductList\Toolbar And the result is the only ...
0
votes
0answers
725 views

magento 2.3.1 - How to sort product name, price in ascending order in search result page?

Below is my search result page sort by product name in result page. Products are sorting by name by Z to A. I want to show the products in A-Z order when user click Product Name sort By option.How ...
0
votes
1answer
724 views

Magento 2: How to sort product on Category page by entity id in desc order?

I need to show all the newly created products on top. So need to arrange all the products according entity id in descending order
1
vote
0answers
121 views

Magento 2 Product Collection add array as column for sorting

I've requirement like following. Products price is calculated on the fly and I want price sorting to be proper with it. I've extend the block Magento\Catalog\Block\Product\ListProduct Following is ...
2
votes
0answers
137 views

Magento 2 REST API: Show In-stock products first in product listing API

I am looking into a headless magento approach. I am using the following API to list the products in a given category: V1/products?searchCriteria[filter_groups][0][filters][0][field]=category_id&...
0
votes
1answer
965 views

Product Sort By Price: Low to High and High to Low Magento2.3

Can you suggest me how to change the sorting option on my site? I am using Magento 2.3.1.