can any one know that i want to update the price of the checkout page order summary Cart subtotal line.
how can i do that ?
knowckout file is render is
subtotal.html :
<tr class="totals">
<th class="mark" scope="row" data-bind="text: title"></th>
<td class="amount">
<span class="price" data-bind ="text: getValue(), attr:{'data-label': title}"></span>
<!-- ko foreach: elems() -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->
</td>
</tr>
and it will render from
checkout_index_index.xml :
<item name="subtotal" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/subtotal</item>
<item name="config" xsi:type="array">
<item name="title" xsi:type="string" translate="true">Cart Subtotal</item>
</item>
</item>
please let me know if any one knows about this
thanks
Best Answer
If you want to overwrite a render of the price itself (e.g.
3.55 $
) take a look intogetFormattedPrice()
method of the total.as you can see it uses a
priceUtils.formatPrice
which is locate in theand having next content:
So you can totally overwrite the method
getFormattedPrice
in own component which should replace original one, or you can change thequote.getPriceFormat()
to a desired one, or you can write own logic inside the overwritten total component.