Commit d557c9ecb94 for woocommerce
commit d557c9ecb94af23a7c136d306106f00dce7a6653
Author: Mayisha <33387139+Mayisha@users.noreply.github.com>
Date: Wed Mar 4 00:48:08 2026 +0600
PayPal Standard: Update logo on classic checkout (#63196)
* move paypal info link to description
* use same icon as block checkout
* open lint in new tab
* deprecate the old method
* Add changefile(s) from automation for the following project(s): woocommerce
* add docblock
* fix icon size
* ensure paypal icon styles are applied across all theme
diff --git a/plugins/woocommerce/changelog/63196-update-paypal-standard-logo-classic-checkout b/plugins/woocommerce/changelog/63196-update-paypal-standard-logo-classic-checkout
new file mode 100644
index 00000000000..c40083975f4
--- /dev/null
+++ b/plugins/woocommerce/changelog/63196-update-paypal-standard-logo-classic-checkout
@@ -0,0 +1,4 @@
+Significance: patch
+Type: tweak
+
+Update PayPal Standard logo on classic checkout.
\ No newline at end of file
diff --git a/plugins/woocommerce/client/legacy/css/twenty-twenty-three.scss b/plugins/woocommerce/client/legacy/css/twenty-twenty-three.scss
index 0eed0c22079..48ed301d374 100644
--- a/plugins/woocommerce/client/legacy/css/twenty-twenty-three.scss
+++ b/plugins/woocommerce/client/legacy/css/twenty-twenty-three.scss
@@ -842,6 +842,14 @@ ul.wc-tabs {
}
}
+ // PayPal logo in payment list on classic checkout page, more specific selector for precedence over general theme styles.
+ ul.wc_payment_methods li.payment_method_paypal img {
+ max-height: 24px;
+ vertical-align: middle;
+ float: right;
+ margin: 0;
+ }
+
// Layout of the checkout: Billing vs Shipping address, Cart overview, etc.
.woocommerce-checkout,
&.woocommerce-order-pay {
diff --git a/plugins/woocommerce/client/legacy/css/twenty-twenty-two.scss b/plugins/woocommerce/client/legacy/css/twenty-twenty-two.scss
index 6ef33313adc..7afd67191bf 100644
--- a/plugins/woocommerce/client/legacy/css/twenty-twenty-two.scss
+++ b/plugins/woocommerce/client/legacy/css/twenty-twenty-two.scss
@@ -970,6 +970,14 @@ ul.wc-tabs {
}
}
+ // PayPal logo in payment methods list on classic checkout page, more specific selector for precedence over general theme styles.
+ ul.wc_payment_methods li.payment_method_paypal img {
+ max-height: 24px;
+ vertical-align: middle;
+ float: right;
+ margin: 0;
+ }
+
.woocommerce-thankyou-order-received {
margin-top: 0;
}
diff --git a/plugins/woocommerce/client/legacy/css/woocommerce.scss b/plugins/woocommerce/client/legacy/css/woocommerce.scss
index 540ab2dcd93..b72a8e1d409 100644
--- a/plugins/woocommerce/client/legacy/css/woocommerce.scss
+++ b/plugins/woocommerce/client/legacy/css/woocommerce.scss
@@ -2084,6 +2084,16 @@ p.demo_store,
}
}
+ // PayPal logo in payment methods list on classic checkout page, more specific selector for precedence over general theme styles.
+ li.payment_method_paypal {
+ img {
+ max-height: 24px;
+ vertical-align: middle;
+ float: right;
+ margin: 0;
+ }
+ }
+
li:not(.woocommerce-notice) {
@include clearfix;
}
@@ -2227,8 +2237,9 @@ p.demo_store,
}
img {
- max-height: 52px;
+ max-height: 24px;
vertical-align: middle;
+ float: right;
}
}
}
diff --git a/plugins/woocommerce/includes/gateways/paypal/class-wc-gateway-paypal.php b/plugins/woocommerce/includes/gateways/paypal/class-wc-gateway-paypal.php
index 5488f67047f..a31d8e5952f 100644
--- a/plugins/woocommerce/includes/gateways/paypal/class-wc-gateway-paypal.php
+++ b/plugins/woocommerce/includes/gateways/paypal/class-wc-gateway-paypal.php
@@ -185,8 +185,8 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
self::$log_enabled = $this->debug;
if ( $this->testmode ) {
- /* translators: %s: Link to PayPal sandbox testing guide page */
- $this->description .= '<br>' . sprintf( __( '<strong>Sandbox mode enabled</strong>. Only sandbox test accounts can be used. See the <a href="%s">PayPal Sandbox Testing Guide</a> for more details.', 'woocommerce' ), 'https://developer.paypal.com/tools/sandbox/' );
+ /* translators: 1: Link to PayPal sandbox testing guide page, 2: Link to PayPal info page */
+ $this->description .= '<br>' . sprintf( __( '<strong>Sandbox mode enabled</strong>. Only sandbox test accounts can be used. See the <a href="%1$s">PayPal Sandbox Testing Guide</a> for more details. <a href="%2$s" target="_blank">What is PayPal?</a>', 'woocommerce' ), 'https://developer.paypal.com/tools/sandbox/', esc_url( 'https://www.paypal.com/digital-wallet/how-paypal-works' ) );
$this->description = trim( $this->description );
}
@@ -414,19 +414,8 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
* @return string
*/
public function get_icon() {
- // We need a base country for the link to work, bail if in the unlikely event no country is set.
- $base_country = WC()->countries->get_base_country();
- if ( empty( $base_country ) ) {
- return '';
- }
- $icon_html = '';
- $icon = (array) $this->get_icon_image( $base_country );
-
- foreach ( $icon as $i ) {
- $icon_html .= '<img src="' . esc_attr( $i ) . '" alt="' . esc_attr__( 'PayPal acceptance mark', 'woocommerce' ) . '" />';
- }
-
- $icon_html .= sprintf( '<a href="%1$s" class="about_paypal" onclick="javascript:window.open(\'%1$s\',\'WIPaypal\',\'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1060, height=700\'); return false;">' . esc_attr__( 'What is PayPal?', 'woocommerce' ) . '</a>', esc_url( $this->get_icon_url( $base_country ) ) );
+ $icon = $this->get_paypal_icon_image();
+ $icon_html = '<img src="' . esc_attr( $icon ) . '" alt="' . esc_attr__( 'PayPal acceptance mark', 'woocommerce' ) . '" />';
return apply_filters( 'woocommerce_gateway_icon', $icon_html, $this->id );
}
@@ -451,13 +440,33 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
}
}
+ /**
+ * Get PayPal icon image.
+ *
+ * @return string The PayPal icon image.
+ */
+ protected function get_paypal_icon_image() {
+ $icon = WC_HTTPS::force_https_url( WC()->plugin_url() . '/assets/images/paypal.png' );
+
+ /**
+ * Filters the PayPal icon image.
+ *
+ * @param string $icon The PayPal icon image.
+ * @return string The PayPal icon image.
+ * @since 10.6.0
+ */
+ return apply_filters( 'woocommerce_paypal_icon', $icon );
+ }
+
/**
* Get PayPal images for a country.
*
* @param string $country Country code.
* @return array of image URLs
+ * @deprecated 10.6.0 Use get_paypal_icon_image() instead.
*/
protected function get_icon_image( $country ) {
+ wc_deprecated_function( __METHOD__, '10.6.0', 'get_paypal_icon_image()' );
switch ( $country ) {
case 'US':
case 'NZ':