Home › Forums › Add-ons › Repeater Field › Add field values based on true/false selector › Reply To: Add field values based on true/false selector
this is just a general idea, I can’t give a specific example because information about the fields your using is incomplete.
$total_footage = 0;
if (have_rows('repeater')) {
while (have_rows('repeater')) {
the_row();
if (get_sub_field('available')) {
$total_footage += get_sub_field('square_footage');
}
}
}
echo $total_footage;
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.