Questions tagged [sort]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
120 views

How to add custom sort like Most View and Best Selling products in API of Product List in Magento 2?

How do we add custom sorts like Most View and Best Selling products in the API of Product List in Magento 2? I need to add the most views and best-selling products in /V1/products to this API using ...
Devidas's user avatar
  • 3,348
0 votes
0 answers
28 views

Getting this erorr You cannot define a correlation name 'news_from_date_table' more than once

When I am using above mentioned query then getting the error You cannot define a correlation name 'news_from_date_table' more than once $subquery = $collection->getConnection()->select() ...
Mark's user avatar
  • 53
0 votes
1 answer
1k views

created_at sorting not working in Magenot 2.4 using elasticsearch

I have created a custom sorting using created_at but result is empty. when i checked logs it shows error main.CRITICAL: {"error":{"root_cause": [{"type":"...
Prits's user avatar
  • 626
0 votes
3 answers
264 views

Magento ver. 2.4.3 sort attributes in additional tab on catalog product view

I need to re-order / sort the attributes on product detail page. They are sorted with there attribute_id but I don´t want to delete and recreate them. I know that the attributes can be sorted for the ...
guest123's user avatar
1 vote
1 answer
57 views

Sorting Street fields in magento 2.4

I am with a need to reorder 03 street fileds in the following order in shipping, billing, and customer address forms. street[2] - first street[1] - second street[0] - third I could reorder other ...
Indunil Ramadasa's user avatar
0 votes
0 answers
201 views

Magento 2.4.1 Custom sort option best sellers is not working

I have created a custom bestsellers sorting option, the query working fine but setOrder() and order() is not working, i want to sorting the values using qty_ordered <?php namespace Vendor\...
Ali's user avatar
  • 1
0 votes
1 answer
956 views

Add custom sort by options for magento 2 catalog

In magento 1, for my catalog Product List, in Toolbar.php already i added sorting class and in my catalog page - there was an option to sort products about these attributes: <?php class ...
Lerry's user avatar
  • 69
0 votes
2 answers
126 views

Magento 2.4 Custom Sort Order to Print Multiple PDF Invoices (Grouped Print sorted by Customer Name, then by order date)?

Is it possible to select a range of invoices, apply a sort (say by Customer Name), then to print the selected range in that order? We have customers placing numerous orders in a week that we list ...
Alun Morgan's user avatar
1 vote
0 answers
134 views

Plugins prioritization

The documentation mentions the sort order is always from lowest to highest, except when around plugins are used, then The around plugin’s method affects the flow of all plugins that are executed ...
Bogdan Tomi's user avatar
0 votes
1 answer
27 views

Fetch data and arrange sequence in given format

This is my array: <?php $sku = ['HH017','HH018','HH005','HH010','20OZHHTUMBLER', '30OZTUMBLER2','HH006','HH-05']; $sequence = ['HH005','HH010','HH006','20OZHHTUMBLER',...]; print_r(sort($...
IntraPersonalLearner's user avatar
1 vote
2 answers
7k views

How can I add "Sort by newest" and set it as default?

I'd like to add custom sort option "Sort by newest" using created_at system attribute and I'd like to set it as default, from the backend Stores->Catalog->Storefront->Product ...
KaMZaTa's user avatar
  • 205
0 votes
1 answer
349 views

How to sort ordering of store view change list in Magento 2.3.4

I want to sort alphabetically this store view change list. Can anyone help with how can I do this in magneto 2.3.4?
Shubhajay Das's user avatar
-1 votes
3 answers
1k views

Magento 2 - Sort by Brand and Position?

Is it possible to sort by A the Brand alphabetically and then B by Position Programmatically.
user91213's user avatar
0 votes
1 answer
1k views

Magento 2.4 Sort products by date

I've found topics about enabling sorting by date, this being one example but on 2.4 this does not work, even manually typing ?product_list_order=created_at in url does not get any results, is there ...
James Ambardnishvili's user avatar
0 votes
1 answer
306 views

Changing product's Sort By default

How do I change the default by which the products are listed in the catalog? I tried from the Admin Panel but didn't work. The current default is by "Product Name" but now I want to set my ...
luenib's user avatar
  • 135
1 vote
1 answer
151 views

It is possible to sort Email order confirmation by sku in both customer email notification and Admin email notification

I am on the m2 site. In order confirmation email I am getting SKU. But I need that SKU sort by ASC. Could someone assist me with this? Thanks in advance. I have overridden the below file in my theme ...
M2 Dev's user avatar
  • 73
2 votes
1 answer
671 views

Magento 2.3.5 - Category sorting is not saved when drag and drop

When we change the sorting of subcategories, by drag and drop in the admin panel, these new sorting is not saved. When we refresh the page, it randomize all subcategories and there is no logic in the ...
JGeer's user avatar
  • 1,416
0 votes
0 answers
976 views

Magento 2 - Unable to change category products position

In Magento 2.3.0, I try to change position for category products. In admin, each position is set but in the frontend, nothing changes. Even after clear/flush cache and reindexing. Do you know how ...
Fbr's user avatar
  • 157
0 votes
1 answer
633 views

Change order of widget catalog products list

I have a product in my product list, which must be at the top. After I have extended the product list, the product is unfortunately no longer at the top. I add the product list via the widget catalog ...
Jackridder's user avatar
0 votes
1 answer
299 views

Magento2: How to apply two sorting one magento default one and other sort by attributes?

I want to sort my products by attributes : that is working fine but I want to apply two sort together , like sort by name asc and sort by attributes asc also How can I implement this ?. Based on ...
user1799722's user avatar
0 votes
1 answer
702 views

sort order as newest product first option in products in category in category edit does not showing in magento 2.3.2

I want to sort category default sort as newly added SKU at top and oldest at last , this means new to old (SKU) default sorting in frontend of magento 2. But i am not able to see option => sorting ...
kannanwebtech's user avatar
1 vote
0 answers
165 views

How to make the null or 0 stored 0, not infinity in elasticsearch

I have define new eav attribute(Test_decimal) with 'decimal' type. The Test_decimal can sort in PLP and SRP. Added value to Test_decimal attribute for some products Run php bin/magento indexer:reindex ...
Amanda's user avatar
  • 11
0 votes
2 answers
230 views

Sorting repository by more than one attribute

I want to sort a repository by more than one attribute. Any ideas of how to achieve this? What I have so far is this: public function getLatestPosts() { return $this->postRepository ->...
Paloma Martinez Ocegueda's user avatar
0 votes
1 answer
434 views

How to sort the options of the dropdown attribute in magento 2

I am using the following code to get the options of the select attribute. Now I want to get the options that should be ordered alphabetically. file.php $eavConfig = $object_Manager->get('\...
Jaisa's user avatar
  • 2,596
2 votes
3 answers
7k views

Magento 2.3.3 main.ERROR: {"error":{"root_cause":[{"type":"query_shard_exception","reason":" No mapping found for ['attribute'] in order to sort on

I have just upgraded to Magento ver. 2.3.3 (from 2.2.8) with Elasticsearch and I am having an issue with my custom module regarding the sort by options. Elasticsearch information: { "name" : "...
Greg's user avatar
  • 2,929
0 votes
2 answers
5k views

jquery ajax sort response

I am showing ajax response in select options as below code. I want to sort the select options in alphabetical order of values. Please provide a solution to sort below data on values basis. My data ...
chanchal's user avatar
  • 417
0 votes
2 answers
237 views

Magento 2 sort by Attribute value

I have multi-select attribute name location like : Delhi , Maharashtra, Karnataka. I want to use sort by of filter by in such way when I use above filter / sort it should show all products but ...
user1799722's user avatar
0 votes
0 answers
75 views

Is it possible to sort Email order confirmation by SKU

My website is on MAGENTO 2 Any time that a customer send an order I received an email confirmation with SKU, DESCRIPTION, PRICE. But I need that this email report is sorted by SKU. is it possible? is ...
Teos_Staff's user avatar
0 votes
2 answers
902 views

Magento 2.3.2: Sort by Bestselling Minimal results

I am using custom code to implement sort by Best selling on the category page, I have created an around plugin for <type name="Magento\Catalog\Block\Product\ProductList\Toolbar"> <...
Nagamani's user avatar
  • 143
1 vote
1 answer
426 views

How to Sort the categories alphabetically?

How to Sort the categories alphabetically?
Junaid Ashfaq's user avatar
4 votes
2 answers
5k views

Custom sort by is not working with elastic search in magento 2.3

After upgrading magento 2.3 and enabling magento new feature elastic search 6, My custom module for sort by is not working. It is perfectly fine working with MySql option but not working with elastic ...
rnegi's user avatar
  • 41
1 vote
2 answers
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
58 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
0 votes
3 answers
57 views

Sorting went fail for array

I am having the array of color attribute options... I would like to sort the array based on 'store0' key... I have used multisort and usort but its not working [821] => Array ( [...
1990rk4's user avatar
  • 593
3 votes
0 answers
1k views

Magento 2 :Change order of billing address

In the customer account section,how can i edit the order of address data(billing and shipping)(ie, i want to show customer company first and customer name second) https://prnt.sc/nucm3l I found this ...
Vindhuja's user avatar
  • 1,395
2 votes
2 answers
2k views

Magento 2 :Sort Attributes Alphabetically in layered Navigation

I want to sort the attributes in layered navigation in the alphabetical order. http://i.prntscr.com/zDuYTVDbSWqv_507ew0JbQ.png Sort in the order as:Climate, Color, ... I tried to override the ...
Vindhuja's user avatar
  • 1,395
1 vote
0 answers
77 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
2k views

Magento 2 - Add custom sort by option in cattegory page and make it default

I have added custom sort by option "random" for category page. I have used following code to add random option: I have used plugin . app/code/DL/CustomSortOption/etc/frontend/di.xml <config ...
Mudasser Hayat's user avatar
3 votes
2 answers
2k views

How to reorder street address on checkout page in magento 2?

I am getting every field unordered on checkout page but I added code to sort them and now everything is sorting but the street address is not getting sorted I am getting a street address field on top. ...
Bhakti Thakkar's user avatar
0 votes
0 answers
744 views

How to change order of form fields in the checkout page in magento 2?

I want to change the order of form fields in the checkout page.I want to reorder these inout fields I referred this link Magento 2 - change the form fields sort order in checkout but I am getting ...
Bhakti Thakkar's user avatar
1 vote
0 answers
44 views

How can I show all products in a top level category sorting by the child categories?

I have this category structure below: When I access Men page all products of child categories are there, but they are showing in a random mode, i believe. I want to show the products in the main ...
Diego Queiroz's user avatar
1 vote
2 answers
3k views

how to sort stock by quantity in magento 2.3

In magento frontend i want to sort products by maximum quantity first to lower number of stock (Quantity sort in descending order) Please advise which module to be made and where to save the files i ...
shezan's user avatar
  • 53
0 votes
0 answers
242 views

Catalog Search Results page - sort by price not working

Steps to reproduce: Search for a term and the results are displayed by default sorted by Relevance. Change the sort by parameter to Price and change the sort to ascending order. Results are not ...
Balram's user avatar
  • 1
0 votes
0 answers
764 views

How to display categories in menu in the same order as in admin category tree?

I wonder if there way to have same sort order of categories in frontend menu as in admin panel category tree. I thought position attribute should be used for this goal, but I've found that categories ...
Dima Portenko's user avatar
2 votes
1 answer
1k views

How to sort a collection after load

I have a store collection. And it has the following fields [0] => Array ( [location_id] => 5 [title] => Los Angeles [description] => [status] => 1 ...
Nismath vi's user avatar
1 vote
0 answers
101 views

How to change Product Listing Sort by custom select option? [closed]

In my module, I have created a select option with attributes. When I select an attribute, that attribute will be set to sort by default. How can I do that. I found Magento\Catalogfile\Block\Product\...
Thành Trung Tô's user avatar
6 votes
1 answer
972 views

How can i change order position of swatch in ascending Magento2

I want to change the sort order of size swatches. I have already put it in sort order from admin but I could not see any result in the front side. Actual Result Expected Result How can I sort it as ...
Jaimin's user avatar
  • 2,146
1 vote
0 answers
31 views

Magento 2.1.9 broken sorting

On this online store - https://nammu.com/ Sorting is not working, all time gives random result for sort I checked and changed the settings in the admin panel, in the category section and in the ...
Roman Stasula's user avatar
1 vote
1 answer
4k views

Magento 2 layered navigation attribute option sort by name not number of products

My theme is child of magento blank. On default magento 2 layered navigation sort labels of attribute in layered navigation by Count number of products that exist with this attribute. I need to change ...
BartZalas's user avatar
  • 1,757
0 votes
2 answers
30 views

Remove Free shipping option

Not sure how to remove free shipping option from sort by options. There is currently no free shipping products but it picks up all products, hence misleading. Thanks
Sonam Sareen's user avatar