Edit File by line
/home/zeestwma/ceyloniy.../wp-conte.../plugins/wpforms-.../template.../fields/total
File: summary-preview.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* The Order Summary preview for the Total payment field.
[2] Fix | Delete
*
[3] Fix | Delete
* @since 1.8.7
[4] Fix | Delete
*
[5] Fix | Delete
* @var array $items Order items.
[6] Fix | Delete
* @var array $foot Order footer (subtotal, discount, total).
[7] Fix | Delete
* @var string $total_width Total width.
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[11] Fix | Delete
exit;
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
$rows_html = '';
[15] Fix | Delete
$total_width = $total_width ? 'width:' . $total_width . 'ch;' : '';
[16] Fix | Delete
$fields = array_merge( (array) $items, (array) $foot );
[17] Fix | Delete
[18] Fix | Delete
// Display the placeholder by default.
[19] Fix | Delete
$is_placeholder_visible = true;
[20] Fix | Delete
[21] Fix | Delete
// $context is set for the smart tag.
[22] Fix | Delete
if ( isset( $context ) ) {
[23] Fix | Delete
$is_placeholder_visible = empty( $items );
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
// Go through table items (rows).
[27] Fix | Delete
foreach ( $fields as $field ) :
[28] Fix | Delete
[29] Fix | Delete
// Open a row.
[30] Fix | Delete
$rows_html .= sprintf(
[31] Fix | Delete
'<tr %1$s %2$s>',
[32] Fix | Delete
wpforms_html_attributes( '', isset( $field['class'] ) ? (array) $field['class'] : [] , $field['data'] ?? [] ),
[33] Fix | Delete
! empty( $field['is_hidden'] ) ? 'style="display:none;"' : ''
[34] Fix | Delete
);
[35] Fix | Delete
[36] Fix | Delete
// Item column.
[37] Fix | Delete
$rows_html .= sprintf(
[38] Fix | Delete
'<td class="wpforms-order-summary-item-label" valign="top">%s</td>',
[39] Fix | Delete
wp_kses_post( $field['label'] )
[40] Fix | Delete
);
[41] Fix | Delete
[42] Fix | Delete
// Quantity column.
[43] Fix | Delete
$rows_html .= sprintf(
[44] Fix | Delete
'<td class="wpforms-order-summary-item-quantity" valign="top">%s</td>',
[45] Fix | Delete
esc_html( $field['quantity'] )
[46] Fix | Delete
);
[47] Fix | Delete
[48] Fix | Delete
// Price column.
[49] Fix | Delete
$rows_html .= sprintf(
[50] Fix | Delete
'<td class="wpforms-order-summary-item-price" valign="top" style="%1$s">%2$s</td>',
[51] Fix | Delete
esc_attr( $total_width ),
[52] Fix | Delete
esc_html( $field['amount'] )
[53] Fix | Delete
);
[54] Fix | Delete
[55] Fix | Delete
// Close a row.
[56] Fix | Delete
$rows_html .= '</tr>';
[57] Fix | Delete
[58] Fix | Delete
endforeach;
[59] Fix | Delete
[60] Fix | Delete
$visible_items = array_filter(
[61] Fix | Delete
$items,
[62] Fix | Delete
function ( $item ) {
[63] Fix | Delete
return ! isset( $item['is_hidden'] ) || $item['is_hidden'] === false;
[64] Fix | Delete
}
[65] Fix | Delete
);
[66] Fix | Delete
[67] Fix | Delete
$is_placeholder_visible = empty( $visible_items );
[68] Fix | Delete
[69] Fix | Delete
$placeholder_display = $is_placeholder_visible ? 'display: table-row;' : 'display: none;';
[70] Fix | Delete
$placeholder_classes = $is_placeholder_visible ? 'wpforms-order-summary-placeholder' : 'wpforms-order-summary-placeholder wpforms-order-summary-placeholder-hidden';
[71] Fix | Delete
[72] Fix | Delete
?>
[73] Fix | Delete
<div class="wpforms-order-summary-container">
[74] Fix | Delete
<table class="wpforms-order-summary-preview" cellpadding="0" cellspacing="0" width="100%" role="presentation">
[75] Fix | Delete
<caption style="display: none;"><?php esc_html_e( 'Order Summary', 'wpforms-lite' ); ?></caption>
[76] Fix | Delete
<thead>
[77] Fix | Delete
<tr>
[78] Fix | Delete
<th class="wpforms-order-summary-item-label" valign="top"><?php esc_html_e( 'Item', 'wpforms-lite' ); ?></th>
[79] Fix | Delete
<th class="wpforms-order-summary-item-quantity" valign="top">
[80] Fix | Delete
<span class="wpforms-order-summary-item-quantity-label-full"><?php esc_html_e( 'Quantity', 'wpforms-lite' ); ?></span>
[81] Fix | Delete
<span class="wpforms-order-summary-item-quantity-label-short"><?php esc_html_e( 'Qty', 'wpforms-lite' ); ?></span>
[82] Fix | Delete
</th>
[83] Fix | Delete
<th class="wpforms-order-summary-item-price" valign="top" style="<?php echo esc_attr( $total_width ); ?>"><?php esc_html_e( 'Total', 'wpforms-lite' ); ?></th>
[84] Fix | Delete
</tr>
[85] Fix | Delete
</thead>
[86] Fix | Delete
<tbody>
[87] Fix | Delete
<tr class="<?php echo esc_attr( $placeholder_classes ); ?>" style="<?php echo esc_attr( $placeholder_display ); ?>">
[88] Fix | Delete
<td colspan="3" valign="top"><?php echo esc_html__( 'There are no products selected.', 'wpforms-lite' ); ?></td>
[89] Fix | Delete
</tr>
[90] Fix | Delete
<?php echo $rows_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
[91] Fix | Delete
</tbody>
[92] Fix | Delete
</table>
[93] Fix | Delete
</div>
[94] Fix | Delete
[95] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function