Skip to content

Commit 977d18d

Browse files
committed
Add back extension point for adding some html to the category page magento#29286
1 parent f3a160c commit 977d18d

File tree

1 file changed

+9
-2
lines changed
  • app/code/Magento/Paypal/view/frontend/web/js/in-context

1 file changed

+9
-2
lines changed

app/code/Magento/Paypal/view/frontend/web/js/in-context/button.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,18 @@ define([
1818
/** @inheritdoc */
1919
initialize: function (config, element) {
2020
var cart = customerData.get('cart'),
21-
customer = customerData.get('customer');
21+
customer = customerData.get('customer'),
22+
updateDeclinePayment = function () {
23+
this.declinePayment = !customer().firstname && !cart().isGuestCheckoutAllowed;
24+
}.bind(this);
2225

2326
this._super();
2427
this.renderPayPalButtons(element);
25-
this.declinePayment = !customer().firstname && !cart().isGuestCheckoutAllowed;
28+
29+
updateDeclinePayment();
30+
31+
cart.subscribe(updateDeclinePayment);
32+
customer.subscribe(updateDeclinePayment);
2633

2734
return this;
2835
},

0 commit comments

Comments
 (0)