File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed
view/frontend/web/js/in-context Expand file tree Collapse file tree 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
6767 'locale ' => $ this ->localeResolver ->getLocale (),
6868 'allowedFunding ' => $ this ->getAllowedFunding ($ page ),
6969 'disallowedFunding ' => $ this ->getDisallowedFunding (),
70- 'styles ' => $ this ->getButtonStyles ($ page )
70+ 'styles ' => $ this ->getButtonStyles ($ page ),
71+ 'isVisibleOnProductPage ' => (int )$ this ->config ->getValue ('visible_on_product ' )
7172 ];
7273 }
7374
Original file line number Diff line number Diff line change 3131 'shape ' => 'pillow ' ,
3232 'label ' => 'installment ' ,
3333 'installmentperiod ' => 0
34- ]
34+ ],
35+ 'isVisibleOnProductPage ' => 0
3536 ]
3637 ],
3738 'checkout ' => [
5960 'shape ' => 'pillow ' ,
6061 'label ' => 'installment ' ,
6162 'installmentperiod ' => 0
62- ]
63+ ],
64+ 'isVisibleOnProductPage ' => 0
6365 ]
6466 ],
6567 'mini_cart ' => [
8688 'color ' => 'gold ' ,
8789 'shape ' => 'rect ' ,
8890 'label ' => 'paypal '
89- ]
91+ ],
92+ 'isVisibleOnProductPage ' => 0
9093 ]
9194 ],
9295 'mini_cart ' => [
113116 'color ' => 'gold ' ,
114117 'shape ' => 'rect ' ,
115118 'label ' => 'paypal '
116- ]
119+ ],
120+ 'isVisibleOnProductPage ' => 0
117121 ]
118122 ],
119123 'product ' => [
140144 'color ' => 'gold ' ,
141145 'shape ' => 'rect ' ,
142146 'label ' => 'paypal ' ,
143- ]
147+ ],
148+ 'isVisibleOnProductPage ' => 0
144149 ]
145150 ]
146151];
Original file line number Diff line number Diff line change @@ -24,7 +24,11 @@ define([
2424 customer = customerData . get ( 'customer' ) ;
2525
2626 this . _super ( ) ;
27- this . renderPayPalButtons ( element ) ;
27+
28+ if ( config . clientConfig . isVisibleOnProductPage ) {
29+ this . renderPayPalButtons ( element ) ;
30+ }
31+
2832 this . declinePayment = ! customer ( ) . firstname && ! cart ( ) . isGuestCheckoutAllowed ;
2933
3034 return this ;
You can’t perform that action at this time.
0 commit comments