<?php
/**
 * This is the default template part for the cart
 * items loop.
 *
 * 
 * @version 1.1.0
 * @package IT_Exchange
 *
 * WARNING: Do not edit this file directly. To use
 * this template in a theme, copy over this file
 * to the exchange/content-cart/loops/ directory
 * located in your theme.
*/
?>

<?php do_action( 'ninja_shop_content_cart_before_items' ); ?>
<div id="ninja-shop-cart-items" class="ninja-shop-table">
<?php do_action( 'ninja_shop_content_cart_before_items_loop' ); ?>
<?php it_exchange_get_template_part( 'content-cart/elements/cart-title' ); ?>
<?php while ( it_exchange( 'cart', 'cart-items' ) ) : ?>
	<?php do_action( 'ninja_shop_content_cart_begin_items_loop' ); ?>

	<?php do_action( 'ninja_shop_content_cart_before_items_loop_table_row' ); ?>
	<div class="ninja-shop-table-row ninja-shop-line-item ninja-shop-product-item <?php echo it_exchange( 'cart-item', 'has-children' ) ? 'ninja-shop-table-row-parent' : ''; ?>">
		<?php do_action( 'ninja_shop_content_cart_begin_items_loop_table_row' ); ?>

		<?php foreach ( it_exchange_get_template_part_elements( 'content_cart', 'items', array(
			'item-featured-image',
			'item-title',
			'item-price',
			'item-quantity',
			'item-subtotal',
			'item-remove' )
		) as $item ) : ?>
			<?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-cart/elements/' . $item );
			?>
		<?php endforeach; ?>
		<?php do_action( 'ninja_shop_content_cart_end_items_loop_table_row' ); ?>
	</div>

	<?php if ( it_exchange( 'cart-item', 'has-children' ) ): ?>
		<?php it_exchange_get_template_part( 'content-cart/loops/item-children' ); ?>
	<?php endif; ?>

	<?php do_action( 'ninja_shop_content_cart_after_items_loop_table_row' ); ?>

	<?php do_action( 'ninja_shop_content_cart_end_items_loop' ); ?>
<?php endwhile; ?>
<?php do_action( 'ninja_shop_content_cart_after_items_loop' ); ?>
</div>
<?php do_action( 'ninja_shop_content_cart_after_items' ); ?>
