Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.

Commit

Permalink
Fix for checkin module to be able to disable it and still be able to …
Browse files Browse the repository at this point in the history
…check out
  • Loading branch information
samtroll committed Aug 12, 2019
1 parent b181ce7 commit 2c6131b
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions view/frontend/web/js/view/checkin.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ define([

var PayEx = window.payex,
onConsumerIdentifiedDelay = ko.observable(false),
isEnabled = ko.observable(false),
isVisible = ko.observable(false),
isShippingSectionVisible = ko.observable(false),
isRequired = ko.observable(false),
Expand All @@ -34,6 +35,7 @@ define([
billingDetails: ko.observable({})
}
},
isEnabled: isEnabled,
isVisible: isVisible,
isShippingSectionVisible: isShippingSectionVisible,
isRequired: isRequired,
Expand All @@ -50,12 +52,15 @@ define([
Object.assign(self.config.data, window.checkoutConfig.PayEx_Checkin);
self.config.isCheckout = config.isCheckout;

self.isEnabled((this.config.data.isEnabled == true));
self.isRequired((this.config.data.isRequired == true));

stepNavigator.steps.subscribe(function(section){
stepNavigator.hideSection('shipping');
isShippingSectionVisible(false);
});
if(self.isEnabled) {
stepNavigator.steps.subscribe(function (section) {
stepNavigator.hideSection('shipping');
isShippingSectionVisible(false);
});
}

} else {
Object.assign(self.config, config);
Expand All @@ -65,8 +70,10 @@ define([
self.proceedAsGuest();
};

// Make request to get consumer info if user logged in through checkin in current session
self.checkIsCheckedIn();
if(self.isEnabled) {
// Make request to get consumer info if user logged in through checkin in current session
self.checkIsCheckedIn();
}
},
checkIsCheckedIn: function(){
var self = this;
Expand Down Expand Up @@ -278,4 +285,4 @@ define([
}
}
});
});
});

0 comments on commit 2c6131b

Please sign in to comment.