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

Commit

Permalink
Merge pull request #5 from PayEx/1.0.1-rc
Browse files Browse the repository at this point in the history
1.0.1 rc
  • Loading branch information
asbjornu authored Aug 14, 2019
2 parents b181ce7 + 5870bbf commit 433f775
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "payex/magento2-checkin",
"type": "magento2-module",
"version": "1.0.0",
"version": "1.0.1",
"description": "PayEx Checkin module for Magento 2",
"license": "Apache-2.0",
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="PayEx_Checkin" setup_version="1.0.0">
<module name="PayEx_Checkin" setup_version="1.0.1">
<sequence>
<module name="PayEx_Client" />
</sequence>
Expand Down
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 433f775

Please sign in to comment.