WP Cost Estimation Calculations

Hi,

I trying to create a calculation that can reduce the price when the quantity increases.

For example for a quantity of up to 500 I might charge £5.00 per unit. Then for anything up to 1000 I would charge £4.00 then it would reduce again at 1500.

This issue just now is that I can apply a discount but it changes all of the pricing. I need the price for the first 500 to stay the same and just to be added to the next 500 an so on as follows,

0 to 499 would cost £5.00 per unit
500 to 999 would cost £4.00 per unit
1000 to 1499 would cost £3.00 per unit
2000+ £2.00 per unit
etc

so for 999 users it would cost £4,495.00

Addition to above I have added this code but only seems to look at the first statement and perform the calculation on that and nothing else.

if(([item-261_quantity] >0 && <=499)){
([item-261_price])*5

}else if (([item-261_quantity] >499 && <=999)){
([item-261_price])*4{

}else if (([item-261_quantity] >1000 && <=1500)){
([item-261_price])*3

}else if (([item-261_quantity] >1500 && <=1999)){
([item-261_price])*2

}else {
([item-261_price])*1
}
}

Can you help?

Thanks,

Hi Shane,

Thank you for writing in, please turn off the Use Calculation on price and have your price at 5.



Then at the bottom on that same dashboard, find the Apply reductions on quantities option and used that method instead.



Hope it helps,
Cheers!

Thanks for the response.

I have tried this but it does not resolve the problem. I am not looking to apply a discount to the entire quantity just anything above the next level. So for the first 500 it would be £5 per unit then for the next 500 it would be £4 per unit but the first 500 would still be charged at £5 not £4.

Hopefully that helps provide some clarity.

Thanks,
Shane,

Hi Shane,

There is a syntax error in your conditions, please change them to:

if( ([item-261_quantity] > 0 && [item-261_quantity] <= 499) ){

	([item-261_price])*5

} else if( ([item-261_quantity] >499 && [item-261_quantity] <= 999) ){

	([item-261_price])*4

} else if( ([item-261_quantity] >1000 && [item-261_quantity] <= 1500) ){

	([item-261_price])*3

} else if( ([item-261_quantity] >1500 && [item-261_quantity] <= 1999) ){

	([item-261_price])*2

} else {

	([item-261_price])*1

}

If it still doesn’t help, please share us with your admin account so we can take a closer look.

Thanks.

Thank you for the reply, appreciate you taking the time.

Unfortunately looks like its the same issue I had, I have tried various updates on the code but never gets past the first IF and calculates based on that, seems to only reference the first IF. I think maybe some additions are required but even from this level I would at least think it would at least move onto the next IF.

Hi Shane,

Thank you for the credentials, but your formula above will have the same result as the Apply reductions on quantities I suggested, so no that won’t achieve what you need.

Regretfully, this is something that the E&P Form Builder cant calculate (as far as I know), I tried but the price can’t have 2 or multiple values simultaneously. It can only calculate the conditional price which is one at a time price.

For example, a 501 quantity so there should be a deduction on your quantity first to determine the first 500 quantity (that was not in your calculation above), but that is not the main issue, its the price for the exceeded quantity (£4), how will you calculate that and add that to the price of first 500 quantity (£5), and the first 1000 quantity and so on.

If it is in fact, possible with E&P Form Builder to calculate this you might need to seek advice to someone that is Knowledgeable with E&P Form Builder and do the right formula.

Thank you for understanding,

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.