<?php
/**
 * Order Summary Totals (Checkout Sidebar)
 *
 * @package pawwell
 */

defined( 'ABSPATH' ) || exit;
?>
<div id="orderSummaryTotals" class="order-summary-totals">

	<?php if ( wc_coupons_enabled() ) : ?>
		<?php foreach ( WC()->cart->get_coupons() as $code => $coupon ) : ?>
		<div class="s-promo-applied show">
			<span><?php wc_cart_totals_coupon_label( $coupon ); ?></span>
			<span><?php wc_cart_totals_coupon_html( $coupon ); ?></span>
		</div>
		<?php endforeach; ?>
	<?php endif; ?>

	<div class="summary-divider"></div>

	<div class="summary-row co-summary-row">
		<span><?php esc_html_e( 'Subtotal', 'pawwell' ); ?></span>
		<strong class="summary-value"><?php wc_cart_totals_subtotal_html(); ?></strong>
	</div>

	<?php foreach ( WC()->cart->get_fees() as $fee ) : ?>
	<div class="summary-row co-summary-row">
		<span><?php echo esc_html( $fee->name ); ?></span>
		<strong class="summary-value"><?php wc_cart_totals_fee_html( $fee ); ?></strong>
	</div>
	<?php endforeach; ?>

	<?php if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) : ?>
	<div class="summary-row co-summary-row">
		<span><?php esc_html_e( 'Shipping', 'pawwell' ); ?></span>
		<strong class="summary-value co-shipping-value" id="coShippingVal"><?php echo wp_kses_post( WC()->cart->get_cart_shipping_total() ); ?></strong>
	</div>
	<?php elseif ( WC()->cart->needs_shipping() ) : ?>
	<div class="summary-row co-summary-row">
		<span><?php esc_html_e( 'Shipping', 'pawwell' ); ?></span>
		<strong class="summary-value"><?php esc_html_e( 'Calculated at next step', 'pawwell' ); ?></strong>
	</div>
	<?php endif; ?>

	<?php if ( wc_tax_enabled() && ! WC()->cart->display_prices_including_tax() ) : ?>
	<div class="summary-row co-summary-row">
		<span><?php echo esc_html( WC()->countries->tax_or_vat() ); ?></span>
		<strong class="summary-value"><?php wc_cart_totals_taxes_total_html(); ?></strong>
	</div>
	<?php endif; ?>

	<div class="co-summary-total summary-row total">
		<span class="st-label"><?php esc_html_e( 'Total', 'pawwell' ); ?>
			<?php if ( wc_tax_enabled() ) : ?>
				<small><?php esc_html_e( 'Inclusive of all taxes', 'pawwell' ); ?></small>
			<?php endif; ?>
		</span>
		<strong class="st-value summary-value"><?php wc_cart_totals_order_total_html(); ?></strong>
	</div>

	<?php if ( wc_tax_enabled() && WC()->cart->get_taxes_total() ) : ?>
	<p class="s-tax-note"><?php printf( esc_html__( 'Including %s in taxes', 'pawwell' ), wp_kses_post( WC()->cart->get_taxes_total() ) ); ?></p>
	<?php endif; ?>

</div>