File tree 3 files changed +17
-7
lines changed
view/frontend/web/js/in-context 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,8 @@ public function getConfig(string $page): array
67
67
'locale ' => $ this ->localeResolver ->getLocale (),
68
68
'allowedFunding ' => $ this ->getAllowedFunding ($ page ),
69
69
'disallowedFunding ' => $ this ->getDisallowedFunding (),
70
- 'styles ' => $ this ->getButtonStyles ($ page )
70
+ 'styles ' => $ this ->getButtonStyles ($ page ),
71
+ 'isVisibleOnProductPage ' => (int )$ this ->config ->getValue ('visible_on_product ' )
71
72
];
72
73
}
73
74
Original file line number Diff line number Diff line change 31
31
'shape ' => 'pillow ' ,
32
32
'label ' => 'installment ' ,
33
33
'installmentperiod ' => 0
34
- ]
34
+ ],
35
+ 'isVisibleOnProductPage ' => 0
35
36
]
36
37
],
37
38
'checkout ' => [
59
60
'shape ' => 'pillow ' ,
60
61
'label ' => 'installment ' ,
61
62
'installmentperiod ' => 0
62
- ]
63
+ ],
64
+ 'isVisibleOnProductPage ' => 0
63
65
]
64
66
],
65
67
'mini_cart ' => [
86
88
'color ' => 'gold ' ,
87
89
'shape ' => 'rect ' ,
88
90
'label ' => 'paypal '
89
- ]
91
+ ],
92
+ 'isVisibleOnProductPage ' => 0
90
93
]
91
94
],
92
95
'mini_cart ' => [
113
116
'color ' => 'gold ' ,
114
117
'shape ' => 'rect ' ,
115
118
'label ' => 'paypal '
116
- ]
119
+ ],
120
+ 'isVisibleOnProductPage ' => 0
117
121
]
118
122
],
119
123
'product ' => [
140
144
'color ' => 'gold ' ,
141
145
'shape ' => 'rect ' ,
142
146
'label ' => 'paypal ' ,
143
- ]
147
+ ],
148
+ 'isVisibleOnProductPage ' => 0
144
149
]
145
150
]
146
151
];
Original file line number Diff line number Diff line change @@ -24,7 +24,11 @@ define([
24
24
customer = customerData . get ( 'customer' ) ;
25
25
26
26
this . _super ( ) ;
27
- this . renderPayPalButtons ( element ) ;
27
+
28
+ if ( config . clientConfig . isVisibleOnProductPage ) {
29
+ this . renderPayPalButtons ( element ) ;
30
+ }
31
+
28
32
this . declinePayment = ! customer ( ) . firstname && ! cart ( ) . isGuestCheckoutAllowed ;
29
33
30
34
return this ;
You can’t perform that action at this time.
0 commit comments