Skip to content

Commit af7e120

Browse files
committed
fix: add hide logo option to Apple/Google Pay
Add missing 'Hide Logo' checkbox to Apple/Google Pay settings to ensure consistency with all other payment methods. Also simplified the title logic for better readability: - If hide_title enabled: empty string - Else: use saved title or default to 'Apple Pay / Google Pay' All payment methods now have consistent hide_title and hide_logo options.
1 parent 3f3315d commit af7e120

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

includes/admin/monei-apple-google-settings.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@
4848
'description' => __( 'Hide payment method title in the checkout, showing only the logo.', 'monei' ),
4949
'desc_tip' => true,
5050
),
51+
'hide_logo' => array(
52+
'title' => __( 'Hide Logo', 'monei' ),
53+
'type' => 'checkbox',
54+
'label' => __( 'Hide payment method logo', 'monei' ),
55+
'default' => 'no',
56+
'description' => __( 'Hide payment method logo in the checkout.', 'monei' ),
57+
'desc_tip' => true,
58+
),
5159
'payment_request_style' => array(
5260
'title' => __( 'Apple Pay / Google Pay Style', 'monei' ),
5361
'type' => 'textarea',

src/Gateways/PaymentMethods/WCGatewayMoneiAppleGoogle.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@ public function __construct(
6161
$this->id = 'monei_apple_google';
6262
$this->method_title = __( 'MONEI - Apple/Google', 'monei' );
6363
$hide_title = ( ! empty( $this->get_option( 'hide_title' ) && 'yes' === $this->get_option( 'hide_title' ) ) ) ? true : false;
64-
$this->title = ( ! $hide_title && ! empty( $this->get_option( 'title' ) ) ) ? $this->get_option( 'title' ) : ( $hide_title ? '' : __( 'Apple Pay / Google Pay', 'monei' ) );
64+
$default_title = __( 'Apple Pay / Google Pay', 'monei' );
65+
$saved_title = $this->get_option( 'title' );
66+
$this->title = $hide_title ? '' : ( ! empty( $saved_title ) ? $saved_title : $default_title );
6567
$this->description = ( ! empty( $this->get_option( 'description' ) ) ) ? $this->get_option( 'description' ) : '';
68+
$this->hide_logo = ( ! empty( $this->get_option( 'hide_logo' ) && 'yes' === $this->get_option( 'hide_logo' ) ) ) ? true : false;
6669
$iconUrl = apply_filters( 'woocommerce_monei_icon', WC_Monei()->image_url( 'google-logo.svg' ) );
6770
$iconMarkup = '<img src="' . $iconUrl . '" alt="MONEI" class="monei-icons" />';
6871
$this->testmode = $this->getTestmode();

0 commit comments

Comments
 (0)