Count Totals of Different Repeater Line Items

By: Michael Clark | Asked: 03/14/2024
ForumsCategory: How-toCount Totals of Different Repeater Line Items
Michael ClarkMichael Clark asked 8 months ago
I have a repeater that has three items per row: Size, Shape, Count. How can I show totals based on Size and Shape? I'd like to show How many total Big Squares there are, how many total Little Circles there are, etc.
2 Answers
Best Answer
Michael ClarkMichael Clark answered 8 months ago
A field in the repeater row is a checkbox with different values. Except some values are the same. This causes issues. For instance Small and Medium share a value while Large and Larger share a different value. Internal form calculations work just fine, but since the only differentiator is the label and not the actual value, frm-stats and frm-math calcs are off. Oops. T_T 
Rob LeVineRob LeVine answered 8 months ago
You could do it with jQuery. You could set up the fields in the form and then fill them in using jQuery to count. There might be an easier out-of-the-box solution, but I don't know what that is.
Michael ClarkMichael Clark replied 8 months ago

<p>Thanks, Rob. I think I might do separate views with filtering. See if doing a simple frm-stats on the results might work. Building a simple dashboard, and the HUD just needs counts of size and type. Never imagined it'd be this difficult. I must be complicating it in my mind.</p>

Michael ClarkMichael Clark replied 8 months ago

A field in the repeater row is a checkbox with different values. Except some values are the same. This causes issues. For instance Small and Medium share a value while Large and Larger share a different value. Internal form calculations work just fine, but since the only differentiator is the label and not the actual value, frm-stats and frm-math calcs are off. Oops. T_T

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right