Skip to content

Commit

Permalink
add fee to receipt template
Browse files Browse the repository at this point in the history
  • Loading branch information
kilbot committed Apr 20, 2023
1 parent 6bf1a39 commit 0251d96
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions templates/receipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,19 +221,32 @@
<td><?php echo wp_kses_post( wc_price( $order->get_shipping_total() ) ); ?></td>
</tr>
<?php endif; ?>
<?php foreach ( $order->get_fees() as $fee ) : ?>
<tr>
<th colspan="3"><?php esc_html_e( 'Fee', 'woocommerce' ); ?></th>
<td><?php echo wp_kses_post( wc_price( $fee->get_total() ) ); ?></td>
</tr>
<?php endforeach; ?>
<?php if ( $order->get_total_discount() > 0 ) : ?>
<tr>
<th colspan="3"><?php esc_html_e( 'Discount', 'woocommerce' ); ?></th>
<td><?php echo wp_kses_post( wc_price( $order->get_total_discount() ) ); ?></td>
</tr>
<?php endif; ?>
<?php if ( wc_tax_enabled() ) : ?>
<?php foreach ( $order->get_tax_totals() as $code => $tax ) : ?>
<?php if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) : ?>
<?php foreach ( $order->get_tax_totals() as $code => $tax ) : ?>
<tr>
<th colspan="3"><?php echo esc_html( $tax->label ); ?></th>
<td><?php echo wp_kses_post( wc_price( $tax->amount ) ); ?></td>
</tr>
<?php endforeach; ?>
<?php else : ?>
<tr>
<th colspan="3"><?php echo esc_html( $tax->label ); ?></th>
<td><?php echo wp_kses_post( wc_price( $tax->amount ) ); ?></td>
<th colspan="3"><?php echo esc_html( WC()->countries->tax_or_vat() ); ?></th>
<td><?php echo wp_kses_post( wc_price( $order->get_total_tax() ) ); ?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<tr>
<th colspan="3"><?php esc_html_e( 'Total', 'woocommerce' ); ?></th>
Expand Down

0 comments on commit 0251d96

Please sign in to comment.