<?php
/**
 * Checkout Form
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @see 	    https://docs.woocommerce.com/document/template-structure/
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     2.3.0
 */


if (!defined('ABSPATH')) {
	exit;
}
global $woocommerce;
$myaccount_page = get_option( 'woocommerce_myaccount_page_id' );
$myaccount_page_url = get_permalink( $myaccount_page );
$edit_account_url = wc_get_endpoint_url( 'edit-account', '', wc_get_page_permalink( 'myaccount' ) );
if (!is_user_logged_in()) {
	wp_redirect( $edit_account_url ); 
	exit;
}
wc_print_notices();

do_action('woocommerce_before_checkout_form', $checkout);

// If checkout registration is disabled and not logged in, the user cannot checkout
if (!$checkout->is_registration_enabled() && $checkout->is_registration_required() && !is_user_logged_in()) {
	echo "<div class='checkout_login'>". apply_filters('woocommerce_checkout_must_be_logged_in_message', __('You must be logged in to checkout.', 'woocommerce'))."</div>";
	return;
}

?>

<?php
$thwmscf_settings = get_option('THWMSC_SETTINGS');

$enable_login_step = isset($thwmscf_settings['enable_login_step']) ? $thwmscf_settings['enable_login_step'] : true;
$thwmscf_tab_align = !empty($thwmscf_settings['tab_align']) ? $thwmscf_settings['tab_align'] : '';
$thwmscf_title_login = !empty($thwmscf_settings['title_login']) ? wptexturize($thwmscf_settings['title_login']) : "Login";
$thwmscf_title_billing = !empty($thwmscf_settings['title_billing']) ? wptexturize($thwmscf_settings['title_billing']) : "Billing";
$thwmscf_title_shipping = !empty($thwmscf_settings['title_shipping']) ? wptexturize($thwmscf_settings['title_shipping']) : "Shipping";
$thwmscf_title_order_review = !empty($thwmscf_settings['title_order_review']) ? wptexturize($thwmscf_settings['title_order_review']) : "Your order";

$button_prev_text = !empty($thwmscf_settings['button_prev_text']) ? wptexturize($thwmscf_settings['button_prev_text']) : "Previous";
$button_next_text = !empty($thwmscf_settings['button_next_text']) ? wptexturize($thwmscf_settings['button_next_text']) : "Next";

$thwmscf_layout = isset($thwmscf_settings['thwmscf_layout']) && $thwmscf_settings['thwmscf_layout'] ? wptexturize($thwmscf_settings['thwmscf_layout']) : 'thwmscf_horizontal_box';

$back_to_cart_button = isset($thwmscf_settings['back_to_cart_button']) && $thwmscf_settings['back_to_cart_button'] ? wptexturize($thwmscf_settings['back_to_cart_button']) : '';

$back_to_cart_button_text = isset($thwmscf_settings['back_to_cart_button_text']) && $thwmscf_settings['back_to_cart_button_text'] ? wptexturize($thwmscf_settings['back_to_cart_button_text']) : 'Back to cart';

$billing_shipping_together = isset($thwmscf_settings['make_billing_shipping_together']) ? $thwmscf_settings['make_billing_shipping_together'] : false;

if (empty($back_to_cart_button_text)) {
	$back_to_cart_button_text = 'Back to cart';
}
?>
</div>
<!-- user-name-start -->
<?php
global $current_user;

?>
<div class="checkout-user-name">
	<div class="row back">
		<div class="col-md-8 col-8">
			<h4 class="checkout-username"><img src="https://server.visionvivante.com/compositeproduct/wp-content/uploads/2021/05/user.svg" class="mr-3"> <!-- Hola, --> <?php echo  $current_user->first_name; ?></h4>
		</div>
		<div class="col-md-4 col-4 not-you"><a href="<?php echo wp_logout_url(get_permalink(woocommerce_get_page_id('myaccount'))); ?>">No eres tú?</a></div>
	</div>
	<!-- user-name-end -->

	<div id="thwmscf_wrapper" class="thwmscf-wrapper <?php echo esc_attr($thwmscf_layout); ?>">
		<ul id="thwmscf-tabs" class="thwmscf-tabs stepper-li <?php echo esc_attr($thwmscf_tab_align); ?>">
		<li class="thwmscf-tab compra-stepper">
					<a href="#">
							<span class="thwmscf-tab-label">
								<span class="thwmscf-index thwmscf-tab-icon"><i class="bi bi-check2-circle" style="color:#2CD504;"></i></span>
							<p>Compra</p>
							</span>
					</a>
				</li>
			<?php
			$step_number = 1;
			$step1_class = 'first active';
			$enable_login_reminder = false;
			if ($enable_login_step && !is_user_logged_in() && 'yes' === get_option('woocommerce_enable_checkout_login_reminder')) {
				$enable_login_reminder = true;
				$step1_class = '';
			?>
				<li class="thwmscf-tab">
					<a href="javascript:void(0)" id="step-0" data-step="0" class="first active">
						<?php if ($thwmscf_layout == 'thwmscf_time_line_step') { ?>
							<span class="thwmscf-tab-label">
								<span class="thwmscf-index thwmscf-tab-icon">0</span>
								<?php echo wp_kses_post(__($thwmscf_title_login, 'woo-multistep-checkout')); ?>
							</span>
						<?php } else {
							echo wp_kses_post(__($thwmscf_title_login, 'woo-multistep-checkout'));
						} ?>
					</a>

				</li>
				
			<?php } ?>

			<li class="thwmscf-tab">
				<a href="javascript:void(0)" id="step-<?php echo $step_number; ?>" data-step="<?php echo $step_number; ?>" class="<?php echo $step1_class; ?>">
					<?php if ($thwmscf_layout == 'thwmscf_time_line_step') { ?>
						<span class="thwmscf-tab-label">
							<span class="thwmscf-index thwmscf-tab-icon"><i class="bi bi-check2-circle first-line"></i></span>
							<?php echo wp_kses_post(__($thwmscf_title_billing, 'woo-multistep-checkout')); ?>
						</span>
					<?php } else {
						echo wp_kses_post(__($thwmscf_title_billing, 'woo-multistep-checkout'));
					} ?>
				</a>
			</li>
			<?php $step_number++; ?>

			<?php if (!$billing_shipping_together) { ?>
				<li class="thwmscf-tab">
					<a href="javascript:void(0)" id="step-<?php echo $step_number; ?>" data-step="<?php echo $step_number; ?>">
						<?php if ($thwmscf_layout == 'thwmscf_time_line_step') { ?>
							<span class="thwmscf-tab-label">
								<span class="thwmscf-index thwmscf-tab-icon"><i class="bi bi-check2-circle"></i></span>
								<?php echo wp_kses_post(__($thwmscf_title_shipping, 'woo-multistep-checkout')); ?>
							</span>
						<?php } else {
							echo wp_kses_post(__($thwmscf_title_shipping, 'woo-multistep-checkout'));
						} ?>
					</a>
				</li>
			<?php $step_number++;
			} ?>

			<li class="thwmscf-tab pago-stepper">
				<a href="javascript:void(0)" id="step-<?php echo $step_number; ?>" data-step="<?php echo $step_number; ?>" class="last">
					<?php if ($thwmscf_layout == 'thwmscf_time_line_step') { ?>
						<span class="thwmscf-tab-label">
							<span class="thwmscf-index thwmscf-tab-icon"><i class="bi bi-check2-circle"></i></span>
							<?php echo wp_kses_post(__($thwmscf_title_order_review, 'woo-multistep-checkout')); ?>
						</span>
					<?php } else {
						echo wp_kses_post(__($thwmscf_title_order_review, 'woo-multistep-checkout'));
					} ?>
				</a>
			</li>
		</ul>


		<div id="thwmscf-tab-panels" class="thwmscf-tab-panels">
			<?php
			if ($enable_login_reminder) {
			?>
				<div class="thwmscf-tab-panel" id="thwmscf-tab-panel-0">
					<?php do_action('thwmscf_before_checkout_form'); ?>
				</div>
			<?php
			}
			?>
			<form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php echo esc_url(wc_get_checkout_url()); ?>" enctype="multipart/form-data">
				<div class="row">
					<div class="col-md-8 test_class">

						<?php if ($checkout->get_checkout_fields()) : ?>

							<?php $step_number = 1; // do_action( 'woocommerce_checkout_before_customer_details' ); 
							?>

							<!--<div class="col2-set" id="customer_details">-->
							<div class="thwmscf-tab-panel first_panel" id="thwmscf-tab-panel-<?php echo $step_number; ?>">
								<?php do_action('woocommerce_checkout_before_customer_details'); ?>
								<!-- shipping-tabs-start -->
								<div class="shipping-tabs">
									<div class="custom_dependent_checkbox"><label for="vehicle1">Necesito Factura</label><input type="checkbox" id="custom_dependent_field_checkbox" name="custom_checkbox" value="custom_checkbox"></div>
									 <div id="need_invoce_div" class="need_invoce_div hide">
										<label for="shipping_company_name" class="">Razón Social&nbsp;<span class="optional">(opcional)</span></label><span class="woocommerce-input-wrapper"><input type="text" class="input-text " name="shipping_company_name" id="shipping_company_name_copy" placeholder="" value=""></span>
										<label for="shipping_RUC" class="">RUC&nbsp;<span class="optional">(opcional)</span></label><span class="woocommerce-input-wrapper"><input type="text" class="input-text " name="shipping_RUC" id="shipping_RUC_copy" placeholder="" value=""></span><span class="shipping_ruc_error error" style="display: none;">El número de RUC debe contener 11 dígitos.</span>
									</div> 
									<h2>Elige tu opción de entrega</h2>
									<ul class="nav nav-tabs">
										<li class="nav-item address-tab-nav active">
											<a class="nav-link address-tab" data-toggle="tab" href="#domicilio">Despacho a domicilio</a>
										</li>
										<li class="nav-item self_pick_nav">
											<a class="nav-link self_pick_tab" id="self_pick_tab" data-toggle="tab" href="#Compra">Retirar tu Compra</a>
										</li>
									</ul>
									<div class="tab-content">
										<div id="domicilio" class="tab-pane fade in active">
											<div class="thwscf-billing despacho-detail">
											<!--	<h3>Selecciona uan direcciin de envio</h3>-->
											<!--	<p>El envío se realizará en 2 días hábiles a Lima</p>
												<p class="mb-4">Metropolitana y 7 días hábiles a para Provincia</p>-->
												<p>El envío se realizará en <strong>4 días hábiles</strong> después de la confirmación de la compra.</p><br/>
												<?php do_action('woocommerce_checkout_billing'); ?>
												
											</div>
										</div>
										<div id="Compra" class="tab-pane fade">
											<p>El recojo se realizará en <strong>4 días hábiles</strong> después de la confirmación de la compra.</p>
											<div class="row">
												<div class="col-md-12 compra-detail d-flex">
													<span><i class="bi bi-geo-alt-fill"></i></span>
													<ul>
														<li>
															<h4>Dirección de recojo en Tienda</h4>
														</li>
														<li>
															<p>INFORDATA S.A.</p>
														</li>
														<li>
															<p>Av Arequipa 860 Lima 15046</p>
														</li>
													</ul>
												</div>
												<div class="col-md-12 compra-detail d-flex">
													<span><i class="bi bi-calendar-check"></i></span>
													<ul>
														<li>
															<h4>Horario de Atención</h4>
														</li>
														<li>
															<p>Lunes a Viernes</p>
														</li>
														<li>
															<p>De 09:00 am a 5:00 pm</p>
														</li>
													</ul>
												</div>
											</div>
										</div>
									</div>
								</div>
								<!-- shipping-tabs-end -->

								<?php if ($billing_shipping_together) { ?>
									<div class="thwscf-shipping">
										<?php do_action('woocommerce_checkout_shipping'); ?>
									</div>

									<?php do_action('woocommerce_checkout_after_customer_details'); ?>
								<?php } ?>

							</div>

							<?php $step_number++; ?>

							<?php if (!$billing_shipping_together) { ?>
								<div class="thwmscf-tab-panel" id="thwmscf-tab-panel-<?php echo $step_number; ?>">
									<div class="thwscf-shipping">
										<?php do_action('woocommerce_checkout_shipping'); ?>
									</div>

									<?php do_action('woocommerce_checkout_after_customer_details'); ?>
								</div>

								<?php $step_number++; ?>
							<?php } ?>
							<!--</div>-->

							<?php // do_action( 'woocommerce_checkout_after_customer_details' ); 
							?>
							<div class="thwmscf-tab-panel second_panel" id="thwmscf-tab-panel-<?php echo $step_number; ?>">
								<h3 id="order_review_heading"><?php _e('Métodos de pago', 'woocommerce'); ?></h3>
								<?php 
										$gateways = WC()->payment_gateways->get_available_payment_gateways();
										$enabled_gateways = [];
										
										if( $gateways ) {
											foreach( $gateways as $gateway ) {
										
												if( $gateway->enabled == 'yes' ) {
										
													//$enabled_gateways[] = $gateway;
													$enabled_gateways = $gateway->title;
										
												}
												//echo '<li class="custom-paymentmethod-li">'.$enabled_gateways.'</li>';
											}
										}	
									?>
								<div class="bank-block">
									<?php do_action('woocommerce_checkout_before_order_review'); ?>
									<?php do_action( 'woocommerce_checkout_order_review' ); ?>
									<?php do_action('woocommerce_checkout_after_order_review'); ?>
									
								</div>
							</div>
							
						<?php endif; ?>

					</div>
					<div class="col-md-4 checkout-cart">
						<div id="order_review" class="woocommerce-checkout-review-order">
							<div class="cart-product-div">
								<?php
								$count = 0;
								//echo '<pre>'; print_r(WC()->cart->get_cart());
								foreach (WC()->cart->get_cart() as $cart_item_key => $cart_item) {


									$_product   = apply_filters('woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key);

									$product_id = apply_filters('woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key);

									if ($_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters('woocommerce_cart_item_visible', true, $cart_item, $cart_item_key)) {
										$product_permalink = apply_filters('woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink($cart_item) : '', $cart_item, $cart_item_key);


										if (array_key_exists('composite_data', $cart_item)) {
											//$more++;
											if ($_product->is_type('composite')) {
												$count++;
												/*if($count==1){
	            	 		echo '</div>';

	            	 	}else{
	            	 		echo '</div>';
	            	 	}
*/
												echo '</div><div class="composite-cart-product" id="see-more-composite" count=' . $count . '><a href="javascript:void(0)"> <span class="message"></span></a>';
								?>
												<div class="product_info row">
																<div class="product-img col-md-3 product-thumbnail">
														<?php
														$components_data = $cart_item['composite_data'];
														$componentids = array();
								$titles = array();
								foreach($components_data as $componentdata) {
								    $titles[] = $componentdata['title'];
								    $componentids[] = $componentdata['product_id'];
								}//echo "ID:".$selection_id;
								    $selection_title = strtolower($titles[0]);
								    if ($selection_title == "case") {
								    	$selection_id = $componentids[0];
								    	//echo $selection_id;
								    }
								    if ($selection_title != "case") {
								    	$selection_id = $componentdata['composite_id'];
								    }
								    $selected_product = wc_get_product($selection_id);
									//$image = wp_get_attachment_image_src( get_post_thumbnail_id( $selection_id), 'single-post-thumbnail' );
									$image = wp_get_attachment_image_src( get_post_thumbnail_id( $selection_id), 'full' );
									$thumbnail2 = apply_filters( 'woocommerce_cart_item_thumbnail', $selected_product->get_image(), $cart_item, $cart_item_key );

														if (!$product_permalink) {
															echo $thumbnail;
														} else {
															//printf('<a href="%s">%s</a>', esc_url($product_permalink), $thumbnail2); //
															echo '<img src="'.$image[0].'" class="woocmmerce_main_product_image">';
														}
														?>
													</div>
													<div class="product-info-inner col-md-9" data-title="<?php esc_attr_e('Quantity', 'woocommerce'); ?>">
														<div class="product_outer_rapper">
															<div class="product-metadata-name ">
																<?php
																if (!$product_permalink) {
																	echo wp_kses_post(apply_filters('woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key) . '&nbsp;');
																} elseif ($_product->is_type('composite')) {
																	echo wp_kses_post(apply_filters('woocommerce_cart_item_name', sprintf('<a class="cart-product-name" href="%s">%s</a>', esc_url($product_permalink), $_product->get_name()), $cart_item, $cart_item_key));
																} elseif (!$_product->is_type('composite')) {
																	//echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', sprintf( $_product->get_name() ), $cart_item, $cart_item_key ) );
																}


																do_action('woocommerce_after_cart_item_name', $cart_item, $cart_item_key);

																// Meta data.
																echo wc_get_formatted_cart_item_data($cart_item); // PHPCS: XSS ok.

																// Backorder notification.
																if ($_product->backorders_require_notification() && $_product->is_on_backorder($cart_item['quantity'])) {
																	echo wp_kses_post(apply_filters('woocommerce_cart_item_backorder_notification', '<p class="backorder_notification">' . esc_html__('Available on backorder', 'woocommerce') . '</p>', $product_id));
																}
																?>
															</div>
															<div class="product-quantity set-margin">
																<?php if ($_product->is_type('composite') || $_product->is_sold_individually()) { ?>
																	<span class='quantity-text-span'>Cant:
																		<?php $quantity =  $cart_item['quantity'];
																		echo '<span class="cart_quantity">' .$quantity. '</span>'; ?>
																	</span>
																<?php } ?>
															</div>
															<div class="product-subtotal set-margin" data-title="<?php esc_attr_e('Subtotal', 'woocommerce'); ?>">
																<?php if ($_product->is_type('composite') || $_product->is_sold_individually()) { ?>
																	<span class='price-text-span'>Precio: </span><?php
																		echo "<span class='custom_cart_subtotal do_not_delete' style='display:none;'>".WC()->cart->subtotal."</span>";
																		echo apply_filters('woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal($_product, $cart_item['quantity']), $cart_item, $cart_item_key); // PHPCS: XSS ok.
																	?>
																<?php } ?>
															</div>
														</div>
													</div>

												</div>
											<?php } ?>

										<?php
										} else { ?>
											<div class="product_info row">
												<div class="product-img col-md-3 product-thumbnail">
													<?php
													$thumbnail = apply_filters('woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key);

													if (!$product_permalink) {
														echo $thumbnail;
													} else {
														printf('<a href="%s">%s</a>', esc_url($product_permalink), $thumbnail); //
													}
													?>
												</div>
												<div class="product-info-inner col-md-9" data-title="<?php esc_attr_e('Quantity', 'woocommerce'); ?>">
													<div class="ls_outer_main">
														<div class="product-metadata-name ">
															<?php
															if (!$product_permalink) {
																echo wp_kses_post(apply_filters('woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key) . '&nbsp;');
															} elseif (!$_product->is_type('composite')) {
																echo wp_kses_post(apply_filters('woocommerce_cart_item_name', sprintf('<a class="cart-product-name" href="%s">%s</a>', esc_url($product_permalink), $_product->get_name()), $cart_item, $cart_item_key));
															}


															do_action('woocommerce_after_cart_item_name', $cart_item, $cart_item_key);

															// Meta data.
															echo wc_get_formatted_cart_item_data($cart_item); // PHPCS: XSS ok.

															// Backorder notification.
															if ($_product->backorders_require_notification() && $_product->is_on_backorder($cart_item['quantity'])) {
																echo wp_kses_post(apply_filters('woocommerce_cart_item_backorder_notification', '<p class="backorder_notification">' . esc_html__('Available on backorder', 'woocommerce') . '</p>', $product_id));
															}
															?>
															<!-- </td> -->
														</div>
														<div class="product-metadata-div">
															<div class="product-quantity set-margin">

																<span class='quantity-text-span'>Cant:
																	<?php $quantity =  $cart_item['quantity'];
																	echo $quantity; ?>
																</span>

															</div>
															<div class="product-subtotal set-margin" data-title="<?php esc_attr_e('Subtotal', 'woocommerce'); ?>">
																<span class='price-text-span'>Precio: </span>
																<?php
																echo apply_filters('woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal($_product, $cart_item['quantity']), $cart_item, $cart_item_key); // PHPCS: XSS ok.
																?>
															</div>
														</div>
													</div>
												</div>
											</div>
								<?php   }
									}
								}

								?>
								<?php //do_action( 'woocommerce_checkout_order_review' ); 

								?>
							</div>

							<a href="<?php echo wc_get_cart_url(); ?>" class="btn btn-primary">
								<i class="bi bi-cart3"></i><i class="fas fa-circle"></i><i class="bi bi-dot"></i>volver al carrito
							</a>
						</div>
						<div class="checkout-cart-lines mt-3">
							<div class="shipping_val_table">
								<table cellspacing="0" class="shop_table shop_table_responsive">
									<tbody>	
										<tr class="woocommerce-shipping-totals shipping">
											<td data-title="Envío">
												<ul id="shipping_method" class="woocommerce-shipping-methods">
													<li>
														<input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_flat_rate1" value="flat_rate:1" class="shipping_method" checked="checked"><label for="shipping_method_0_flat_rate1">Precio fijo: <span class="dependent_shipping_cost_color">S/<span class="dependent_shipping_cost"></span></span></label>	
													</li>
													<li>
														<input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_free_shipping12" value="free_shipping:12" class="shipping_method"><label for="shipping_method_0_free_shipping12">Envío gratuito lima</label>				
													</li>
													<li>
														<input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_flat_rate2" value="flat_rate:2" class="shipping_method"><label for="shipping_method_0_flat_rate2">Precio fijo: <span class="dependent_shipping_cost_color">S/<span class="dependent_shipping_cost"></span></span></label>					
													</li>
													<li>
														<input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_free_shipping10" value="free_shipping:10" class="shipping_method"><label for="shipping_method_0_free_shipping10">Envío gratuito other</label>		
													</li>
												</ul>
											</td>
										</tr>
									</tbody>
								</table>
							</div>
							<?php 
						        global  $woocommerce;
							    $currency=get_woocommerce_currency_symbol();
								$cart_total_ammount = floatval( preg_replace( '#[^\d.]#', '', $woocommerce->cart->get_cart_total() ) );
								$shipping_ammount = WC()->cart->get_shipping_total();
								 $checkout_grand_total = floatval($shipping_ammount) + floatval($cart_total_ammount);
								 $checkout_grand_total = number_format($checkout_grand_total, 2);
								 echo  $amount;
							?>
							<span class="checout_shipping_price">
							<?php 
								$shipping_packages =  WC()->cart->get_shipping_packages();
								// Get the WC_Shipping_Zones instance object for the first package
								$shipping_zone = wc_get_shipping_zone( reset( $shipping_packages ) );
								$zone_id   = $shipping_zone->get_id(); // Get the zone ID
								$zone_name = $shipping_zone->get_zone_name(); // Get the zone name
								//echo '<p>Zone id: ' . $zone_id . ' | Zone name: ' . $zone_name . '</p>';
								$delivery_zones = WC_Shipping_Zones::get_zones();
								foreach ((array) $delivery_zones as $key => $the_zone ) {
								  //echo $the_zone['zone_name'];
								  foreach ($the_zone['shipping_methods'] as $value) {
								  	if ($the_zone['zone_name']=="lima") {
								  		echo "<span class='lima_shipping_cost' style='display:none;'>".$value->cost." </span>";
								  	}
								    if ($the_zone['zone_name']=="except lima") {
								  		echo "<span class='except_lima_shipping_cost' style='display:none;'>".$value->cost." </span>";
								  	}
								  }
								}
							?>
							<?php echo  "Costo de Envío "."<span>".$currency ."<span class='dependent_shipping_cost'>".$shipping_ammount.".00</span></span>"; ?>
							</span>
							<span class="checout_price">
							<?php echo  "<br> Monto Final a pagar <span class='woocommerce-Price-amount amount'>
							<bdi><span class='woocommerce-Price-currencySymbol'>".$currency.'</span><span class="dependent_cart_total_cost">' . $cart_total_ammount.'</span></bdi></span>' ?>
							</span>
						</div>
			</form>				
		</div>

		<div class="thwmscf-buttons">
			<input type="button" id="action-prev" class="button-prev" value="<?php echo esc_attr(__($button_prev_text, 'woo-multistep-checkout')); ?>">
			<input type="button" id="action-next" class="button-next custom_next_btn" value="<?php echo esc_attr(__($button_next_text, 'woo-multistep-checkout')); ?>">
			<?php
			if ($back_to_cart_button == 'yes') {
			?>
				<a class="button thwmscf-cart-url" href="<?php echo esc_url(wc_get_cart_url()); ?>"><?php echo wp_kses_post(__($back_to_cart_button_text, 'woo-multistep-checkout')); ?></a>
			<?php
			} ?>
		</div>
		
	</div>

	<?php do_action('woocommerce_after_checkout_form', $checkout); ?>

