Estimation & Payements Forms Calculations

Hi,

I am using E&P Form Builder for the first time and would appreciate some help in getting a formula for a price calculation. The calculation should be simple, but I am not familiar with how to do it.

I have a quantity field, which will deal with the calculation. If the quantity is 1 - 5 (inclusive) the price will be £20. For every extra quantity the price increases by £5. So, quantity 6 = £25; quantity 7 = £30; quantity 8 = £35 and so on.

I have tried using this formula:

if([step-61_quantity] <5) { [price] = 20 }
if([step-61_quantity] =6) { [price] = 25 }
if([step-61_quantity] =7) { [price] = 30 }

I would be grateful for any help you can give in creating this formula.

Thanks,
Christopher

Hi Christopher,

Thanks for reaching out.
It is not very clear where did you use these conditions? I would suggest you go through the theme and official documentation in the following link.


Hope it helps.
Thanks

Hi @tristup,

The code is being used in the E&P step builder on the quantity field’s Price & Quantity tab. I have looked at all the documentation and still cannot get the formula correct. The formula in the screenshot should be giving the results like:

If the selected quantity is less than or equal to 5, then the price will be £20, otherwise for every quantity which equals 6 or more, the price will be the quantity multiplies by the variable (=5) minus 5. Therefore quantity 6 = (6*5) -5 => 25 total.

Thanks,
Christopher

I have made a little progress with the formula, but am getting strange results.

if ([step-61_quantity] > 5) {
[price] = ([step-61_quantity] * 5) - 5
} else {
[price] = 20
}

What I expect from this formula is the following: if the step quantity is 6, the price result should be £25 - it comes out at £120.

Secondly, for any quantities between 2 and 5, the calculator uses the £20 from the else statement and multiplies it by the quantity. The intention is that any quantity between 1 and 5 should equal a total of £20.

Thanks,
Christopher

I noticed the plugin was changed on that server. Did you go a different route using that other plugin there? Curious your thoughts on that other one I saw. I couldn’t see anything outright wrong with your code, i’d maybe check the step-id is right.

Hi Charlie,

Good to hear from you again. The step-id was definitely correct, but the code simply wouldn’t work. We ended up going down a different route as the client didn’t like the look of E&P’s summary grid. We ended up using Cost Calculator Pro (https://stylemixthemes.com/cost-calculator-plugin/ - get it bundled with Pro? :sunglasses:).

Bizarrely, the code which would not work with E&P worked instantly with Cost Calculator Pro, which has proven to be a brilliant estimating / calculation tool, which is really user friendly (much more so than E&P), yet has powerful features. It may be worth you having a go with its live and back-end demos on the link above. It would definitely be a great extension for Pro.

Thanks again,
Christopher

Hello Christopher,

Thanks for letting us know that you have gone a different route and now your issue has been resolved.

Cheers.

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