Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
woutse committed Sep 16, 2024
2 parents 09b47ee + 3a42ddd commit 1115ed8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
10 changes: 8 additions & 2 deletions ViewModel/FastCheckout.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,30 @@ public function __construct(
}

/**
* getVisibility
*
* @return boolean
*/
public function getVisibility()
{
$store = $this->storeManager->getStore();
if ($this->session->isLoggedIn() && $store->getConfig('payment/paynl_payment_ideal/fast_checkout_guest_only') == 1) {
if ($this->session->isLoggedIn() &&
$store->getConfig('payment/paynl_payment_ideal/fast_checkout_guest_only') == 1) {
return false;
}
return true;
}

/**
* minicartEnabled
*
* @return boolean
*/
public function minicartEnabled()
{
$store = $this->storeManager->getStore();
if ($store->getConfig('payment/paynl_payment_ideal/fast_checkout_minicart_enabled') == 1 && $this->getVisibility()) {
if ($store->getConfig('payment/paynl_payment_ideal/fast_checkout_minicart_enabled') == 1
&& $this->getVisibility()) {
return true;
}
return false;
Expand Down
11 changes: 7 additions & 4 deletions view/frontend/web/js/view/payment/method-renderer/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ define(
return true;
},
getCurrentShippingMethod: function () {
if (quote.shippingMethod() === null || quote.shippingMethod() === undefined) {
return;
}
var carrier_code = typeof quote.shippingMethod().carrier_code !== 'undefined' ? quote.shippingMethod().carrier_code + '_' : '';
var method_code = typeof quote.shippingMethod().method_code !== 'undefined' ? quote.shippingMethod().method_code : '';
var currentShippingMethod = carrier_code + method_code;
Expand Down Expand Up @@ -258,7 +261,7 @@ define(
afterPlaceOrder: function () {
window.location.replace(url.build('paynl/checkout/redirect?nocache=' + (new Date().getTime())));
},
getCustomField: function (fieldname) {
getCustomField: function (fieldname) {
var customFields = [];
if (quote.billingAddress.hasOwnProperty('_latestValue') && typeof quote.billingAddress._latestValue !== 'undefined' && quote.billingAddress._latestValue !== null) {
$.each(quote.billingAddress._latestValue.customAttributes, function (i, l) {
Expand All @@ -273,15 +276,15 @@ define(
var cocnumber_val = (this.cocnumber != null && this.cocnumber.length > 0) ? this.cocnumber : this.getCustomField('paynl_coc_number');
var vatnumber_val = (this.vatnumber != null && this.vatnumber.length > 0) ? this.vatnumber : this.getCustomField('paynl_vat_number');

var dob_format = '';
var dob_format = '';

if (dateofbirth_val != null) {
var dob = new Date(dateofbirth_val)
var dd = dob.getDate(), mm = dob.getMonth() + 1, yyyy = dob.getFullYear()
dd = (dd < 10) ? '0' + dd : dd
mm = (mm < 10) ? '0' + mm : mm
dob_format = dd + '-' + mm + '-' + yyyy
}
}

return {
'method': this.item.method,
Expand Down

0 comments on commit 1115ed8

Please sign in to comment.