<?php
/**
 * Default template part for the product on the
 * transaction confirmation template part.
 *
 * 
 * @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/elements/
 * directory located in your theme.
*/
?>

<?php do_action( 'ninja_shop_content_confirmation_before_product_element' ); ?>
<div class="ninja-shop-transaction-product ninja-shop-table-row  <?php echo it_exchange( 'line-item', 'has-children' ) ? 'ninja-shop-table-row-parent' : ''; ?>">
	<?php do_action( 'ninja_shop_content_confirmation_before_product_details' ); ?>
	<div class="ninja-shop-transaction-product-details ninja-shop-table-column">
		<div class="ninja-shop-table-column-inner">
			<?php do_action( 'ninja_shop_content_confirmation_before_product_attibutes' ); ?>
			<div class="ninja-shop-transaction-product-attributes ninja-shop-clearfix ninja-shop-transaction-product-<?php echo ( it_exchange( 'transaction', 'has-featured-image' ) ) ? 'has-featured-image' : 'no-featured-image' ?>">
				<?php do_action( 'ninja_shop_content_confirmation_before_product_featured_image' ); ?>
				<?php it_exchange( 'transaction', 'featured-image' ); ?>
				<?php do_action( 'ninja_shop_content_confirmation_after_product_featured_image' ); ?>

				<?php do_action( 'ninja_shop_content_confirmation_before_product_title' ); ?>
				<?php it_exchange( 'transaction', 'product-attribute', array( 'attribute' => 'title', 'wrap' => 'h3' ) ); ?>
				<?php do_action( 'ninja_shop_content_confirmation_after_product_title' ); ?>
			</div>
			<?php do_action( 'ninja_shop_content_confirmation_after_product_attibutes' ); ?>

			<?php if ( it_exchange( 'transaction', 'has-product-downloads' ) ) : ?>
				<?php do_action( 'ninja_shop_content_confirmation_before_product_downloads' ); ?>
				<div class="ninja-shop-transaction-product-downloads ninja-shop-clearfix">
					<h4><?php _e( 'Downloads', 'it-l10n-ithemes-exchange' ); ?></h4>
					<?php if ( ! it_exchange( 'transaction', 'get-cleared-for-delivery' ) ) : ?>
						<p><?php _e( 'The status for this transaction does not grant access to downloadable files. Once the transaction is updated to an approved status, you will receive a followup email with your download links.', 'it-l10n-ithemes-exchange' ); ?></p>
					<?php endif; ?>
					<ul class="ninja-shop-transaction-product-downloads-list">
						<?php while( it_exchange( 'transaction', 'product-downloads' ) ) : ?>
								<?php if ( it_exchange( 'transaction', 'has-product-download-hashes' ) ) : ?>
									<?php while( it_exchange( 'transaction', 'product-download-hashes' ) ) : ?>
										<li class="ninja-shop-download-data ninja-shop-clearfix">
											<span class="ninja-shop-transaction-product-download-title ninja-shop-left">
												<?php it_exchange( 'transaction', 'product-download', array( 'attribute' => 'title' ) ); ?>
											</span>
											<?php if ( ! it_exchange( 'transaction', 'get-product-download-hash', array( 'attribute' => 'download-limit' ) ) || it_exchange( 'transaction', 'get-product-download-hash', array( 'attribute' => 'downloads-remaining' ) ) ) : ?>
												<?php if ( it_exchange( 'transaction', 'get-cleared-for-delivery' ) ) : ?>
													<span class="ninja-shop-right">
														<a class="button btn" href="<?php it_exchange( 'transaction', 'product-download-hash', array( 'attribute' => 'download-url' ) ); ?>"><?php _e( 'Download', 'it-l10n-ithemes-exchange' ); ?></a>
													</span>
												<?php endif; ?>
											<?php endif; ?>
										</li>
									<?php endwhile; ?>
								<?php endif; ?>
						<?php endwhile; ?>
					</ul>
				</div>
				<?php do_action( 'ninja_shop_content_confirmation_after_product_downloads' ); ?>
			<?php endif; ?>
		</div>
	</div>
	<?php do_action( 'ninja_shop_content_confirmation_after_product_details' ); ?>

	<?php do_action( 'ninja_shop_content_confirmation_before_product_cart_object' ); ?>
	<div class="ninja-shop-transaction-product-cart-object ninja-shop-table-column">
		<div class="ninja-shop-table-column-inner">
			<?php it_exchange( 'line-item', 'quantity', 'format=var_value' ); ?>
			<span class="ninja-shop-right"><?php it_exchange( 'line-item', 'total' ); ?></span>
		</div>
	</div>
	<?php do_action( 'ninja_shop_content_confirmation_after_product_cart_object' ); ?>
</div>

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