Developer forum

Forum » Development » Sort product catalog, by Custom product field AND Price

Sort product catalog, by Custom product field AND Price

Dmitrij Jazel
Reply

Hi Guys,

In product catalog we have this setting here, for defining how catalog should be sorted.

http://screencast.com/t/RcBfbAuqP

 

We creted a custom product field called Web-sort (sort value 1-2-3-4... from ERP system that will mainly be used for sorting on webpage).

If for some reason, all products have the same Web-sort value - than those products should be sorted by Price.

 

Question:

How should we approach this problem, because you cannot define 2 sort parameters at the same time (1 primary and 1 fallback) can't you?

Would love to hear some suggestions, and ideas.

 

/Dmitrij


Replies

 
Nicolai Høeg Pedersen
Reply

No, you can only do that using the new index.

 
Dmitrij Jazel
Reply

Hi Nicolai :)

Wel to our luck, that is exactly what we are using.

Just wanted to hear some tips on how to do that?

You mean this should be a part of how we set-up our Query?

 

Still would love to hear some suggestions.

 

/Dmitrij

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

You can set it up on the query it self. See dump.

On the module settings on the paragraph you can override the settings if you are using the same query in multiple places.

BR Nicolai

Capture.PNG
Votes for this answer: 1
 
Dmitrij Jazel
Reply

Hi Nicolai,

I was so sure that this was all, hat I makred your post as answer.

But what I can see - is that this does not really works right now. And not sure why.

1) I added the sorting in the query. http://screencast.com/t/47i0qXbVC

2) Made sure index was built, and that the field was indexed. And made sure I am using correct query.

3) Added sort in the product catalog module. http://screencast.com/t/XXyyzj9E

Weird thing I found, I have to do it in 2 places?

But lastly, this does not seem to work :/ and not sure why.

Something I am missing?

 

/Dmitrij

 
Nicolai Høeg Pedersen
Reply

You do not have to it in 2 places. Set the default in the query under repositories, and overwrite them on the paragraph instance if needed.

But if you post "it is not working" you have to tell and show what you have an what you expect, and define why that is wrong.... Gimme information!

 

You must be logged in to post in the forum