<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="refilo" translate="label" sortOrder="10">
            <label>Refilo</label>
        </tab>
        <include path="FiloBlu_Refilo::system/general.xml"/>
        <include path="FiloBlu_Refilo::system/social.xml"/>
        <include path="FiloBlu_Refilo::system/newsletter.xml"/>
        <include path="FiloBlu_Refilo::system/catalog.xml"/>
        <include path="FiloBlu_Refilo::system/content.xml"/>
        <include path="FiloBlu_Refilo::system/notifications.xml"/>
        <include path="FiloBlu_Refilo::system/geoip.xml"/>
        <include path="FiloBlu_Refilo::system/marketing.xml"/>
        <include path="FiloBlu_Refilo::system/sales.xml"/>
        <include path="FiloBlu_Refilo::system/customer.xml"/>
        <include path="FiloBlu_Refilo::system/mongo.xml"/>
        <include path="FiloBlu_Refilo::system/elasticsearch.xml"/>
        <include path="FiloBlu_Refilo::system/sync.xml"/>
        <include path="FiloBlu_Refilo::system/maintenance.xml"/>
        <include path="FiloBlu_Refilo::system/recaptcha.xml"/>
        <include path="FiloBlu_Refilo::system/search.xml"/>
        <include path="FiloBlu_Refilo::system/security.xml"/>
        <include path="FiloBlu_Refilo::system/customer_care.xml"/>
        <include path="FiloBlu_Refilo::system/mageworx.xml"/>
        <include path="FiloBlu_Refilo::system/canonical_url.xml"/>

        <section id="web">
            <group id="refilo_cdn" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Refilo CDN</label>
                <field id="refilo_storefront_cdn_url" translate="label comment" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Refilo Storefront CDN URL</label>
                    <validate>validate-url no-whitespace</validate>
                </field>
            </group>
            <group id="url">
                <field id="refilo_use_store_in_storefront" translate="label comment" type="select" sortOrder="10" showInStore="1" showInWebsite="1" showInDefault="1">
                    <label>Add Store Code to Store Front Urls</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
            </group>
            <group id="unsecure">
                <field id="refilo_storefront_unsecure_base_url" translate="label comment" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Refilo Storefront Unsecure Base URL</label>
                    <validate>validate-url no-whitespace</validate>
                </field>
            </group>
            <group id="secure">
                <field id="refilo_storefront_secure_base_url" translate="label comment" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Refilo Storefront Secure Base URL</label>
                    <validate>validate-url no-whitespace</validate>
                </field>
            </group>
        </section>
        <section id="general">
            <group id="restriction">
                <field id="disable_visibility_on_storefront" translate="label comment" sortOrder="1" type="select" showInStore="1" showInWebsite="1" showInDefault="1">
                    <label>Disable Website Visibility on Storefront</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <comment><![CDATA[Disable website visibility on storefront]]></comment>
                </field>
                <field id="allowed_path" translate="label comment" sortOrder="60" type="textarea" showInStore="1" showInWebsite="1" showInDefault="1">
                    <label>Allowed Paths</label>
                    <comment><![CDATA[Each Path on a separate line.]]></comment>
                </field>
            </group>
        </section>
        <section id="catalog">
            <group id="product" translate="label" type="text" sortOrder="900" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Catalog Product</label>
                <field id="enable_product_redirect_observer" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Enable product redirect to first father available (if none is available, redirect to home)</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="excluded_categories" translate="label" type="multiselect" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Insert which categories id exclude during the redirect</label>
                    <source_model>FiloBlu\Refilo\Model\Config\Source\Category</source_model>
                    <depends>
                        <field id="enable_product_redirect_observer">1</field>
                    </depends>
                </field>
            </group>
        </section>
    </system>
</config>
