Questions tagged [sorting]

Denotes questions related to sorting collections in Magento.

Filter by
Sorted by
Tagged with
0
votes
1answer
641 views

Sorting Cross-Sell Products in Magento 2.1

If I retrieve the cross-sell products for a particular product: $_product->getCrossSellProductCollection(); How do I sort those products in the same order as the administrator has defined via the ...
0
votes
1answer
399 views

Magento 2 : Sorting Customer Attributes Option Array

I used these posts: http://www.extensions.sashas.org/blog/magento-2-1-3-how-to-make-customer-attribute-update.html Adding customer multiselect attribute For creating a custom customer attribute ...
0
votes
1answer
44 views

Stop Product 'Sort By' Manual Selections from Becoming Global?

If you are shopping our site and you change the product listing 'Sort By' selection from 'New' (or whatever it may be) to 'Price' manually on the front-end 'Price' will then become the new global '...
1
vote
0answers
92 views

Product sorting error for arrow(asc & desc)

In Magento, The product sorting by name, price..and by arrow is also not working. I tried many solutions and worked, but the problem is not fixed. Can anyone do this favour to me by helping this ? ...
0
votes
3answers
1k views

addAttributeToSort() not working

I have configurable product create with attribute size, I try to list this attribute size in the product description, but addAttributeToSort() not working. My code is: if($_product->getTypeId() == ...
2
votes
1answer
2k views

Before/After is not working in catalog_category_view_type_layered.xml inside sidebar.main?

I am trying to add a string at the top of the product details page navigation referenceContainer name="sidebar.main" but the string is coming after product Filters. How can i change or move my block ...
3
votes
1answer
152 views

Sort categories in layered navigation alphabitically

We are trying to sort the categories in the layered navigation alphabetically but it is not getting sort. Tried the following modifications directly in core file at line number 122 for testing ...
7
votes
0answers
1k views

Magento 2 - sorting order of products in a widget block

I created a block and a widget in admin panel to show products that fit some criteria(in a specified category) on home page. When I finished the setting, I found that the sorting order of the ...
2
votes
2answers
943 views

Magento 2 - setDefaultOrder on Catalog pages

I've added this to category_category_view.xml under Magento_Catalog->layout in my custom theme. It's not working and I can't figure out why. <referenceBlock name="product_list_toolbar"> ...
0
votes
1answer
73 views

Custom sort order using a product attribute, but this attribute isn't available whilst reindexing 'product flat data'

we have created a custom category sort order which uses a new product attribute with numerical value. This works great generally, but we are getting front end errors during any time when the Flat ...
2
votes
2answers
1k views

Sorting a custom column - Customer Grid

I have added in order count and last order date to the customer grid which is working fine, however it is not sortable or filterable in the grid. I have done some searching but can't seem to find a ...
4
votes
3answers
8k views

How to add custom sort by option filter in tool bar in magento2

I want to custom sort by option filter attribute add in tool bar section. Currently Magento 2 provide Position , Product Name , Price And Sorting option to low to high. But i need to change all ...
4
votes
1answer
678 views

How to load my javascript file before other javascript file from addJs

I am facing some javascript issues by loading order of custom module Javascript files, so i want to change the loading order of my Javascript files located at magento root root/js/. But the ...
2
votes
1answer
159 views

Filtering sort by price

I'm using magento 1.9.3.1 and I'm wondering how I can conditionally remove items when they are sorted by price on a category page. I have items that contain specific attributes, that when sorted by ...
1
vote
0answers
26 views

Configurable products being sorted after simple products on category pages

Is there any reason why a category page will sort all simple products a-z then start again with configurable?
0
votes
1answer
161 views

Which Attribute Type for layered nav and filterable numeric value

I would like to put an Attribute called "Volume" to my Magento Online Shop. Products should be sorted by this attribute and it should be filterable through the layered navigation. since text ...
0
votes
1answer
217 views

Magento set product list order by attribute values

I am trying to provide the custom attribute in sort-by, when am trying to fetching the products list order by custom attribute those are not in Ascending order. if ($attribute == 'paidship') { ...
1
vote
1answer
2k views

Magento sort collection with multiple attributes

I want to sort Magento product collection with multiple attributes at catalog product list page. I am using this code $this->_collection->setOrder('price', 'desc'); $this->_collection->...
1
vote
1answer
33 views

Magento SortBy options not available in other category

I am facing issue with sort-by option.I have two categories in that one of category(Products list page) should not display some attributes in sort-by option. Like this: In First category: Array ( [...
0
votes
1answer
950 views

List newest products on top, when sorting by attribute

I'm sorting my products by an attribute which tells if the products are "regular catalog products" or "order selection". In this way all the regular displays first, then all the ones from the order ...
1
vote
2answers
729 views

Custom Grid sorting function

Do we have any choice of calling a callback function for sorting? Just like filter_condition_callback As 'sort_callback' => array($this, 'sortingfun'),
0
votes
1answer
380 views

Problem : Attribute int type vs varchar for product sorting showing no diffrence

I have created Custom attribute for product sorting in magento 2.1.1. by Setup>installData.php `namespace Vendor\Module\Setup; use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product\...
0
votes
0answers
250 views

Sorting custom column renderer

I have this column i added. How can i sort it? i can click on sort, but well it doesnt really sort right. My grid looks like: $this->addColumn('sn_suppliers_noos', array( 'header' =&...
0
votes
1answer
768 views

Magento error ERR_TOO_MANY_REDIRECTS, when sorting products

Some days ago I noticed a redirect loop on a Magento 1.9.2.4 installation I'm working on. The issue is visible when ordering products in the front end, I can't say when it started. You can take a ...
1
vote
1answer
110 views

Popularity sorting doesnt work

I recently installed FME layered navigation. Now my toolbar sorting doesn't work right. When it loads, everything is correct. It sorts by the standard "most viewed", but when i change sorting to ...
2
votes
3answers
440 views

Unable to sort Customer address collection

I have an attribute in eav_attribute "group_id" for customer/address, I am trying to sort my collection by this attribute.What I am doing is. $customer = Mage::getSingleton('customer/session')->...
2
votes
2answers
61 views

Sort product by category

I use this code for get products : public function getProducts() { $product = Mage::getModel("catalog/product") ->getCollection() ->...
1
vote
1answer
672 views

wrong order when sorting by price in admin product grid

This is screen from my admin products grid, here I sorting by price column(low to high), but as you can see it's not working right. Can it be because some products are "downloadable" ?
2
votes
1answer
550 views

Sort Order of Image gallery is not working for Magento 1.9

I'm using Magento 1.9.2.4 and there is feature for product using which one can sort images for gallery, but for me it is not working, actually the changes of sorting order are not saved. Any other ...
1
vote
0answers
206 views

Magento 2: How to sort products by price then by name?

The reason I'm asking this is that all my products have configuration and I have to display only simple products (configurable products not visible). However when I sort by price, the products belongs ...
1
vote
1answer
660 views

How to add product updated date as sort order using custom extension

I want to add product updated date as sort order but I don't want to add Updated date field in product setting page which means if admin updates a product, it's edited date should be detected ...
0
votes
0answers
588 views

Magento 2 - SortOrder class not found

I have created a repository to retrieve records from database. I need to sort the records using a specific column. I tried to use the SortOrderBuilder but it returns Fatal error: Class 'Qooar\...
0
votes
1answer
45 views

Sorting Search Results by attribute that is not available (isn't listed in dropdown)

Just like my topic says: Is it possible to set default sorting order (eg. by setDefaultOrder() function) to attribute that is not available - isn't listed in "sort by" dropdown list? What I want to ...
3
votes
1answer
4k views

How to Sort Products Based on Custom Attribute in Magento

I would like to sort front end products in a category based on the custom attribute (say promote). I give value for promote attribute for every product in the website like 1,2,3,4,5..100,101..1000 etc....
2
votes
0answers
690 views

catalog search result default sortBy by multiple attributes at once

I want to sort my catalog search result by multiple attributes. For default sorting by price I have added below code in xml file : ... <catalogsearch_result_index> <reference name="...
1
vote
0answers
294 views

Proper way to implement grid filtering and sorting on a custom column

I have a custom grid with products. It shows price and special_pirce. Now I want to add another colum which is discount percentage. I have added the column discount with a custom render. The ...
1
vote
1answer
699 views

Is there a way to change the position of a product for all attributes it belongs to?

So if you sort with best value it uses the products position attribute in the category to decide the position. The lower the higher it appears on the catalog page and search page. We have a custom ...
4
votes
3answers
3k views

Magento sort by price: sort by final price instead of price

Magento sort by price: sort by final price instead of price: I want to sort by price filter to sort by final price of product instead of just price. For product I have price 10 but special price is ...
0
votes
1answer
727 views

Subcategories manually sort order from database

How can i arrange the sort order for subcategories from the database. I noticed that catalog_category_entity table has position column. Can i change the order from there ?
1
vote
0answers
45 views

Attributes assigned globally to advanced search/page sorting/layered navigation on two of my websites. How do I assign them manually?

I've created two websites, but they will be using two different attribute sets. The products are working fine, as they're only using the attribute set assigned to them. The major issue I'm facing is ...
1
vote
1answer
342 views

Magento changing sort order on filtered navigation

I am using a custom theme based on RWD and when I select an element in the layered navigation (or multiple elements) the order of the product listing is changed from asc to desc. Can anyone suggest ...
2
votes
1answer
637 views

Product Sorting in Category Page

When I am landing in a Product Category Page I am getting the sorting order Descending Direction like below. I need this only at "Sort By Name" but not in others. But I would like to have Ascending ...
1
vote
0answers
33 views

Disable Category Page Description Content from showing on Sorted Results

Our category pages the description attribute shows at the top of the page. This section is really helpful for the initial category experience. Problem: When the user sorting in the category, the ...
1
vote
1answer
955 views

Change sorting order to descending

In my website, sorting is in asc for all sorting option but if I select "Sort By Date" (created_at) I want it go sort on desc order. How do I do it? Also I have a theme installed. Below is the code ...
3
votes
1answer
282 views

Natural sort for sortby Name

I want to sort catalog products by name in natural order. In order to achieve it i created a custom module and overwrote Mage_Catalog_Block_Product_List_Toolbar. public function setCollection($...
0
votes
1answer
55 views

Products not correctly sorted according to name [duplicate]

I have 3 products in a category. I need to sort it according to the order listed below **-------Expected order-------** Armani Code For Men 50ml EDT Armani Code For Men 100ml EDT ...
4
votes
3answers
4k views

Category Sorting Product list: How to take off position from attributes?

Magento 1.9.0.1 In the admin panel, you have the ability to sort categories by attributes as seen here: http://inchoo.net/magento/changing-default-category-sort-order-in-magento/ Now I have sorted ...
1
vote
1answer
183 views

How do we keep the products with NULL value at the end of listing

On product listing page if i apply sort by color ,i need the products which have the color value as NULL ,should be displayed at the bottom of the listing page
4
votes
3answers
1k views

"random" order clause added to my collection

For a module I load a custom product collection where I select products based on IDs in an array, I also try and sort the collection by the same order as the IDs have in the array(). To achieve the ...
3
votes
1answer
3k views

Custom Sort order for magento product collection (Sort collection by an array values)

I have product collection as below, Array ( [0] => Array ( [entity_id] => 1995 [type_id] => configurable [sku] => WSH06 [has_options] => 1 ...

1 2 3
4
5
8