<![CDATA[ GetResources filter by price band - My Forums]]> https://forums.modx.com/thread/?thread=103739 <![CDATA[GetResources filter by price band]]> https://forums.modx.com/thread/103739/getresources-filter-by-price-band#dis-post-558017
Each resource or product has a template variable with a price entered.

I'm looking for a way to filter these in a very simple way so that getResources shows all resources within a container that are priced under £100, between £100 - £200 and then a third option for over £200.

Could anyone help me set up those 3 options ( I realise I may need 3 getResources calls, 1 for each or something like that ) and then it could use the filtering on the tvs to display the results.

I hope this is possible and reasonably straightforward. Thanks for any feedback or guidance on this! smiley]]>
jonahnaylor Apr 15, 2018, 09:14 AM https://forums.modx.com/thread/103739/getresources-filter-by-price-band#dis-post-558017
<![CDATA[Re: GetResources filter by price band]]> https://forums.modx.com/thread/103739/getresources-filter-by-price-band#dis-post-558018
Could you please try something like that (let's say your TV name is Price):

[[getResources?
...
&tvPrefix=``
&sortbyTV=`Price`
&sortdirTV=`DESC`
&limit=`1000`
&sortbyTVType=`integer` // if Price is integer, othervise decimal will be helpful
&tvFilters=`Price<<100`
&includeTVs=`Price`
...
]]


[[getResources?
...
&tvPrefix=``
&sortbyTV=`Price`
&sortdirTV=`DESC`
&limit=`1000`
&sortbyTVType=`integer` // if Price is integer, othervise decimal will be helpful
&tvFilters=`Price>=100,Price<=200`
&includeTVs=`Price`
...
]]


[[getResources?
...
&tvPrefix=``
&sortbyTV=`Price`
&sortdirTV=`DESC`
&limit=`1000`
&sortbyTVType=`integer` // if Price is integer, othervise decimal will be helpful
&tvFilters=`Price>>200`
&includeTVs=`Price`
...
]]

]]>
himurovi4 Apr 15, 2018, 02:12 PM https://forums.modx.com/thread/103739/getresources-filter-by-price-band#dis-post-558018