Exchange Theme Templates: super-widget-checkout/loops/items.php

From IThemes Codex
Jump to: navigation, search

This is the default template for the super-widget-checkout items loop.

Contents

Theme Location

theme/exchange/super-widget-checkout/loops/items.php

Action Hooks

Theme API

Default Code

<?php
/**
 * This is the default template for the 
 * super-widget-checkout items loop.
 *
 * @since 1.1.0
 * @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/super-widget-checkout/loops directory
 * located in your theme.
*/
?>
<?php do_action( 'it_exchange_super_widget_checkout_before_items' ); ?>
<?php do_action( 'it_exchange_super_widget_checkout_before_items_wrap' ); ?>
<div class="cart-items-wrapper">
	<?php do_action( 'it_exchange_super_widget_checkout_begin_items_wrap' ); ?>

	<?php do_action( 'it_exchange_super_widget_checkout_before_items_loop' ); ?>
	<?php while( it_exchange( 'cart', 'cart-items' ) ) : ?>
		<?php it_exchange_set_global( 'can_edit_purchase_quantity', it_exchange( 'cart-item', 'supports-purchase-quantity' ) && ( it_exchange_get_cart_products_count() < 2 ) ); ?>
		<?php do_action( 'it_exchange_super_widget_checkout_begin_items_loop' ); ?>

		<?php 
		foreach( it_exchange_get_template_part_elements( 'super-widget-checkout', 'items', array( 'item' ) ) as $element ) :
			it_exchange_get_template_part( 'super-widget-checkout/elements/' . $element );
		endforeach;
		?>
		<?php do_action( 'it_exchange_super_widget_checkout_end_items_loop' ); ?>
	<?php endwhile; ?>
	<?php do_action( 'it_exchange_super_widget_checkout_after_items_loop' ); ?>

	<?php 
	/**
	 * Loops we want to run inside the cart-items-wrapper but after the items loop
	 * If add-ons want to add to or remove from the loops that are included here,
	 * they can hook into the filter found inside it_exchange_get_template_part_loops
	*/ 
	$loops = array();
	if ( it_exchange( 'coupons', 'has-applied', array( 'type' => 'cart' ) ) )
		$loops[] = 'discounts';
	if ( it_exchange_get_cart_subtotal( false ) !== it_exchange_get_cart_total( false ) )
		$loops[] = 'cart-total';
	foreach( it_exchange_get_template_part_loops( 'super-widget-checkout', 'after-cart-items', $loops ) as $loop ) :
		it_exchange_get_template_part( 'super-widget-checkout/loops/' . $loop );
	endforeach;
	// End additional loops
	?>

	<?php do_action( 'it_exchange_super_widget_checkout_end_items_wrap' ); ?>
</div>
<?php do_action( 'it_exchange_super_widget_checkout_after_items_wrap' ); ?>
<?php do_action( 'it_exchange_super_widget_checkout_after_items' ); ?>

← Back to Exchange Theme Templates Page

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox