Upcoming ACF Pro Repeater Field and Calculated Fields for ACF
-
A friendly warning to all:
ACF Pro 6.0 is getting developed and v6.0 beta is ready for testing. One of the new features is the ability for the Repeater fields to have pagination.
Read all about it here: https://www.advancedcustomfields.com/blog/acf-pro-6-0-beta-1/
After testing, I concluded that by using the Repeater pagination, some of the calculated fields are not tallied correctly…
Let me specify with this hypothetical example:
Let’s say we have a Repeater field for invoices. The subfields include quantity, amount, and line total fields. Also the repeater field is set to have pagination.
We also have a second field outside of the Repeater field Total which will tally the total for the line total subfield from the Repeater field.
At this point we will get these 3 scenarios:
1. Inside the Repeater field, the line total subfield will always be calculated correctly (qty * amount).
2. The total field which sums up the line totals will be calculated correctly as long as you don’t exceed the pagination value. Therefore by default, the pagination is set at 20 records per page, and as long us your repeater field has 20 or less rows, you will be fine… of course the pagination value of 20 rows can be changed to anything you want.
3. If your Repeater field uses pagination, and you have many rows that the pagination kicks in, the total field which sums up the line totals from the repeater field will not be accurate.Bottom line: Do not use the new pagination in the upcoming Repeater field if you need to do certain calculations with the data, such as using the Sum, Average, Count, Min, Max functions.
- The topic ‘Upcoming ACF Pro Repeater Field and Calculated Fields for ACF’ is closed to new replies.