• Resolved jesi707

    (@jesi707)


    Hi,
    I am creating a website for a printing shop. They want a form to calculate prices for printing products e.g. project work or master thesis.
    The link to the page shows an form made with forminator but without calculations. But the form is the basic for the calculation I descripe in the following.

    The price of the different products depends e.g. on number of pages, type of paper and more.
    So e.g. if its a master thesis (drop-down-field) with normal paper cost for
    until 100 pages 0,1$ each page
    until 200 pages 0,08$ each page
    up to 200 pages 0,05$ each page
    (page is a input field of numbers)

    So e.g. if its a master thesis with special paper cost for
    until 100 pages 0,2$ each page
    until 200 pages 0,15$ each page
    up to 200 pages 0,10$ each page

    So e.g. if its a project work normal paper cost for
    until 100 pages 0,12$ each page
    until 200 pages 0,09$ each page
    up to 200 pages 0,07$ each page

    So what I want to show: the price depends on different options. To Calculate this I will need If/else-instructions.

    e.g.
    If (drop-down-field == “master thesis”) {
    if (page-number <= 100){
    page-number * 0,1
    }
    if (page-number <= 200){
    page-number * 0,08
    }
    if (page-number > 200){
    page-number * 0,05
    }
    }
    else if(drop-down-field == “project work”{…}

    Is if/else possible with the calculator and how is the Syntax?

    Kind regards,

    J.Fetzer

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jesi707

    (@jesi707)

    BTW: I already read the documentary and there I found nothing about if/else in the calculator.

    Plugin Support Adam – WPMU DEV Support

    (@wpmudev-support8)

    Hi @jesi707

    I hope you’re well today and thank you for your question!

    You’re right, there’s no “if/else” calculations yet.

    If this is just a few “combinations” of possible options it might be possible to achieve it with conditionally visible fields where e.g. you set an additional field for “per page” price that’s set to be visible conditionally depending on values of the work type and paper type fields and then used in calculation. But with a huge number of options it might quickly get very complex, I’m afraid, and I’m not sure if it would work well in this case.

    We do, however have plans for such “if this than that” type of conditional logic that would also cover cases exactly like this one. I don’t have an ETA currently but it’s planned to be implemented in future.

    Kind regards,
    Adam

    Thread Starter jesi707

    (@jesi707)

    Okay, thank you for your fast reply

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Calculation with if/else Syntax?’ is closed to new replies.