EmicoEcommerce/Magento2TweakwiseExport

View on GitHub
etc/adminhtml/system.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0"?>
<!--
/**
 * Tweakwise (https://www.tweakwise.com/) - All Rights Reserved
 *
 * @copyright Copyright (c) 2017-2022 Tweakwise.com B.V. (https://www.tweakwise.com)
 * @license   http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <section id="tweakwise" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Tweakwise</label>
            <tab>catalog</tab>
            <resource>Tweakwise_Magento2TweakwiseExport::config</resource>
            <group id="export" translate="label" type="text" sortOrder="1000" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Export</label>
                <comment>Tweakwise Export version v7.0.0</comment>
                <field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Enabled</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="store_level_export_enabled" translate="label" type="select" sortOrder="2" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Store Level Export</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>

                <field id="feed_key" translate="label,comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Key</label>
                    <comment>Export url will be: www.example.com/tweakwise/feed/export/key/XXXX. If Store Level Export enabled, add /store/{store_code} to the store url/</comment>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>
                <field id="allow_cache_flush" translate="label,comment" type="select" sortOrder="21" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Allow cache flush</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <comment>Allows for automated cache flush, this task can be configured in navigator and should run after the publish task. Cache flush url will be: www.example.com/tweakwise/cache/flush/key/XXXX as defined above</comment>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>
                <field id="validate" translate="label,comment" type="select" sortOrder="22" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Validate</label>
                    <comment>Validate export on product, category and product -> category link count. If validate fails export will be rollback.</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>
                <field id="archive" translate="label,comment" type="text" sortOrder="25" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Archive</label>
                    <comment>Number of feeds to keep in archive.</comment>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                    <validate>validate-number validate-greater-than-zero</validate>
                </field>
                <field id="real_time" translate="label,comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Export in Real Time</label>
                    <comment>When feed is requested it will always be exported in real time.</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <depends>
                        <field id="enabled">1</field>
                        <field id="validate">0</field>
                    </depends>
                </field>
                <field id="api_import_url" translate="label,comment" type="text" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Tweakwise Import API Url</label>
                    <comment>API trigger url to trigger an import in tweakwise. See Tweakwise import task tab API. Starts with the API url like: https://navigator-api.tweakwise.com/task/trigger/.
                        Only change this on an store level if store level export is enabled</comment>
                    <validate>validate-url</validate>
                    <depends>
                        <field id="enabled">1</field>
                        <field id="real_time">0</field>
                    </depends>
                </field>

                <field id="out_of_stock_children" translate="label,comment" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Export out of stock combined product children</label>
                    <comment>Would you like to export out of stock children attributes in parent products?</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>
                <field id="exclude_child_attributes" translate="label,comment" type="multiselect" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Exclude child attributes</label>
                    <comment>Attributes which should not be combined in parent.</comment>
                    <source_model>Tweakwise\Magento2TweakwiseExport\Model\Config\Source\ProductAttributes</source_model>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>

                <field id="price_field" translate="label,comment" type="select" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Price field</label>
                    <comment>Select which field is used as "price" in Tweakwise, selection will select each price field in order and return the first nonzero value. Prices are exported from price index table, note that catalogrule prices are available in field "min_price" so it could be that this value is lowed then for example "final_price". If your configurable / bundle products do not have a price attribute filled this will be zero.</comment>
                    <source_model>Tweakwise\Magento2TweakwiseExport\Model\Config\Source\PriceField</source_model>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>

                <field id="batch_size_categories"
                       translate="batch size for categories"
                       type="text"
                       sortOrder="110"
                       showInDefault="1"
                       showInWebsite="0"
                       showInStore="0"
                >
                    <label>Batch size categories</label>
                    <comment>
                        Set the batch size for categories during export.
                        If memory is less important than speed lower the batch size.
                        If note, increase the batch size.
                    </comment>
                </field>

                <field id="batch_size_products"
                       translate="batch size for products"
                       type="text"
                       sortOrder="120"
                       showInDefault="1"
                       showInWebsite="0"
                       showInStore="0"
                >
                    <label>Batch size products</label>
                    <comment>
                        Set the batch size for products during export.
                        If memory is less important than speed lower the batch size.
                        If note, increase the batch size.
                    </comment>
                </field>

                <field id="batch_size_products_children"
                       translate="batch size for products children"
                       type="text"
                       sortOrder="130"
                       showInDefault="1"
                       showInWebsite="0"
                       showInStore="0"
                >
                    <label>Batch size products children</label>
                    <comment>
                        Set the batch size for products children during export.
                        If memory is less important than speed lower the batch size.
                        If note, increase the batch size.
                    </comment>
                </field>

                <field id="schedule" translate="label" type="text" sortOrder="140" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Schedule full export</label>
                    <comment>Leave empty to disable export by cron.</comment>
                    <depends>
                        <field id="enabled">1</field>
                        <field id="real_time">0</field>
                    </depends>
                </field>
                <field id="export_state" translate="label,comment" type="label" sortOrder="150" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>State</label>
                    <frontend_model>Tweakwise\Magento2TweakwiseExport\Block\Config\Form\Field\ExportState</frontend_model>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>
                <field id="start" translate="label,comment" type="label" sortOrder="160" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Schedule exports</label>
                    <frontend_model>Tweakwise\Magento2TweakwiseExport\Block\Config\Form\Field\ExportStart</frontend_model>
                    <comment>Start exports on next cron run</comment>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>
            </group>

            <group id="export_stock" translate="label" type="text" sortOrder="2000" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Export stock</label>
                <comment>
                    <![CDATA[
                        Export url will be: www.example.com/tweakwise/feed/export/key/XXXX/type/stock.
                        If Store Level Export enabled, add /store/{store_code} to the store url.
                        ]]>
                </comment>
                <field id="schedule" translate="label" type="text" sortOrder="201" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Schedule stock export</label>
                    <comment>Leave empty to disable export by cron.</comment>
                    <depends>
                        <field id="enabled">1</field>
                        <field id="real_time">0</field>
                    </depends>
                </field>
                <field id="stock_export_state" translate="label,comment" type="label" sortOrder="202" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>State</label>
                    <frontend_model>Tweakwise\Magento2TweakwiseExport\Block\Config\Form\Field\ExportStateStock</frontend_model>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>
                <field id="start_stock" translate="label,comment" type="label" sortOrder="203" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Schedule stock export</label>
                    <frontend_model>Tweakwise\Magento2TweakwiseExport\Block\Config\Form\Field\ExportStockStart</frontend_model>
                    <comment>Start exports on next cron run</comment>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>
                <field id="api_import_url_stock" translate="label,comment" type="text" sortOrder="204" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Tweakwise Import API Url for stock feed (external property)</label>
                    <comment>API trigger url to trigger an stock import. Import the stock feed as en external property.</comment>
                    <validate>validate-url</validate>
                    <depends>
                        <field id="enabled">1</field>
                        <field id="real_time">0</field>
                    </depends>
                </field>
            </group>

            <group id="export_price" translate="label" type="text" sortOrder="2000" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Export price</label>
                <comment>
                    <![CDATA[
                        Export url will be: www.example.com/tweakwise/feed/export/key/XXXX/type/price.
                        If Store Level Export enabled, add /store/{store_code} to the store url.
                        ]]>
                </comment>
                <field id="schedule" translate="label" type="text" sortOrder="201" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Schedule price export</label>
                    <comment>Leave empty to disable export by cron.</comment>
                    <depends>
                        <field id="enabled">1</field>
                        <field id="real_time">0</field>
                    </depends>
                </field>
                <field id="price_export_state" translate="label,comment" type="label" sortOrder="202" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>State</label>
                    <frontend_model>Tweakwise\Magento2TweakwiseExport\Block\Config\Form\Field\ExportStatePrice</frontend_model>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>
                <field id="start_price" translate="label,comment" type="label" sortOrder="203" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Schedule price export</label>
                    <frontend_model>Tweakwise\Magento2TweakwiseExport\Block\Config\Form\Field\ExportPriceStart</frontend_model>
                    <comment>Start exports on next cron run</comment>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>
                <field id="api_import_url_price" translate="label,comment" type="text" sortOrder="204" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Tweakwise Import API Url for price feed (external property)</label>
                    <comment>API trigger url to trigger an price import. Import the price feed as en external property.</comment>
                    <validate>validate-url</validate>
                    <depends>
                        <field id="enabled">1</field>
                        <field id="real_time">0</field>
                    </depends>
                </field>
            </group>
        </section>
    </system>
</config>