Support

Account

Home Forums Add-ons Repeater Field "Add" repeater field results

Helping

"Add" repeater field results

  • Guys, does anyone have any idea how to “add” results of a Repeater?

    Example: I have a repeater field with name “Values” within it have the field “price”, as do inside the loop to sum “price + price + price”, as many times as necessary?

    Image exemple: https://uploaddeimagens.com.br/imagens/subfields-jpg

  • do you talk about backend or frontend?

    i think something like this should work(for frontend):
    outside(before) the values loop define variable
    $total = '0';
    inside the values loop
    $price = get_sub_field('price'); $total = $total + $price;
    outside(after) the values loop
    echo $total;

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘"Add" repeater field results’ is closed to new replies.