Questions tagged [sorting]
Denotes questions related to sorting collections in Magento.
377
questions
0
votes
2
answers
52
views
Sort by A-Z Product List Page in Magento 2?
I am adding below code but sort not shwoing in frontend.
unable to add sort by A-Z
1
vote
0
answers
34
views
How to remove default entity_id sorting in magento 2?
I need to remove the default entity_id sorting from category product collection and add position sorting.
here i try using the below method
> $cp = $category->getProductCollection()->...
2
votes
0
answers
42
views
Sorting custom columns from module that extends another module containing all the data (collections, data providers, etc.)
I have two custom columns in UI grid (let's call them subscribed_customers" and "unique_purchases") created in particular listings that retrieve value from the database with logic. ...
0
votes
0
answers
23
views
Only one row data is showing repeteadly in magento admin custom extension after upgrade to 2.4.6
I have one custom extension named jes.It was working fine in 2.4.0 version.In adminhtml the data is showing repeatedly. Like if there are 8 rows of different id then in 8 rows same data is shown. When ...
0
votes
0
answers
38
views
How to sort products in Magento by new from date?
I wanted to sort products by new from date , please see the query but
it is not working perfectly
$collection->getSelect()
->joinLeft(
['catalog_product_entity_datetime' =>...
0
votes
0
answers
57
views
Sorting not working on magento246p1 (Facing error : We can't find products matching the selection)
using magento 2.4.6
getting issue in plp custom sort
Elasticsearch is working fine
and also run indexer:reindex command
<?php
namespace Tekglide\CategorySortBy\Plugin\Catalog\Block;
class Toolbar
...
0
votes
2
answers
89
views
Override Model File Magento 2
I want to override Magento\PageBuilder\Model\Catalog\Sorting\SimpleOption.php file. Please check the code below,
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0
votes
1
answer
158
views
Plugin SortOrder
I was reading plugin documentation and I was wondering, if there is a plugin with SortOrder=0 how can i excute another plugin before that one, would SortOrder=-1 work? Is that a bad practice? Is there ...
0
votes
1
answer
576
views
Why Out of Stock Products showing at end of list in Magento 2.4.5?
We have created a category page and assigned some products to that category page.
We have also assigned some out-of-stock products.
But when we sort products by price the out-of-stock products show at ...
0
votes
1
answer
30
views
Field order in onestepcheckout of Claue Template
I use onestepcheckout from claue theme and PostNL address check. As you can see postcode, huisnu and toevoeging are at the bottum of bezorg adres iso after achternaam. How can i move these fields up?
0
votes
1
answer
243
views
Can not re-order "Customizable Options" on "Simple Products"
I recently upgraded from Magento 2.3.x to 2.4.5. Bit of a hassle but got basically everything working.
One issue I am having is with the "Customizable Options" section when creating or ...
3
votes
0
answers
90
views
Sorting images issue ( Magento 2.4.3
I face an issue when upload images bulky that i don`t have the way to sort it as i want , it is sorted random , even if i one of it as base,small,thumbnail
Need the way to know how to sort it for ...
3
votes
0
answers
194
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 ...
1
vote
1
answer
44
views
How to change (text) after sorting option on category page
I need help changing the text in () when selecting the sort option. With translation I change to Low to high and High to low but I have to change Product name to (A-Z). I don't know how to change only ...
0
votes
2
answers
647
views
How to sort menu items in the top menu in alphabetical order in magento2 frontend
Is there any way to sort menu items(Categories) showing in Magento in alphabetical order?
0
votes
1
answer
465
views
Magento 2 PWA store add new sorting in product listing page
How to add new sorting in product listing page. I have frontend is PWA. So can you explain me how do that.
THANKS.
0
votes
2
answers
1k
views
Some Filters not showing on some Categories in Magento 2.4
Some Filters not showing on some Categories in Magento 2.4
As you can see in two images both are diffrent categories but Newest filter not showing in second image.
In some categories it just show ...
0
votes
3
answers
2k
views
Custom Sorting option not working in Magetno 2.4 search
Custom Sorting option not working in Magetno 2.4 search
app/code/Arun/NewSorting/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&...
0
votes
1
answer
489
views
How to add sort by filters to the custom collections magento2
I would like to display Sort By filter options to the order collection Magento2 at the front-end and display the results.
Sort by options are 'processing','cancelled', 'hold' etc.
Can anyone advise ...
0
votes
1
answer
829
views
Sorting custom column in ui component
I've created a custom column in the report using UI components that use DataProvider in report_listing.xml
Unfortunately, this new custom column is not able to sort.
I made also a class for this ...
0
votes
2
answers
1k
views
Sort order products in categories by custom value attribute first in Magento 2
I want to sort products with custom value (1) numeric attribute. In toolbar.php:
if ($this->getCurrentOrder()) {
$this->_collection->addAttributeToSort(
$this->getCurrentOrder()...
0
votes
1
answer
569
views
How to create custom sorting in sales grid custom column in Magento 2?
I have created a custom column named printed which shows the invoice is printed or not and works well.
But how to apply sorting in in it like when i click on printed firstly it shows all data with ...
0
votes
3
answers
332
views
How to sort modules in config.php alphabetically?
Is it possible to sort the output of the modules node in config.php alphabetically? This way git versioning won't get messed up since Magento sometimes changes the sorting.
<?php
return [
'...
0
votes
1
answer
1k
views
Magento 2 | Change sort order for search results
I would like to set as the default order in the search results page "relevance" in descending order.
How can i do?
Thanks
0
votes
0
answers
633
views
Magento 2.3.2 sort the product collection by attributes
I want to sort the product collection by attributes. I want to apply multiple sorting to the product collection need to sort by NEW, ONSALE, and POSITION
For example when going to any listing page ...
0
votes
1
answer
348
views
Can we update Product Position in Category with CSV in M2?
Can we update products position with csv in Category ? If yes than please share share any sample or example.
Thanks
0
votes
0
answers
28
views
Best way to do this?
I've been racking my brains for a long time trying to think of the best most efficient way to solve the following problem.
Basically I have a set of questions which I'm looping through in the ...
2
votes
1
answer
379
views
Custom Sorting on category page not working in Magento 2.4.2
I have Magento 2.4.2.
I have written a custom code to add A-Z & Z-A filters on category page.
I have added dependency injection using below code
<preference for="Magento\Catalog\Block\...
2
votes
0
answers
224
views
Magento 2.4.2 and elasticsearch issue (sort by position)
As I have seen, sort by "position" does not work with Elasticsearch (I have no result when I want to see the products in a category).
I would like to disable position sorting on ALL ...
0
votes
1
answer
445
views
Paginate order list by 15 items and sort by price ASC
I need to do sort by price and paginate by 15 items for order list history page, can anyone help?
0
votes
2
answers
1k
views
Sort products by In stock in magento 2.4
Can we sort products In stock only.
see the below screenshot.
0
votes
1
answer
646
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
1
answer
616
views
How can you map a virtual column in magento 2.4.1?
I have just upgraded to Magento 2.4.1 that REQUIRES you to use Elasticsearch as the search engine instead of MySql.
In the previous setup (Magento 2.3.2) I had a custom sort by a discount in the ...
4
votes
2
answers
2k
views
Elastic Search: Custom sorting options not working after enable elastic search
I'm trying to add custom sorting options like newest products,price high-to-low & price low-to-high in category page using plugin. After creating plugin it's working good in category page and ...
0
votes
1
answer
232
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
1
answer
98
views
Magento2 query displaying perfect result in database but wrong in collection while sorting by created_at
Magento2 query displaying perfect result in database but wrong in collection while sorting by created_at
Query
SELECT `e`.*, `cat_index`.`position` AS `cat_index_position`, `price_index`.`price`, `...
0
votes
1
answer
192
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 ...
0
votes
0
answers
128
views
Magento2.4 sort by created date not working
Magento2.4 Sort by created date not working on list page
case 'new_arrivals':
$this->_collection->getSelect()->order('e.created_at '. $this->getCurrentDirection());
break;
It just ...
-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.
1
vote
0
answers
48
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
2
votes
1
answer
4k
views
Magento 2 GrahQL Product Sorting does not work for the product query with category Filter
I have this graphQL query
{
products(filter: {category_id:{eq: "5"}, price: {from: "0", to: "999999"}}, pageSize: 10, currentPage: 1
sort: {position: DESC}) {
...
1
vote
1
answer
1k
views
Custom column sorting(DESC and ASC) not working in custom grid Magento 2.3.5
Actually in below listing.xml file i am trying to sort customer_id
column DESC/ASC but not working fine. After using below code it's loading the data in ASC order only if sort customer_id column one ...
0
votes
1
answer
91
views
Show products with zero quantity last in Magento 1.9
I want to show products with zero quantity last in all site categories, search results, etc. But the sort order should be as follows: the products with a non-zero quantity (not in decreasing, default (...
0
votes
1
answer
644
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 ...
1
vote
2
answers
530
views
Magento 1.9 How to sort product in category page by stocks product
I want the products to be displayed on the category page, if available
That is, first those that are stocks , then those that are not stocks
I didn't find anything with the title in the attribute
Is ...
1
vote
0
answers
445
views
Sort Menu items in aphabetical order magento 2 in observer
I am creating menu items in magento 2. I is working fine and generated according to category order in admin dashboard.
But I wanted to sort the menu items alphabetically on store front ir-respective ...
1
vote
0
answers
131
views
Magento 2.3 sortOrders not working in search rest API
I tried to pass sort order in V1/search API as below but the sorting is not working in the result.
searchCriteria[sortOrders][0][field]=price
searchCriteria[sortOrders][0][direction]=DESC
Anyone has ...
1
vote
0
answers
453
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 ...
1
vote
1
answer
837
views
Sort product collection by date in standart category view
I'm running Magento CE 2.3.3 with Porto theme.
I want to sort the products in the category overview by the date they were added without using an extra extension.
By default products in category view/...
4
votes
8
answers
2k
views
Magento2: I want to show featured product on top of the category and search result
I have yes/no type product attribute.
If this featured attribute is yes for any products, those product will show top(first featured product showing in category page then rest of the products are ...