donation-review-order.php 1.63 KB
Newer Older
1 2 3 4
<?php
/**
 * Review order table
 *
Varun Sridharan's avatar
Varun Sridharan committed
5 6 7
 * @author  Varun Sridharan
 * @package WooCommerce Quick Donation/Templates/checkout
 * @version 0.1
8 9 10 11 12 13 14 15 16
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
?>
<table class="shop_table woocommerce-checkout-review-order-table">
	<thead>
		<tr>
17 18
			<th class="product-name"><?php _e( 'Donation for', WC_QD_TXT ); ?></th>
			<th class="product-total"><?php _e( 'Amount', WC_QD_TXT ); ?></th>
19 20 21 22 23 24 25 26 27 28 29 30
		</tr>
	</thead>
	<tbody>
		<?php
			do_action( 'woocommerce_review_order_before_cart_contents' );

			foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
				$_product     = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );

				if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_checkout_cart_item_visible', true, $cart_item, $cart_item_key ) ) {
					?>
					<tr class="<?php echo esc_attr( apply_filters( 'woocommerce_cart_item_class', 'cart_item', $cart_item, $cart_item_key ) ); ?>">
31 32
						<td class="product-name"> 
							<?php  echo apply_filters('wc_quick_donation_cart_project_name',$_product->get_title(),$cart_item); ?>
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
						</td>
						<td class="product-total">
							<?php echo apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ), $cart_item, $cart_item_key ); ?>
						</td>
					</tr>
					<?php
				}
			}

			do_action( 'woocommerce_review_order_after_cart_contents' );
		?>
	</tbody>
	<tfoot>
		<?php do_action( 'woocommerce_review_order_before_order_total' ); ?>
		<?php do_action( 'woocommerce_review_order_after_order_total' ); ?>
	</tfoot>
</table>