<?php
/**
 * The transaction products loop.
 *
 * 
 * @version 1.1.0
 * @package IT_Exchange
 *
 * WARNING: Do not edit this file directly. To use
 * this template in a theme, simply copy over this
 * file's content to the exchange/content-confirmation/loops/
 * directory located in your theme.
 */
?>

<?php do_action( 'ninja_shop_content_confirmation_before_products_loop' ); ?>
<?php if ( it_exchange( 'transaction', 'has-products' ) ) : ?>
	<?php it_exchange_get_template_part( 'content-confirmation/elements/purchases-label' ); ?>
	<?php do_action( 'ninja_shop_content_confirmation_begin_products_loop' ); ?>
	<div class="ninja-shop-transaction-products ninja-shop-table">
		<?php while ( it_exchange( 'transaction', 'products' ) ) : ?>
			<?php foreach ( it_exchange_get_template_part_elements( 'content_confirmation', 'products_loop', array( 'product' ) ) as $detail ) : ?>
				<?php it_exchange_get_template_part( 'content-confirmation/elements/' . $detail ); ?>
			<?php endforeach; ?>
		<?php endwhile; ?>
	</div>
	<?php do_action( 'ninja_shop_content_confirmation_end_products_loop' ); ?>
	<?php it_exchange_get_template_part( 'content-confirmation/loops/line-items' ); ?>
	<?php do_action( 'ninja_shop_content_confirmation_begin_transaction_summary_loop' ); ?>
	<div class="ninja-shop-transaction-summary-loop ninja-shop-table">
		<?php foreach (
			it_exchange_get_template_part_elements( 'content_confirmation', 'transaction_summary', array(
				'totals-subtotal',
				'totals-shipping',
				'totals-savings',
				'totals-taxes',
				'totals-total'
			) ) as $total
		) : ?>
			<?php if ( $total !== 'totals-taxes' ): ?>
				<div class="ninja-shop-table-row ninja-shop-cart-<?php echo $total; ?>">
			<?php endif; ?>
			<?php
			/**
			 * Theme and add-on devs should add code to this loop by
			 * hooking into it_exchange_get_template_part_elements filter
			 * and adding the appropriate template file to their theme or add-on
			 */
			it_exchange_get_template_part( 'content-confirmation/elements/' . $total );
			?>

			<?php if ( $total !== 'totals-taxes' ): ?>
				</div>
			<?php endif; ?>

		<?php endforeach; ?>
	</div>
	<?php do_action( 'ninja_shop_content_confirmation_end_products_loop' ); ?>
<?php endif; ?>
<?php do_action( 'ninja_shop_content_confirmation_after_products_loop' ); ?>
