Questions tagged [product-sorting]

Denotes question regarding Magento Category Product sorting

Filter by
Sorted by
Tagged with
5 votes
1 answer
1k views

Magento 2 - Get Collection using custom product Ids and also sort them as the same order as product Ids passed

I need to get the collection using custom product Ids but it should sort the collection based on the sequence product Ids given Here is what I am doing now, but it is not sorting in sequence $...
Muhammad Anas's user avatar
4 votes
1 answer
706 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 ...
anonymous's user avatar
  • 3,724
4 votes
1 answer
3k 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 ...
Vivek V. Bharos's user avatar
4 votes
2 answers
2k views

How to sort by popularity in magento 2 product list?

I want to sort products by popularity and discount(high to low). How can I achieve?
Vinod Kumar's user avatar
  • 2,045
3 votes
1 answer
1k views

Sort products by color in the cart in Magento2

I have configurable products with virtual variations by color and size. In the cart, I am trying to arrange them in the order of priority, by configurable parent, then by color, then by size. In my ...
Supersonic's user avatar
3 votes
3 answers
3k 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 ...
zigojacko's user avatar
  • 1,754
3 votes
3 answers
2k 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,...
Stefan's user avatar
  • 43
3 votes
1 answer
1k 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 ...
Shailesh Katarmal's user avatar
3 votes
0 answers
175 views

Magento 2.4.4 upgrade after custom sorting filter Ascending/Discending order not working with porto theme?

I have upgrade Magento version 2.3.7 to Magento 2.4.4, before upgrade custom sorting option is working fine.after upgrade popularity asc/desc sorting is not working. we are currently using smartwave ...
pankaj parmar's user avatar
3 votes
1 answer
2k views

Position sort order for products in any category not working on Magento 2.4.1-p1

Magento 2.4.1-p1 9 extensions from Amasty Smartwave Porto theme I just noticed that assigning position numbers to products in any category does not reflect on the front page = it does not sort based ...
Allysin's user avatar
  • 178
3 votes
0 answers
47 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.
Raphael Cordeiro's user avatar
3 votes
0 answers
693 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 ...
fudu's user avatar
  • 1,258
2 votes
4 answers
2k views

Change 'Sort by Position' text to 'Sort by New' Magento 2.2.6

This must/should be easily achieved...I am simply hoping to change the 'Sort By Position' text to 'Sort by New' in the Magento category list toolbar. I have attempted to do this by creating the ...
YorkieMagento's user avatar
2 votes
1 answer
1k views

Magento 2.2 - custom product sorting issue

I have override toolbar.php for custom sorting attribute. <?php namespace Vendor\Module\Block\Product\ProductList; class Toolbar extends \Magento\Catalog\Block\Product\ProductList\Toolbar ...
Jigar Dhaduk's user avatar
2 votes
2 answers
1k views

Remove option "Relevance" from sort by

When I do any search we can see a list of products with the field "Sort by", but I need get rid of the option "Relevance": If I go to a category from menu I don't have this sorter. Any idea?
str_lml's user avatar
  • 105
2 votes
1 answer
233 views

Getting the wrong chinese string in search query result!! Magento 1

I have a store in chinese language. When I search for any product it works fine. But when I sort the result page by sku, name or price it does not work. It seems that I've got the wrong url for ...
Sunny Rahevar's user avatar
2 votes
3 answers
5k views

Magento 2 filtering product collection and sorting

Considering below I can display products with true value of my custom attribute in ascending order based on position. How can I have products with false right after these in ascending too? if ($...
Zinat's user avatar
  • 2,049
2 votes
2 answers
1k views

How to restore 'sort by position' option for category sorting

In our store the sort by position (ie 'Best Value') option is not being shown when viewing categories. I believe this was removed/hidden by someone in the past but now we want to show it again. I ...
Chris's user avatar
  • 1,389
2 votes
0 answers
86 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
Purushotam Sharma's user avatar
2 votes
1 answer
41 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
Zeeshan's user avatar
  • 181
2 votes
0 answers
249 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&...
Fokker's user avatar
  • 375
2 votes
1 answer
462 views

Help with Magento 2.3 custom product sort plugin

I have tried to implement a custom sorting plugin in Magento. Namely, with the options: Price (Low > High) Price (High > Low) Name (A - Z) Name (Z - A) Now, I have the plugin installed and ...
Rick West's user avatar
2 votes
0 answers
1k views

magento 2 : Product listing default sorting order based on attributes

i have add sort by attributes to products say like below one. "Publish date" "Product Name" "Price" Now i want to change sort order based on default attributes. For eg 1: Publish date -> Descending ...
user1799722's user avatar
2 votes
0 answers
176 views

Best seller sort order pagination query string not working correctly

our website having two sort order. one is position and another is best seller. but when i select the best seller sort order that time showing all the best seller products. but problem when select ...
pramod24's user avatar
  • 521
2 votes
1 answer
313 views

Sorting by Custom Attribute value/id

I'd like to add a custom attribute to listing products toolbar. This is a dropdown attribute, that looks like this: Available today Available in 1-5 days Available in 5-10 days I have set "Used for ...
zekia's user avatar
  • 620
1 vote
3 answers
3k 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 ...
Shafeel Sha's user avatar
  • 1,385
1 vote
1 answer
2k 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 ...
Ramesh KR's user avatar
  • 836
1 vote
2 answers
4k 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 ...
Klaus Mikaelson's user avatar
1 vote
1 answer
154 views

Multiple sorting, get first count of sorting

I want to know the count of the first sort of listing product in categories. I override /vendor/magento/module-catalog/Block/Product/ProductList/Toolbar.php to /app/code/Vendor/Module/Rewrite/...
Diego Castro's user avatar
1 vote
1 answer
667 views

Product position in category not saved correctly

I have a strange problem in our Magento 2.4 installation. In a product category you are able to specify the position of a given product by entering a value in the position column. This helps to ...
Gunnar's user avatar
  • 51
1 vote
1 answer
160 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 ...
user2240778's user avatar
1 vote
3 answers
5k 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"...
m2dev's user avatar
  • 63
1 vote
1 answer
1k 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 ...
AjayKr's user avatar
  • 145
1 vote
2 answers
1k views

How to Shuffle Product Collection in Magento 2?

I am getting products collection form multiple categories. I want to shuffle products everytime when function getProductCollection() is called. My function is: public function getProductCollection($...
Ajwad Syed's user avatar
  • 1,591
1 vote
0 answers
158 views

Magento2 PLP / SLP - Custom Sort Option doesn't work with ElasticSearch

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 ...
Nits's user avatar
  • 2,476
1 vote
0 answers
1k 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 ...
sandip's user avatar
  • 3,924
1 vote
0 answers
193 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 ...
Niraj Patel's user avatar
1 vote
0 answers
46 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
Ginoi Marketpace's user avatar
1 vote
0 answers
398 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 ...
Sagar Parikh's user avatar
1 vote
1 answer
2k 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/...
Shoaib Saleem's user avatar
1 vote
0 answers
51 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?
Jeroen Baas's user avatar
1 vote
0 answers
674 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 ...
Vinod Kumar's user avatar
  • 2,045
1 vote
0 answers
394 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 ...
Kaushal Suthar's user avatar
1 vote
1 answer
1k views

Sort products in ascending order by name on specific category page not working

I want to sort product for a specific category by name in ascending order but it is still sorting in descending order in the front-end. For a category under Display Setting, I have set Default ...
Kevin S's user avatar
  • 169
1 vote
0 answers
57 views

how to sorting product in listing page by group product in magento 2

How do I show all group product first in the product listing page first and then the rest of the product shown
Shubhajay Das's user avatar
1 vote
0 answers
71 views

Sort product in research result in BO

how can I change the default sorting order from the position to the order of the category ? In my result, I have some product of the Category 2 that appeared before the Category 1 (probably because I'...
Morgan Tartreau's user avatar
1 vote
1 answer
480 views

Magento 2.2 - Products sort by URL issue

I am facing category page url issue when try to sort products by Price (low to high) or (high to low). I'm using below code to add Price options (high to low). <option value="<?= /* @...
Shoaib Saleem's user avatar
1 vote
1 answer
698 views

Magento 1.9 - Product collection sort by price not working fine

This is my product collection. $collectionWithRank = Mage::getResourceModel('catalog/product_collection') ->addCategoryFilter($cat_data) ->addAttributeToSelect('*') ->...
Ejilarasan J's user avatar
1 vote
0 answers
408 views

While sorting my product collection automatically shuffeling

For Magento 2.2 I'm using:- $categoryId=185; $ct = $_objectManager->create('Magento\Catalog\Model\Category')->load($categoryId); $collections = $ct->getProductCollection() ...
Wakar Ahamad's user avatar
1 vote
1 answer
260 views

Magento 1 : Sort Product Listing By New?

Working on magento 1 website. I want to sort the product sorting by new in all product categories. So that when any new product is added that shows on first. Can i be please guided how can same be ...
RANU EMPRISE's user avatar