Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var config = {
- config: {
- mixins: {
- 'Magento_Checkout/js/view/summary/abstract-total': {
- 'Vendor_Modulename/js/view/summary/abstract-total-mixin': true
- },
- 'Magento_Checkout/js/view/summary/shipping': {
- 'Vendor_Modulename/js/view/summary/shipping-mixin': true
- },
- }
- }};
- define(
- [
- 'uiComponent',
- 'Magento_Checkout/js/model/step-navigator'
- ],
- function (Component, stepNavigator) {
- "use strict";
- return function (abstractTotal) {
- return abstractTotal.extend({
- isFullMode: function() {
- if (!this.getTotals() || stepNavigator.getActiveItemIndex() === 1) {
- return false;
- }
- return true; //add this line to display forcefully summary in shipping step.
- }
- });
- }
- });
- define([
- 'jquery',
- 'Magento_Checkout/js/view/summary/abstract-total',
- 'Magento_Checkout/js/model/quote'
- ], function ($, Component, quote) {
- 'use strict';
- return function (shipping) {
- return shipping.extend({
- getValue: function () {
- var price;
- if (!this.isCalculated()) {
- return this.notCalculatedMessage;
- }
- //var price = this.totals().shipping_amount; //comment this line
- var shippingMethod = quote.shippingMethod(); //add these both line
- var price = shippingMethod.amount; // update data on change of the shipping method
- return this.getFormattedPrice(price);
- }
- });
- }});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement