Skip to content

Commit e191462

Browse files
author
Ievgen Sentiabov
committed
MAGETWO-44663: Braintree PayPal Check Out button should not be displayed on product page
- Removed Braintree shortcut from product page view
1 parent dc3aee6 commit e191462

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/code/Magento/Braintree/Observer/AddPaypalShortcuts.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ public function __construct(
4242
*/
4343
public function execute(\Magento\Framework\Event\Observer $observer)
4444
{
45+
$isMiniCart = !$observer->getEvent()->getIsCatalogProduct();
46+
4547
//Don't display shortcut on product view page
4648
if (!$this->methodPayPal->isActive() ||
47-
!$this->paypalConfig->isShortcutCheckoutEnabled()) {
49+
!$this->paypalConfig->isShortcutCheckoutEnabled() ||
50+
!$isMiniCart) {
4851
return;
4952
}
5053

@@ -57,7 +60,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
5760
'',
5861
[
5962
'data' => [
60-
Shortcut::MINI_CART_FLAG_KEY => !$observer->getEvent()->getIsCatalogProduct()
63+
Shortcut::MINI_CART_FLAG_KEY => $isMiniCart
6164
]
6265
]
6366
);

app/code/Magento/Braintree/view/frontend/templates/PayPal/shortcut.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $paymentId = $block->getPaymentMethodNonceId();
1212
$detailsId = $block->getPaymentDetailsId();
1313
$isMiniCart = (bool)(int)$block->isInMiniCart();
1414

15-
$widgetName = $isMiniCart ? 'braintreePayPalMinicart' : 'braintreePayPal';
15+
$widgetName = 'braintreePayPalMinicart';
1616

1717
$config = [
1818
$widgetName => [

0 commit comments

Comments
 (0)