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– Dev2016年11月15日 11:32:58 +00:00Commented Nov 15, 2016 at 11:32
-
@Dev yes, I want to update Summary (right section), because it not show updated value.Dhiren Vasoya– Dhiren Vasoya2016年11月15日 11:53:56 +00:00Commented Nov 15, 2016 at 11:53
-
@DhirenVasoya: Are you able to solve this issue, sir?? I am also facing a similar issue.Zammuuz– Zammuuz2017年08月04日 04:58:26 +00:00Commented Aug 4, 2017 at 4:58
1 Answer 1
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– Dhiren Vasoya2016年11月15日 12:17:06 +00:00Commented 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/…Dev– Dev2016年11月15日 12:33:16 +00:00Commented Nov 15, 2016 at 12:33