<?xml version="1.0" encoding="UTF-8"?>
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
    <section id="refilo_geoip" translate="label" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1">
        <class>separator-top</class>
        <label>Geoip</label>
        <tab>refilo</tab>
        <resource>FiloBlu_Refilo::refilo_config</resource>
        <group id="geoip_config" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1"
               showInStore="1">
            <label>Geoip</label>
            <field id="geoip_enabled" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Geoip Enabled</label>
                <source_model>Magento\Config\Model\Config\Source\Enabledisable</source_model>
            </field>
            <field id="enable_popup" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Enable Popup</label>
                <source_model>Magento\Config\Model\Config\Source\Enabledisable</source_model>
            </field>
            <field id="geoip_cookie_name" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Cookie Name</label>
            </field>
            <field id="geoip_cookie_age" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Cookie Age</label>
                <comment>Millisecond</comment>
            </field>
            <field id="misfits" translate="label comment" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Misfits</label>
                <source_model>Magento\Config\Model\Config\Source\Enabledisable</source_model>
            </field>
            <field id="misfits_cookie_name" translate="label" type="text" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Misfits Cookie Name</label>
            </field>
            <field id="misfits_cookie_age" translate="label" type="text" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Misfits Cookie Age</label>
            </field>
            <field id="root_redirect_code" translate="label comment" sortOrder="80" type="select" showInStore="1" showInWebsite="1" showInDefault="1">
                <label>Status code for redirect from root to SW</label>
                <options>
                    <option label="301">301</option>
                    <option label="302">302</option>
                </options>
            </field>
        </group>
        <group id="country" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Countries</label>
            <field id="enabled_different_shipping_country" translate="label comment" type="select" sortOrder="10"
                   showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Allow Different Shipping Countries</label>
                <source_model>Magento\Config\Model\Config\Source\Enabledisable</source_model>
            </field>
            <field id="allow_shipping" translate="label" type="multiselect" sortOrder="20" showInDefault="1"
                   showInWebsite="1" showInStore="1" canRestore="1">
                <label>Allow Shipping Countries</label>
                <source_model>Magento\Directory\Model\Config\Source\Country</source_model>
                <can_be_empty>1</can_be_empty>
                <depends>
                    <field id="enabled_different_shipping_country">1</field>
                </depends>
            </field>
        </group>
        <group id="country_store" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Country to Store View Redirect</label>
            <field id="enable_store" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Enable Country --> Store View</label>
                <source_model>Magento\Config\Model\Config\Source\Enabledisable</source_model>
                <comment><![CDATA[Please switch 'Current Configuration Scope' to a necessary store view to select affected countries.]]></comment>
            </field>
            <field id="affected_countries" translate="label comment" type="multiselect" sortOrder="20" showInDefault="0" showInWebsite="1" showInStore="1">
                <label>Affected Countries</label>
                <source_model>Magento\Directory\Model\Config\Source\Country</source_model>
            </field>
        </group>
        <group id="country_url" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Country to URL Redirect</label>
            <field id="enable_url" translate="label comment" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Enable Country --> URL</label>
                <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            </field>
            <field id="url_mapping" type="select" translate="label comment" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Country to URL Mapping</label>
                <frontend_model>FiloBlu\Refilo\Block\Adminhtml\System\Config\Form\Field\CountryUrl</frontend_model>
                <backend_model>FiloBlu\Refilo\Model\Config\Backend\Url</backend_model>
            </field>
        </group>
    </section>
</include>
