cancel
Showing results for 
Search instead for 
Did you mean: 

Where are the functions which get the subtotal, shipping, tax and order total values?

Where are the functions which get the subtotal, shipping, tax and order total values?

Hello,

 

It's about Magento 2.3. Where are functions which get the totals from the checkout page, summary section?

 

For example, I found the .html files for this which such as grand-total.html, with the following code, but where is the function exactly? From where it tries to get the value (getValue())? 

 

<!-- ko if: isDisplayed() -->
<tr class="grand totals">
<td class="mark" scope="row">
<strong data-bind="i18n: title"></strong>
</td>
<td class="amount" data-bind="attr: {'data-th': $t(title)}">
<strong><span class="price" data-bind="text: getValue()"></span></strong>
<!-- ko foreach: elems() -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->
</td>
</tr>
<!-- /ko -->
1 REPLY 1

Re: Where are the functions which get the subtotal, shipping, tax and order total values?

You can get the function of getValue() from JS file.

Your location would be from Checkout Module,

 

vendor/magento/module-checkout/view/frontend/web/js/view/summary/grand-total.js

getValue: function () {
            return this.getFormattedPrice(this.getPureValue());
        }
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial