File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
app/code/Magento/Braintree
view/frontend/templates/PayPal Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,12 @@ public function __construct(
42
42
*/
43
43
public function execute (\Magento \Framework \Event \Observer $ observer )
44
44
{
45
+ $ isMiniCart = !$ observer ->getEvent ()->getIsCatalogProduct ();
46
+
45
47
//Don't display shortcut on product view page
46
48
if (!$ this ->methodPayPal ->isActive () ||
47
- !$ this ->paypalConfig ->isShortcutCheckoutEnabled ()) {
49
+ !$ this ->paypalConfig ->isShortcutCheckoutEnabled () ||
50
+ !$ isMiniCart ) {
48
51
return ;
49
52
}
50
53
@@ -57,7 +60,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
57
60
'' ,
58
61
[
59
62
'data ' => [
60
- Shortcut::MINI_CART_FLAG_KEY => ! $ observer -> getEvent ()-> getIsCatalogProduct ()
63
+ Shortcut::MINI_CART_FLAG_KEY => $ isMiniCart
61
64
]
62
65
]
63
66
);
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ $paymentId = $block->getPaymentMethodNonceId();
12
12
$ detailsId = $ block ->getPaymentDetailsId ();
13
13
$ isMiniCart = (bool )(int )$ block ->isInMiniCart ();
14
14
15
- $ widgetName = $ isMiniCart ? 'braintreePayPalMinicart ' : ' braintreePayPal ' ;
15
+ $ widgetName = 'braintreePayPalMinicart ' ;
16
16
17
17
$ config = [
18
18
$ widgetName => [
You can’t perform that action at this time.
0 commit comments