the promote rule:

if buy one each price is $100, if buy >= 2 each price is $90. if buy >=5 each price is $80. if buy >=8 each price is 70.........

the json data is dynamic, namely which elements is 1 or 2 or 3 or another: so you don't know what the value of the price_qty will be.

supporsed there is a variable named result, which has the quantity of the product that the visitor will buy.

var result.

now, i want to do: compare the result with the json data (price_qty), then output the whole price. eg: if(result >2) { write the qty is +result, the price is + price.}. how to write the code?

once i used :

var myObject= the json data,
jQuery.each(myObject, function(_index, _item){ 
var objectInArray = _item; 
if(objectInArray.price_qty  result)
then i don't know how to do the left.