Hi guys,
I am trying to create a display that sorts nodes by price.
For example, I have a node that has a field called "price" and has value of 100. I want to create a block that presents 3 nodes that are their "price" field is the closest to 100.
Is there any way to do it without using custom module?
BTW this is not commerce site, the "price" field is just simple decimal field.

Thank you !

Comments

Dvir Cohen created an issue. See original summary.

saurabh.dhariwal’s picture

You can do it by using "SORT CRITERIA" in views. Add price field using add option & sort as ASC or DESC order.
For showing only 3 nodes in views go to "PAGER" settings and set "3" from "item to display" field.

Let me know incase of any query/concern regarding the same.

Thanks!

renatog’s picture

Status: Active » Reviewed & tested by the community

Hi @dvir-cohen,

#2 it's ok.

You can use Sort criteria as cited by @saurabh.dhariwal

renatog’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, Saurabh

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.