Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we add custom sort ordering for product attribute option values ? #450

Closed
vipingarg12 opened this issue Jun 12, 2017 · 12 comments
Closed
Assignees
Labels

Comments

@vipingarg12
Copy link

Hi Support,

We need to add custom sort ordering in results. How we can do that ? Currently sorting working on attribute option id.

Magento version: 2.1.1
Elastic Version: 2.1.1
Elastic Suite Version: 1.2.0

Thanks,
Vipin

@romainruaud
Copy link
Collaborator

Hello @vipingarg12

You just have to set any attribute you want to sort on, as "Used For Sorting in Product Listing".

selection_315

This is standard Magento's behavior and we are actually keeping it functional.

Best regards. I close the issue, do not hesitate to reopen it if you have any other question.

@vipingarg12
Copy link
Author

We need to sort ordering on option values. for example Color is attribute and values are Red, Green, Blue then when we sort it should sort by alphabetically. So Blue, Green, Red results should come.

I hope you understand the problem. Default magento sort gives results based on option id not alphabetically.

@romainruaud
Copy link
Collaborator

Sorry but I do not get it.

What do you want to sort ? The options inside the filter ? Or the products ?

@vipingarg12
Copy link
Author

I wants to sort products collection on category page. Go to below page and sort by color

http://custom.pratikshajewelry.com/diamond.html

@romainruaud
Copy link
Collaborator

Ok I got it.

You are right, when using a select-based attribute for sort, the optionId is used, instead of the option label.

I reopen the issue, we will try to provide a fix for this one.

Regards

@romainruaud romainruaud reopened this Jun 12, 2017
@romainruaud romainruaud added bug and removed question labels Jun 12, 2017
@romainruaud romainruaud self-assigned this Jun 12, 2017
@mautz-et-tong
Copy link

We have the same Problem on Integer Attributes.
We have set up an attribute "alt_position" type integer and the frontend is sorted by value_id not by the value itself.
We use Magento 2.1.7
Smile 2.3.5
Elastic 2.4.5

@afoucret
Copy link
Contributor

afoucret commented Sep 5, 2017

PR have been merged into branch 2.3.x

@andros89cy
Copy link

Hello vipingarg12,

Are you a magento developer?

Thanks

@jeremy-donson
Copy link

** Has this customizable sorting issue been addressed? **
I have great ideas, and want great options! :D
I can fix it solo, but would prefer to have this be a github enhancement for our planet.

@magento360
Copy link

@vipingarg12 did you get any solution for this ? I am also experiencing same issue.

@manishgoswamig
Copy link

@vipingarg12 have you got any solution because we are facing the same issue with custom sorting?

@manishgoswamig
Copy link

manishgoswamig commented Aug 3, 2022

Hello @romainruaud ,

We want to apply the sorting with our custom table column value, but it is not working, do you have any reference so that we can archive it ?

  • We can not use a custom attribute through the optimizer because our custom attribute is a date-type attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants