mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
✨ Always show smart buttons in ‘preview’ context
This commit is contained in:
parent
e9e94e277c
commit
71c19d8034
2 changed files with 14 additions and 3 deletions
|
@ -7,6 +7,7 @@ import {
|
|||
handleShippingOptionsChange,
|
||||
handleShippingAddressChange,
|
||||
} from '../Helper/ShippingHandler.js';
|
||||
import { PaymentContext } from '../Helper/CheckoutMethodState';
|
||||
|
||||
class Renderer {
|
||||
constructor(
|
||||
|
@ -35,6 +36,10 @@ class Renderer {
|
|||
* @return {boolean} True, if smart buttons are present on the page.
|
||||
*/
|
||||
get useSmartButtons() {
|
||||
if ( PaymentContext.Preview === this.defaultSettings?.context ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const components = this.defaultSettings?.url_params?.components || '';
|
||||
|
||||
return components.split( ',' ).includes( 'buttons' );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue