Skip to content

Commit b592f7d

Browse files
authored
gwaft-template-collapsible.php: Added Order Summary as an additional last page.
1 parent 6cc0ab7 commit b592f7d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

gravity-forms/gwaft-template-collapsible.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,18 @@
2525
$pages = $data['form']['pagination']['pages'];
2626
$page_groups = array();
2727
foreach ( $data['items'] as $item ) {
28-
$field = $item['field'];
28+
$field = rgar( $item, 'field' );
29+
30+
// Add Order Summary as a separate last page.
31+
if ( ! $field && rgar( $item, 'label' ) == apply_filters( 'gwaft_order_summary_label', 'Order Summary' ) ) {
32+
// Storing order summary page as '-1' to be the last page, and avoid conflicts with the actual page numbers.
33+
$page_groups[-1][] = $item;
34+
$pages[-1] = apply_filters( 'gwaft_order_summary_label', 'Order Summary' );
35+
continue;
36+
}
37+
2938
// Skip hidden fields.
30-
if ( $field->type === 'hidden' || $field->visibility === 'hidden' ) {
39+
if ( ! $field || $field->type === 'hidden' || $field->visibility === 'hidden' ) {
3140
continue;
3241
}
3342
// Adjust pageNumber to be zero-based.

0 commit comments

Comments
 (0)