Skip to content

Override a Vendor’s module di.xml : add an argument

I have in some Vendor’s Module di.xml file this entry :

<type name="AmastyRequestQuoteModelPdfPdfInformation">
    <arguments>
        <argument name="variables" xsi:type="array">
            <item name="0" xsi:type="array">
                <item name="objectType" xsi:type="string">quote</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::USERNAME</item>
                <item name="method" xsi:type="string">getCustomerName</item>
            </item>
            <item name="1" xsi:type="array">
                <item name="objectType" xsi:type="string">custom</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::CUSTOMER_STREET</item>
                <item name="method" xsi:type="string">getBillingStreet</item>
            </item>
            <item name="2" xsi:type="array">
                <item name="objectType" xsi:type="string">billing</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::CUSTOMER_CITY</item>
                <item name="method" xsi:type="string">getCity</item>
            </item>
            <item name="3" xsi:type="array">
                <item name="objectType" xsi:type="string">custom</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::CUSTOMER_REGION</item>
                <item name="method" xsi:type="string">getBillingRegion</item>
            </item>
            <item name="4" xsi:type="array">
                <item name="objectType" xsi:type="string">billing</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::CUSTOMER_POSTCODE</item>
                <item name="method" xsi:type="string">getPostcode</item>
            </item>
            <item name="5" xsi:type="array">
                <item name="objectType" xsi:type="string">custom</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::CUSTOMER_COUNTRY</item>
                <item name="method" xsi:type="string">getBillingCountryName</item>
            </item>
            <item name="6" xsi:type="array">
                <item name="objectType" xsi:type="string">billing</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::CUSTOMER_TELEPHONE</item>
                <item name="method" xsi:type="string">getTelephone</item>
            </item>
            <item name="7" xsi:type="array">
                <item name="objectType" xsi:type="string">quote</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::QUOTE_NUMBER</item>
                <item name="method" xsi:type="string">getIncrementId</item>
            </item>
            <item name="8" xsi:type="array">
                <item name="objectType" xsi:type="string">quote</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::QUOTE_STATUS</item>
                <item name="method" xsi:type="string">getStatusLabel</item>
            </item>
            <item name="9" xsi:type="array">
                <item name="objectType" xsi:type="string">quote</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::QUOTE_DATE</item>
                <item name="method" xsi:type="string">getCreatedAt</item>
            </item>
            <item name="10" xsi:type="array">
                <item name="objectType" xsi:type="string">quote</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::QUOTE_EXPIRY_DATE</item>
                <item name="method" xsi:type="string">getExpiredDate</item>
            </item>
            <item name="11" xsi:type="array">
                <item name="objectType" xsi:type="string">custom</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::SHIPPING_STREET</item>
                <item name="method" xsi:type="string">getShippingStreet</item>
            </item>
            <item name="12" xsi:type="array">
                <item name="objectType" xsi:type="string">shipping</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::SHIPPING_CITY</item>
                <item name="method" xsi:type="string">getCity</item>
            </item>
            <item name="13" xsi:type="array">
                <item name="objectType" xsi:type="string">custom</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::SHIPPING_REGION</item>
                <item name="method" xsi:type="string">getShippingRegion</item>
            </item>
            <item name="14" xsi:type="array">
                <item name="objectType" xsi:type="string">shipping</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::SHIPPING_POSTCODE</item>
                <item name="method" xsi:type="string">getPostcode</item>
            </item>
            <item name="15" xsi:type="array">
                <item name="objectType" xsi:type="string">custom</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::SHIPPING_COUNTRY</item>
                <item name="method" xsi:type="string">getShippingCountryName</item>
            </item>
            <item name="16" xsi:type="array">
                <item name="objectType" xsi:type="string">custom</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::SHIPPING_TELEPHONE</item>
                <item name="method" xsi:type="string">getTelephone</item>
            </item>
            <item name="17" xsi:type="array">
                <item name="objectType" xsi:type="string">custom</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::SHIPPING_METHOD</item>
                <item name="method" xsi:type="string">getShippingMethod</item>
            </item>
            <item name="18" xsi:type="array">
                <item name="objectType" xsi:type="string">custom</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::PRODUCT_GRID</item>
                <item name="method" xsi:type="string">getProductGrid</item>
            </item>
            <item name="19" xsi:type="array">
                <item name="objectType" xsi:type="string">custom</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::STORE_PHONE</item>
                <item name="method" xsi:type="string">getStorePhone</item>
            </item>
            <item name="20" xsi:type="array">
                <item name="objectType" xsi:type="string">custom</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::HAS_SHIPPING_INFO</item>
                <item name="method" xsi:type="string">hasShippingInfo</item>
            </item>
            
        </argument>
    </arguments>
</type>

I would like to add in this another argument like

<item name="21" xsi:type="array">
                <item name="objectType" xsi:type="string">custom</item>
                <item name="variable" xsi:type="const">AmastyRequestQuoteModelSourcePdfVariables::QUOTE_REMARKS</item>
                <item name="method" xsi:type="string">getComments</item>
            </item>

I was able to ovveride the Model (with preferences in my own custom module di.xml), but how should I edit the original parameters ?

Thanks