4

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.

asked Nov 15, 2016 at 10:59
3
  • You want to update Order Summary (right section) or on payment option? Commented Nov 15, 2016 at 11:32
  • @Dev yes, I want to update Summary (right section), because it not show updated value. Commented Nov 15, 2016 at 11:53
  • @DhirenVasoya: Are you able to solve this issue, sir?? I am also facing a similar issue. Commented Aug 4, 2017 at 4:58

1 Answer 1

3

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.

answered Nov 15, 2016 at 12:08
2
  • 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. Commented Nov 15, 2016 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/… Commented Nov 15, 2016 at 12:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.