Skip to content

Commit 98e0bdd

Browse files
committed
revert receipt template change
1 parent f57e68c commit 98e0bdd

File tree

1 file changed

+11
-40
lines changed

1 file changed

+11
-40
lines changed

templates/receipt.php

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -216,64 +216,35 @@
216216
?>
217217
</td>
218218
<td><?php echo esc_html( $item->get_quantity() ); ?></td>
219-
<td><?php
220-
$tax_display = get_option( 'woocommerce_tax_display_cart' );
221-
if ( 'excl' === $tax_display ) {
222-
echo wp_kses_post( wc_price( $item->get_subtotal() / $item->get_quantity() ) );
223-
} else {
224-
echo wp_kses_post( wc_price( $item->get_subtotal_tax() / $item->get_quantity() + $item->get_subtotal() / $item->get_quantity() ) );
225-
}
226-
?></td>
227-
<td><?php
228-
$tax_display = get_option( 'woocommerce_tax_display_cart' );
229-
if ( 'excl' === $tax_display ) {
230-
echo wp_kses_post( wc_price( $item->get_total() ) );
231-
} else {
232-
echo wp_kses_post( wc_price( $item->get_total() + $item->get_total_tax() ) );
233-
}
234-
?></td>
219+
<td><?php echo \is_object( $product ) && method_exists( $product, 'get_price' ) ? wp_kses_post( wc_price( $product->get_price() ) ) : ''; ?></td>
220+
<td><?php echo wp_kses_post( wc_price( $item->get_total() ) ); ?></td>
235221
</tr>
236222
<?php } ?>
237223
</tbody>
238224
<tfoot>
225+
<tr>
226+
<th colspan="3"><?php esc_html_e( 'Subtotal', 'woocommerce' ); ?></th>
227+
<td><?php echo wp_kses_post( wc_price( $order->get_subtotal() ) ); ?></td>
228+
</tr>
239229
<?php if ( $order->get_shipping_total() > 0 ) { ?>
240230
<tr>
241231
<th colspan="3"><?php esc_html_e( 'Shipping', 'woocommerce' ); ?></th>
242-
<td><?php
243-
if ( 'excl' === $tax_display ) {
244-
echo wp_kses_post( wc_price( $order->get_shipping_total() ) );
245-
} else {
246-
echo wp_kses_post( wc_price( $order->get_shipping_total() + $order->get_shipping_tax() ) );
247-
}
248-
?></td>
232+
<td><?php echo wp_kses_post( wc_price( $order->get_shipping_total() ) ); ?></td>
249233
</tr>
250234
<?php } ?>
251235
<?php foreach ( $order->get_fees() as $fee ) { ?>
252236
<tr>
253237
<th colspan="3"><?php echo esc_html( $fee->get_name() ); ?></th>
254-
<td><?php
255-
if ( 'excl' === $tax_display ) {
256-
echo wp_kses_post( wc_price( $fee->get_total() ) );
257-
} else {
258-
echo wp_kses_post( wc_price( $fee->get_total() + $fee->get_total_tax() ) );
259-
}
260-
?></td>
238+
<td><?php echo wp_kses_post( wc_price( $fee->get_total() ) ); ?></td>
261239
</tr>
262240
<?php } ?>
263241
<?php if ( $order->get_total_discount() > 0 ) { ?>
264242
<tr>
265243
<th colspan="3"><?php esc_html_e( 'Discount', 'woocommerce' ); ?></th>
266-
<td><?php
267-
// Discounts are always displayed as positive numbers
268-
if ( 'excl' === $tax_display ) {
269-
echo wp_kses_post( wc_price( $order->get_total_discount( false ) ) );
270-
} else {
271-
echo wp_kses_post( wc_price( $order->get_total_discount( true ) ) );
272-
}
273-
?></td>
244+
<td><?php echo wp_kses_post( wc_price( $order->get_total_discount() ) ); ?></td>
274245
</tr>
275246
<?php } ?>
276-
<?php if ( wc_tax_enabled() ) : ?>
247+
<?php if ( wc_tax_enabled() ) { ?>
277248
<?php if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) { ?>
278249
<?php foreach ( $order->get_tax_totals() as $code => $tax ) { ?>
279250
<tr>
@@ -287,7 +258,7 @@
287258
<td><?php echo wp_kses_post( wc_price( $order->get_total_tax() ) ); ?></td>
288259
</tr>
289260
<?php } ?>
290-
<?php endif; ?>
261+
<?php } ?>
291262
<tr>
292263
<th colspan="3"><?php esc_html_e( 'Total', 'woocommerce' ); ?></th>
293264
<td><?php echo wp_kses_post( wc_price( $order->get_total() ) ); ?></td>

0 commit comments

Comments
 (0)