Hi,
I am not sure if this is the best solution. An if statement would shorten it a bit and if you put it in a script object, then you would call if from different fields (and only have to maintain it in one location).
if (Quantity.rawValue == 1) {
Price.rawValue = 10;
} else if (Quantity.rawValue >= 2 && Quantity.rawValue <= 4) {
Price.rawValue = 9;
} else if (Quantity.rawValue >= 5 && Quantity.rawValue <= 8) {
Price.rawValue = 7;
} else if (Quantity.rawValue >= 8 && Quantity.rawValue <= 10) {
Price.rawValue = 6;
} else {
Price.rawValue = 5;
}
If you have several products with different prices, then you could have function() for each product. Alternatively instead of setting the price against the quantity, you could set a discount against the quantity and then apply this discount across the quantity for each product.
I hope that helps,
N.