2022 Developer Survey is open! Take survey.

Questions tagged [sort]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
65 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":"...
user avatar
  • 526
0 votes
0 answers
15 views

How to add Custom Sorting option with created date on category page in Magento 2

I want to add Custom Sorting option with created date on category page in Magento 2. Like its label would be Newest Product and the product sort is based on product crated date. SS attached for more ...
user avatar
  • 526
0 votes
0 answers
18 views

Does not show the color order correctly

Magento 2 I have a configurable product with different colors. The order is correct in the admin. For example Blue red black yellow. On the site this order changes black red blue yellow.
user avatar
0 votes
0 answers
11 views

I need to show products in the main category in order of subcategories

I need to show products in the main category in order of subcategories. For example, there is a category Home and it has three subcategories 1, 2, and 3. If you select the main category, it should ...
user avatar
0 votes
0 answers
24 views

Sort order collection based on a custom product attribute

I am trying to sort an order collection (\Magento\Sales\Model\ResourceModel\Order\CollectionFactory) based on custom product attribute data for the product items in the order. It is ok just to sort ...
user avatar
  • 1,280
0 votes
3 answers
70 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 ...
user avatar
1 vote
1 answer
39 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 ...
user avatar
0 votes
0 answers
85 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\...
user avatar
  • 1
0 votes
0 answers
21 views

How to change sort at catalogwidget custom grid phtml?

Without modifying the magento core code.I want to sort according to position in catalogWidget Custom Grid PHTML,What should I do?
user avatar
  • 5
0 votes
1 answer
51 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 ...
user avatar
  • 57
0 votes
2 answers
68 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 ...
user avatar
1 vote
0 answers
18 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 ...
user avatar
0 votes
1 answer
21 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($...
user avatar
0 votes
2 answers
3k 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 ...
user avatar
  • 115
0 votes
1 answer
99 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?
user avatar
-1 votes
3 answers
340 views

Magento 2 - Sort by Brand and Position?

Is it possible to sort by A the Brand alphabetically and then B by Position Programmatically.
user avatar
0 votes
1 answer
652 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 ...
user avatar
0 votes
1 answer
46 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 ...
user avatar
  • 35
1 vote
1 answer
75 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 ...
user avatar
  • 73
2 votes
1 answer
357 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 ...
user avatar
  • 1,474
0 votes
0 answers
763 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 ...
user avatar
  • 95
0 votes
1 answer
209 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 ...
user avatar
0 votes
1 answer
77 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 ...
user avatar
0 votes
1 answer
394 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 ...
user avatar
1 vote
0 answers
75 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 ...
user avatar
  • 11
0 votes
2 answers
46 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 ->...
user avatar
0 votes
1 answer
189 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('\...
user avatar
  • 2,376
2 votes
3 answers
5k 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" : "...
user avatar
  • 2,739
0 votes
2 answers
3k 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 ...
user avatar
  • 377
0 votes
2 answers
186 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 ...
user avatar
0 votes
0 answers
54 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 ...
user avatar
0 votes
2 answers
588 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"> <...
user avatar
  • 113
1 vote
1 answer
219 views

How to Sort the categories alphabetically?

How to Sort the categories alphabetically?
user avatar
4 votes
2 answers
4k 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 ...
user avatar
  • 41
0 votes
1 answer
1k 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/...
user avatar
1 vote
0 answers
28 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?
user avatar
0 votes
3 answers
33 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 ( [...
user avatar
  • 553
3 votes
0 answers
827 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 ...
user avatar
  • 1,355
2 votes
2 answers
1k 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 ...
user avatar
  • 1,355
1 vote
0 answers
61 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'...
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 ...
user avatar
  • 45
3 votes
2 answers
1k 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. ...
user avatar
0 votes
0 answers
644 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 ...
user avatar
1 vote
0 answers
37 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 ...
user avatar
1 vote
2 answers
2k 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 ...
user avatar
  • 53
0 votes
0 answers
229 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 ...
user avatar
  • 1
0 votes
0 answers
616 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 ...
user avatar
2 votes
1 answer
996 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 ...
user avatar
1 vote
0 answers
77 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\...
user avatar
6 votes
1 answer
655 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 ...
user avatar
  • 2,116