We are working on a project for a client and are using for them Magento 2.1 in Magento Cloud.
The issue we have detected is regarding the totalsData object. As it seem it does not include the shipping cost of the chosen shipping method.
steps to reproduce:
When looking at the totalsData information, it does not include the shipping cost.
window.checkoutConfig.totalsData.grand_total
See attachment.
When reloading the page though this information gets updated and the shipping cost is being included.
Though reloading the page at this stage has some side effects, like losing the billing address details.
The information of the totalsData is being used for payment calls and creates an issue as the total of the orders, in the totalsData does not match the actual total for which a payment authorization is being requested.
This information might also be used for tracking or analytics.
Magento 2.1 cloud edition.
See above
What we need to see is that the totalsData gets update with the total amount, including shipping cost prior to doing a payments call.
We see that the shipping cost is not included in the totalsData, after choosing the shipping method and selecting the payment option.
@delgadito13 window.checkoutConfig.totalsData is dataset for initializing JS components. Its data is actual on page loading moment only. If you reload page you'll see actual info there.
Dynamically updated totals are stored in totals property of code/Magento/Checkout/view/frontend/web/js/model/quote.js component. To work with it please use getTotals() and setTotals() methods.
Usage examples in code/Magento/Checkout/view/frontend/web/js/view/summary/grand-total.js. Please, pay attention to double pair of brackets: quote.getTotals()(). If you leave only one pair of brackets[quote.getTotals()], you'll receive an observable object, but not the value.
Closing as far as no questions for several days.
Still have this problem
Old bug, 3 years later and continues the same bug. It is one bug of checkoutConfig, has many and many bugs... Try to give a discount and you see all collapse.
We cant make payment using checkoutConfig js, its terrible. We have to leave the checkout page to make a payment using only php. So, if the credit card does not work you have to make all the payment again....We have to trust customer patience.
Most helpful comment
Still have this problem