3

I already look into this : how to add fee to order totals in magento2

I need to added additional fee based on shipping address, So I used this plugin

<type name="Magento\Checkout\Model\ShippingInformationManagement">
        <plugin name="get_shipping_info" type="Company\Vendor\Plugin\Checkout\Model\ShippingInformationManagement" sortOrder="1" disabled="false"/>
    </type>

It sucessfully work and update value of fee in "quote" table in database.

But it not update fee value in checkout summary block. enter image description here

How can I update this summary block, So it get updated value from database. How can I update block on selection of any payment method selection or any other way.

  • You want to update Order Summary (right section) or on payment option? – Dev Nov 15 '16 at 11:32
  • @Dev yes, I want to update Summary (right section), because it not show updated value. – Dhiren Vasoya Nov 15 '16 at 11:53
  • @DhirenVasoya: Are you able to solve this issue, sir?? I am also facing a similar issue. – Zammuuz Aug 4 '17 at 4:58
2

Summary section created on checkout-module. You can change checkout_index_index.xml, add item as 'quote' & create js for
Magento_Checkout/js/view/summary/quote

Path - \vendor\magento\module-checkout\view\frontend\layout\checkout_index_index.xml

<item name="quote" xsi:type="array">
    <item name="component"  xsi:type="string">Magento_Checkout/js/view/summary/quote</item>
    <item name="config" xsi:type="array">
        <item name="title" xsi:type="string" translate="true">Quote</item>
    </item>
</item>

\vendor\magento\module-checkout\view\frontend\web\js\view\summary

Also create template file in below path. vendor\magento\module-checkout\view\frontend\web\template\summary

You can override this file on you custom extension or update core files (Not recommended). This might not be exact answer but might be workaround to you. Hope this help you.

  • this is not what I am asking, I need to just update summary block when payment section avilable, because it not show updated value from database. My field already avilable there. – Dhiren Vasoya Nov 15 '16 at 12:17
  • Sorry for that. You should use Knockout js . Unfortunately, I don't have much idea about knockout js. Hope this link will help you. magento.stackexchange.com/questions/140994/… – Dev Nov 15 '16 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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