donation-customer-invoice.php 2.59 KB
Newer Older
1 2 3 4
<?php
/**
 * Customer invoice email
 *
Varun Sridharan's avatar
Varun Sridharan committed
5 6 7
 * @author  Varun Sridharan
 * @package WooCommerce Quick Donation/Templates/emails
 * @version 0.1
8 9 10 11 12 13 14 15
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

?>

Varun Sridharan's avatar
Varun Sridharan committed
16
<?php do_action( 'woocommerce_donation_email_header', $email_heading ); ?>
17 18 19 20 21 22 23 24 25

<?php if ( $order->has_status( 'pending' ) ) : ?>

	<p><?php printf( __( 'An order has been created for you on %s. To pay for this order please use the following link: %s', 'woocommerce' ), get_bloginfo( 'name', 'display' ), '<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . __( 'pay', 'woocommerce' ) . '</a>' ); ?></p>

<?php endif; ?>

<?php do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text ); ?>

26
<h2><?php printf( __( 'Donation ID #%s', 'woocommerce' ), $order->get_order_number() ); ?> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order->order_date ) ), date_i18n( wc_date_format(), strtotime( $order->order_date ) ) ); ?>)</h2>
27 28 29 30

<table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" border="1">
	<thead>
		<tr>
31
			<th class="td" scope="col" style="text-align:left;"><?php _e( 'Project', WC_QD_TXT ); ?></th>
32 33 34 35 36 37 38
			<th class="td" scope="col" style="text-align:left;"><?php _e( 'Price', 'woocommerce' ); ?></th>
		</tr>
	</thead>
	<tbody>
		<?php
			switch ( $order->get_status() ) {
				case "completed" :
39
					echo $order->email_order_items_table( false, false, true );
40 41
				break;
				case "processing" :
42
					echo $order->email_order_items_table( false, true, true );
43 44
				break;
				default :
45
					echo $order->email_order_items_table( false, true, false );
46 47 48 49 50 51
				break;
			}
		?>
	</tbody>
	<tfoot>
		<?php
52

53 54
			if ( $totals = $order->get_order_item_totals() ) {
				$i = 0;
55 56
                 
				foreach ( $totals as $subKey => $total ) {
57
					$i++;
58 59
                    
                    if($subKey == 'cart_subtotal' || $subKey == 'order_total'){continue;}
60
					?><tr>
61
						<td class="td" colspan="1" style="text-align:left; <?php if ( $i == 1 ) echo 'border-top-width: 4px !important;'; ?>"><?php echo $total['label']; ?></td>
62 63 64 65 66 67 68 69 70 71 72 73
						<td class="td" style="text-align:left; <?php if ( $i == 1 ) echo 'border-top-width: 4px !important;'; ?>"><?php echo $total['value']; ?></td>
					</tr><?php
				}
			}
		?>
	</tfoot>
</table>

<?php do_action( 'woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text ); ?>

<?php do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text ); ?>

Varun Sridharan's avatar
Varun Sridharan committed
74
<?php do_action( 'woocommerce_donation_email_footer' ); ?>