2

I am facing this error due to custom field-set on the category form. Those attributes are related to the Affirm Payment. Error i am getting,

"1 exception(s): Exception #0 (Magento\Framework\Exception\LocalizedException): The "componentType" configuration parameter is required for the "custom" component.

Exception #0 (Magento\Framework\Exception\LocalizedException): The "componentType" configuration parameter is required for the "custom" component."

Please check below screenshot, Those are affirm attributes. enter image description here

Attributes works fine, i am getting error only when i click on the Schedule New Update button from category edit page. Please check below screenshot for the code and error. This is the button where i click for the schedule, enter image description here

category_form.xml file code for the Affirm Payment method. enter image description here

The error i am getting while click on the schedule button. enter image description here

2
  • 1
    I am having this exact same issue. Have you found a solution for it?
    – cjochum
    Commented May 3, 2023 at 14:28
  • 1
    @cjochum i just posted the code. Please check and let me know if it won't work. Please upvote if it works fine for you. Thanks!!! Commented May 3, 2023 at 14:57

1 Answer 1

3

After researching for long time, I found the solution by overriding the module. Please check the below code,

create module.xml file on app\code\Vendorname\Affirm\etc

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendorname_Affirm" setup_version="1.0.0">
        <sequence>
            <module name="Astound_Affirm"/>
        </sequence>
    </module>
</config>

create catalogstaging_category_update_form.xml on this path, app\code\Vendorname\Affirm\view\adminhtml\ui_component

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="custom">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Custom</item>
                <item name="collapsible" xsi:type="boolean">true</item>
                <item name="sortOrder" xsi:type="number">100</item>
            </item>
        </argument>
        <field name="affirm_category_mfp">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">1</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="label" xsi:type="string" translate="true">Multiple Financing Program value</item>
                </item>
            </argument>
        </field>
        <field name="affirm_category_mfp_type">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Astound\Affirm\Model\Entity\Attribute\Source\FinancingProgramType</item>
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">2</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="label" xsi:type="string" translate="true">Multiple Financing Program type</item>
                </item>
            </argument>
        </field>
        <field name="affirm_category_mfp_priority">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">3</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="label" xsi:type="string" translate="true">Multiple Financing Program priority</item>
                </item>
            </argument>
        </field>
        <field name="affirm_category_mfp_start_date">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">4</item>
                    <item name="dataType" xsi:type="string">datetime</item>
                    <item name="formElement" xsi:type="string">date</item>
                    <item name="label" xsi:type="string" translate="true">Start date for time based Financing Program value</item>
                </item>
            </argument>
        </field>
        <field name="affirm_category_mfp_end_date">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">5</item>
                    <item name="dataType" xsi:type="string">datetime</item>
                    <item name="formElement" xsi:type="string">date</item>
                    <item name="label" xsi:type="string" translate="true">End date for time based Financing Program value</item>
                </item>
            </argument>
        </field>
        <field name="affirm_category_promo_id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">6</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="label" xsi:type="string" translate="true">Affirm Promo ID</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

Please create a custom module and put this code in respective files. Please let me know if this code does not works.

Thanks,

1
  • 1
    Thank you! That was super helpful.
    – cjochum
    Commented May 3, 2023 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.