Questions tagged [product-sorting]

Denotes question regarding Magento Category Product sorting

2
votes
0answers
23 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
27 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
0answers
15 views

Sort products by dropdown product options instead of option ids

I have a custom dropdown attribute in magento 2. i am sorting with the following code <?php use Magento\Framework\App\Bootstrap; include('app/bootstrap.php'); $bootstrap = Bootstrap::create(BP, $...
0
votes
1answer
30 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
24 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
22 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
0answers
25 views

Product Sorting not working Magento 2 product listing page

I have created a custom module to remove duplicate products from product listing page for that i have overridden the Magento\Catalog\Block\Product\ListProduct file using di.xml file. But the problem ...
0
votes
0answers
12 views

Custom dropdown attribute sort by option is not showing proper result on category page in magento 2

I am using magento 2.2.6 and create custom product dropdown attribute called patter_name and i wanted this to use for product sort by on category page. but when i sort by this attribute "patter_name"...
0
votes
1answer
37 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.
3
votes
2answers
137 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 $...
0
votes
0answers
40 views

Make Relevance sort order available for sorting catalog product list through admin panel

I am using Magento v 2.3.0 While working with the search issue I found out that magento search list the products with relevance sort order but as soon as you go to next page the default sorting option ...
1
vote
1answer
42 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 ...
1
vote
0answers
16 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
0
votes
0answers
100 views

Magento2 Catalog search result and product listing grid only sort by product name set

I need below condition to my website. Magento2 Catalog search result and product listing grid only sort by product name to be set. I have also back-end configuration done but issue is like product ...
2
votes
1answer
139 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 ...
0
votes
1answer
43 views

magento 1.9 how to get the associated products of a configurable sorted by super attribute position?

I need to get all the simple products associated with a configurable, but sorted by the super attribute position, for example, size. If I have $parent_product, I need $child_s, $child_xl, $child_m, $...
0
votes
0answers
319 views

Magento merge two collections with different sorting orders

I have one store in Magento 1.9 , There is a listing page with AJAX scroll loading, on first page I am showing 24 products. We are showing products with label In-Stock and Sold Out, In-stock products ...
1
vote
0answers
45 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'...
0
votes
0answers
29 views

Magento Product Listing Sort By not working on some category

The issue is that on some of the category pages the Product Listing Sort By is not working while on some it is working. I appreciate all the help you can give. The Magento version is 1.9.3.0
1
vote
1answer
82 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="<?= /* @...
1
vote
1answer
97 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('*') ->...
0
votes
0answers
57 views

how can i sort by using option value not option id value in listing page magento 2?

I have created a custom dropdown attribute and set in sort by dropdown listing page, now currently magento 2 sort by using option id like "name="option[value][139][0]" but i want to sort using option ...
0
votes
1answer
73 views

Sort Product Collection By Event Date Custom field

I have created Events type products using Magento Virtual Product. A custom product attribute "event_date" has created to mark the event as Active or Past event. If the event_date field value is a ...
1
vote
0answers
475 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 ...
0
votes
2answers
314 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 ...
0
votes
0answers
29 views

Magento 2 how to import Product Sorting from external table?

We want to transfer the prodct Sorting from our M1 Shop to M2 Shop. We got a product list with their sorting withing the product categories which looks like this SKU Sort 123 1 234 2 345 ...
1
vote
2answers
254 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($...
0
votes
1answer
92 views

Desperately need Help with a task for a test in Magento 1.9.3

So guys, I'm doing this task for something very important to me but now I'm completely stuck. I need to fulfill this task: Create a module to output a nice list of the products that have a value ...
2
votes
0answers
63 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 ...
1
vote
0answers
275 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() ...
0
votes
0answers
98 views

Is the Magento Catalog List Product widget supports “Sort by Position”?

We have used the Catalog List Product widget to display the products on the home page of our site. But the products are not displaying as per the position value which we were given for the products ...
0
votes
1answer
37 views

Product List Issue

I'm having a problem with the product list in Magento 2. For the most part everything is working properly, but occasionally when I change the sort order to 'desc' or change the sort criteria to 'name' ...
0
votes
2answers
96 views

how to remove white space from product name during custom product collection?

I am getting stuck with white space in set order during product collection in magento 2. I want to get product details with ascending order via name but name has white space. I have removed white ...
1
vote
1answer
65 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 ...
2
votes
1answer
473 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 ...
0
votes
0answers
181 views

Override Toolbar.php having issue for catalog page magento2

I have done the following: registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, '...
2
votes
2answers
394 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?
0
votes
2answers
61 views

Magento2 : How can to get product collection by sorting with stock status i.e Asc,Decs

I have all product collection but I want it sort/order_by by Stock Status.for out-of-stock.
0
votes
1answer
111 views

How to set the order of the query as descending

I have created a query that would allow me to sort my products based on the quantity they have been ordered. But when I print the query, the quantity ordered is coming in Ascending order. I want to ...
0
votes
1answer
29 views

When sort the products,product name displayed as ' UNDEFINED' magento1

When sort the products,product name displayed as ' UNDEFINED' magento1.How to solve this.?
2
votes
3answers
1k 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 ($...
0
votes
1answer
4k views

Magento 2.2 - Sorting product in category page by position not working

I'm trying sort products in category page by position. But Magento2 does not react to changes. Any ideas how can I fix it?
2
votes
1answer
101 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 ...
0
votes
1answer
89 views

Magento 2 : How to suffle the products by sort on list page?

I want to snuffle the products on list page but unable to do that. Here is the code. app/code/Am/Suffle/etc/frontend/di.xml <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/...
3
votes
1answer
549 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?
2
votes
1answer
168 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 ...
2
votes
1answer
687 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 ...
3
votes
1answer
405 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 ...
0
votes
2answers
638 views

How to Sort New Products at Home by Product Name

how to sort New Products at Home by Product Name ? because I see to put it through CMS page in the Admin: Admin - CMS Pages - home - Content : {{widget type="catalog/product_widget_new" ...