<?php
/*
 * @package    ECLCDEK shipping plugin СДЭК to RadicalMart
 * @subpackage    ECLCDEK
 * @version    1.0.1
 * @author Econsult Lab.
 * @copyright  Copyright (c) 2025 Econsult Lab. All rights reserved.
 * @license    GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
 * @link       https://econsultlab.ru
 */

defined('_JEXEC') or die;

use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;

extract($displayData);

/**
 * Layout variables
 * -----------------
 *
 * @var  Form   $form     Form object.
 * @var  object $item     Checkout object.
 * @var  object $shipping Checkout shipping method object.
 *
 */

if (empty($shipping))
{
	return false;
}

?>
<div class="uk-grid-small" uk-grid="">
        <div class="uk-width-1-1@s uk-h4 uk-text-default"><?php echo Text::_("PLG_RADICALMART_SHIPPING_ECLCDEK_LAYOUT_CHECKOUT_MAP_SETTINGS_TITLE"); ?></div>
        <div class="uk-width-1-3@s"><?php echo $form->renderField('country', 'shipping'); ?></div>
        <div class="uk-width-1-3@s"><?php echo $form->renderField('region', 'shipping'); ?></div>
        <div class="uk-width-1-3@s"><?php echo $form->renderField('city', 'shipping'); ?></div>
        <div class="uk-width-1-1"><?php echo $form->renderField('address', 'shipping'); ?></div>
    <div class="uk-width-1-1@s uk-h4 uk-text-default"><?php echo Text::_("Детали и особые требования доставки"); ?></div>
        <?php if($shipping->params->get('delivery_options', "") === "door"):?>
	        <?php if ($shipping->params->get('field_entrance', $defaultFieldsParams['entrance']) !== 'hidden'): ?>
                <div class="uk-width-1-3@s"><?php echo $form->renderField('entrance', 'shipping'); ?></div>
	        <?php endif; ?>
	        <?php if ($shipping->params->get('field_floor', $defaultFieldsParams['floor']) !== 'hidden'): ?>
                <div class="uk-width-1-3@s"><?php echo $form->renderField('floor', 'shipping'); ?></div>
	        <?php endif; ?>
	        <?php if ($shipping->params->get('field_apartment', $defaultFieldsParams['apartment']) !== 'hidden'): ?>
                <div class="uk-width-1-3@s"><?php echo $form->renderField('apartment', 'shipping'); ?></div>
	        <?php endif; ?>
        <?php endif;?>
	<?php if ($shipping->params->get('field_comment', 1)): ?>
        <div class="uk-width-1-1"><?php echo $form->renderField('comment', 'shipping'); ?></div>
	<?php endif; ?>
</div>