• Resolved phicarre

    (@phicarre)


    Hi,

    I’m using Forminator on WordPress with a repeater field. Each row has 4 number fields:

    • {number-3} Bottle 33 cl – €2.50
    • {number-4} Bottle 75 cl – €5
    • {number-5} Case 33 cl – €27
    • {number-6} Case 75 cl – €30

    I tried a global calculation:

    {number-3}*2.5 + {number-4}*5 + {number-5}*27 + {number-6}*30

    Problem: Only the first row is counted. Extra rows added with the repeater are ignored.

    I want a total that includes all rows and updates automatically when rows are added or removed.

    Is there a way to do this in Forminator ?

    Thx

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Jair – WPMU DEV Support

    (@wpmudevsupport15)

    Hello @phicarre

    If you are trying to make some kind of quotation form, usually, for the Field Group field, you require these fields:

    • A Select or Radio field where the visitor can select a product. Such field should be configured to use Calculations, where each option has a value equal to its cost.
    • A Number field where the visitor can specify the number of products.
    • A Calculations field that multiplies the cost of the product with the number of products.

    Then, outside of the Field Group, you have another Calculations field, in which case you will simply use the field selector to pick the name of the Calculation field that is used inside the Field Group. This will make the Calculation field to return the sum of all the values that are being repeated in the Field Group, it doesn’t matter how many Field Groups are repeated.

    If you still have doubt about how to do this, feel free to export your form and share it so we can check how your form is made.

    Kind regards,
    Jair.

    to @phicarre,

    To my understanding, in the calculation, you need to add an asterisk (*) to each field in the repeating group :

    {number-1-*}*2.5+{number-2-*}*5+{number-3-*}*27+{number-4-*}*30

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @jpgoem

    You are correct, if you want to calculate all the numbers then number-2-* but if you calculate each item of a group would be only number-2

    More information at
    https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#field-group-repeaters-calculations

    Best Regards
    Patrick Freitas

    Thread Starter phicarre

    (@phicarre)

    Hi,

    This was the good option :

    {number-3-*} * 2.5 + {number-4-*} * 5 + {number-5-*} * 27 + {number-6-*} * 30

    Thanks you for your help.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Total calculation for repeater rows’ is closed to new replies.