<?php

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

// double fields for DIVI templates.
add_action(
	'woocommerce_review_order_before_submit',
	function () {
		?>
	<input
			type="hidden"
			id="divi_parcel_machine_id"
			name="parcel_machine_id"
			value=""
	/>
	<input
			type="hidden"
			id="divi_parcel_machine_desc"
			name="parcel_machine_desc"
			value=""
	/>
		<?php
	}
);
?>

<tr class="inpost_intl-parcel-machine">
	<th class="inpost_intl-parcel-machine-label">
	</th>
	<td class="inpost_intl-parcel-machine-select">
		<?php if ( defined( 'DOING_AJAX' ) && true === DOING_AJAX ) : ?>

			<div class="inpost_intl_show_geowidget" id="inpost_intl_show_geowidget">
				<?php echo esc_html__( 'Choose pick-up point', 'inpost-international' ); ?>
			</div>

			<div id="inpost_intl_selected_point" class="inpost_intl_hidden_point_data" style="display: none">
				<div>
					<span class="inpost_intl-visible-point-header italic" style="font-weight: bold">
						<?php echo esc_html__( 'Selected parcel locker:', 'inpost-international' ); ?>
					</span>
				</div>
				<span class="inpost_intl-visible-point-description" id="selected-parcel-machine-id"></span>

				<input type="hidden" id="parcel_machine_id"
						name="parcel_machine_id" class="parcel_machine_id"/>
				<input type="hidden" id="parcel_machine_desc"
						name="parcel_machine_desc" class="parcel_machine_desc"/>
			</div>

		<?php endif ?>
	</td>
</tr>

