Always show smart buttons in ‘preview’ context

This commit is contained in:
Philipp Stracker 2024-11-29 11:59:48 +01:00
parent e9e94e277c
commit 71c19d8034
No known key found for this signature in database
2 changed files with 14 additions and 3 deletions

View file

@ -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' );