| Server IP : 213.136.93.164 / Your IP : 216.73.216.188 Web Server : Apache System : Linux m14200.contabo.net 5.14.0-611.54.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed May 6 18:03:03 EDT 2026 x86_64 User : ki692510 ( 1047) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/ki692510/www/wp-content/plugins/wpforms-lite/templates/fields/total/ |
Upload File : |
<?php
/**
* The Order Summary preview for the Total payment field.
*
* @since 1.8.7
*
* @var array $items Order items.
* @var array $foot Order footer (subtotal, discount, total).
* @var string $total_width Total width.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$rows_html = '';
$total_width = $total_width ? 'width:' . $total_width . 'ch;' : '';
$fields = array_merge( (array) $items, (array) $foot );
// Display the placeholder by default.
$is_placeholder_visible = true;
// $context is set for the smart tag.
if ( isset( $context ) ) {
$is_placeholder_visible = empty( $items );
}
// Go through table items (rows).
foreach ( $fields as $field ) :
// Open a row.
$rows_html .= sprintf(
'<tr %1$s %2$s>',
wpforms_html_attributes( '', isset( $field['class'] ) ? (array) $field['class'] : [] , $field['data'] ?? [] ),
! empty( $field['is_hidden'] ) ? 'style="display:none;"' : ''
);
// Item column.
$rows_html .= sprintf(
'<td class="wpforms-order-summary-item-label">%s</td>',
esc_html( $field['label'] )
);
// Quantity column.
$rows_html .= sprintf(
'<td class="wpforms-order-summary-item-quantity">%s</td>',
esc_html( $field['quantity'] )
);
// Price column.
$rows_html .= sprintf(
'<td class="wpforms-order-summary-item-price" style="%1$s">%2$s</td>',
esc_attr( $total_width ),
esc_html( $field['amount'] )
);
// Close a row.
$rows_html .= '</tr>';
// If a product item is not hidden (pre-selected), then hide the placeholder.
if ( $is_placeholder_visible && isset( $field['is_hidden'] ) && $field['is_hidden'] === false ) {
$is_placeholder_visible = false;
}
endforeach;
$placeholder_display = $is_placeholder_visible ? 'display: table-row;' : 'display: none;';
$placeholder_classes = $is_placeholder_visible ? 'wpforms-order-summary-placeholder' : 'wpforms-order-summary-placeholder wpforms-order-summary-placeholder-hidden';
?>
<div class="wpforms-order-summary-container">
<table class="wpforms-order-summary-preview" role="table">
<caption style="display: none;"><?php esc_html_e( 'Order Summary', 'wpforms-lite' ); ?></caption>
<thead>
<tr>
<th class="wpforms-order-summary-item-label" scope="col"><?php esc_html_e( 'Item', 'wpforms-lite' ); ?></th>
<th class="wpforms-order-summary-item-quantity" scope="col"><?php esc_html_e( 'Quantity', 'wpforms-lite' ); ?></th>
<th class="wpforms-order-summary-item-price" scope="col" style="<?php echo esc_attr( $total_width ); ?>"><?php esc_html_e( 'Total', 'wpforms-lite' ); ?></th>
</tr>
</thead>
<tbody>
<tr class="<?php echo esc_attr( $placeholder_classes ); ?>" style="<?php echo esc_attr( $placeholder_display ); ?>">
<td colspan="3"><?php echo esc_html__( 'There are no products selected.', 'wpforms-lite' ); ?></td>
</tr>
<?php echo $rows_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</tbody>
</table>
</div>