2

I want to add a text box on the total credit memo. I can input amount to refund.

I am trying to add my block in creditmemo_totals

What i tried is add code in

Company/Custom/view/adminhtml/layout/sales_order_creditmemo_new.xml

    <body>
        <referenceBlock name="creditmemo_totals">
            <block class="Company\Custom\Block\Adminhtml\Sales\Order\Creditmemo\Totals" name="Company_fee" template="Company_Custom::creditmemo/companyfee.phtml"/>
        </referenceBlock>
    </body>

What i want to do is add custom fee total box in refund total box like this

enter image description here

1 Answer 1

3

To add fee box in refund total block we need to remove adjustments block using

<referenceBlock name="adjustments" remove="true"/>

and then add your block in creditmemo_totals reference

Company/Custom/view/adminhtml/layout/sales_order_creditmemo_new.xml

<body>
    <referenceBlock name="adjustments" remove="true"/>
    <referenceBlock name="creditmemo_totals">
        <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Adjustments" name="Company_fee" template="Company_Custom::creditmemo/ktplfee.phtml"/>
    </referenceBlock>
</body>

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.