diff --git a/changelog.txt b/changelog.txt index 2a733cac4..55d71ac49 100644 --- a/changelog.txt +++ b/changelog.txt @@ -15,6 +15,8 @@ * Enhancement - Require PHP 7.4+, WP 6.3+, WC 6.9+ #2556 * Enhancement - Modularity module migration #1944 * Enhancement - Keep only 5 tags in readme.txt #2562 +* Enhancement - Select ACDC by default during onboarding for China store locations #2619 +* Enhancement - Add title, description and gatewayId to the express payment method #2566 = 2.9.0 - 2024-09-02 = * Fix - Fatal error in Block Editor when using WooCommerce blocks #2534 diff --git a/modules/ppcp-blocks/package.json b/modules/ppcp-blocks/package.json index 3398edd5e..1f18f48e2 100644 --- a/modules/ppcp-blocks/package.json +++ b/modules/ppcp-blocks/package.json @@ -19,6 +19,7 @@ "@babel/core": "^7.19", "@babel/preset-env": "^7.19", "@babel/preset-react": "^7.18.6", + "@wordpress/i18n": "^5.6.0", "@woocommerce/dependency-extraction-webpack-plugin": "2.2.0", "babel-loader": "^8.2", "cross-env": "^7.0.3", diff --git a/modules/ppcp-blocks/resources/js/checkout-block.js b/modules/ppcp-blocks/resources/js/checkout-block.js index d1b6ad990..a8455b2fd 100644 --- a/modules/ppcp-blocks/resources/js/checkout-block.js +++ b/modules/ppcp-blocks/resources/js/checkout-block.js @@ -3,6 +3,7 @@ import { registerExpressPaymentMethod, registerPaymentMethod, } from '@woocommerce/blocks-registry'; +import { __ } from '@wordpress/i18n'; import { mergeWcAddress, paypalAddressToWc, @@ -774,6 +775,12 @@ if ( block_enabled && config.enabled ) { ] ) { registerExpressPaymentMethod( { name: `${ config.id }-${ fundingSource }`, + title: 'PayPal', + description: __( + 'Eligible users will see the PayPal button.', + 'woocommerce-paypal-payments' + ), + gatewayId: 'ppcp-gateway', paymentMethodId: config.id, label: (
diff --git a/modules/ppcp-googlepay/package.json b/modules/ppcp-googlepay/package.json index c5b05bade..e302398f1 100644 --- a/modules/ppcp-googlepay/package.json +++ b/modules/ppcp-googlepay/package.json @@ -17,6 +17,7 @@ "@babel/core": "^7.19", "@babel/preset-env": "^7.19", "@babel/preset-react": "^7.18.6", + "@wordpress/i18n": "^5.6.0", "@woocommerce/dependency-extraction-webpack-plugin": "^2.2.0", "babel-loader": "^8.2", "cross-env": "^7.0.3", diff --git a/modules/ppcp-googlepay/resources/js/boot-block.js b/modules/ppcp-googlepay/resources/js/boot-block.js index 861fda98c..6e39350a6 100644 --- a/modules/ppcp-googlepay/resources/js/boot-block.js +++ b/modules/ppcp-googlepay/resources/js/boot-block.js @@ -3,6 +3,7 @@ import { registerExpressPaymentMethod, registerPaymentMethod, } from '@woocommerce/blocks-registry'; +import { __ } from '@wordpress/i18n'; import { loadPaypalScript } from '../../../ppcp-button/resources/js/modules/Helper/ScriptLoading'; import GooglepayManager from './GooglepayManager'; import { loadCustomScript } from '@paypal/paypal-js'; @@ -58,6 +59,12 @@ const features = [ 'products' ]; registerExpressPaymentMethod( { name: buttonData.id, + title: `PayPal - ${ buttonData.title }`, + description: __( + 'Eligible users will see the PayPal button.', + 'woocommerce-paypal-payments' + ), + gatewayId: 'ppcp-gateway', label:
, content: , edit: , diff --git a/modules/ppcp-googlepay/src/Assets/Button.php b/modules/ppcp-googlepay/src/Assets/Button.php index 575def21f..43f783675 100644 --- a/modules/ppcp-googlepay/src/Assets/Button.php +++ b/modules/ppcp-googlepay/src/Assets/Button.php @@ -431,10 +431,20 @@ class Button implements ButtonInterface { * @return array */ public function script_data(): array { + $use_shipping_form = $this->settings->has( 'googlepay_button_shipping_enabled' ) && $this->settings->get( 'googlepay_button_shipping_enabled' ); + + // On the product page, only show the shipping form for physical products. + $context = $this->context(); + if ( $use_shipping_form && 'product' === $context ) { + $product = wc_get_product(); + + if ( ! $product || $product->is_downloadable() || $product->is_virtual() ) { + $use_shipping_form = false; + } + } + $shipping = array( - 'enabled' => $this->settings->has( 'googlepay_button_shipping_enabled' ) - ? boolval( $this->settings->get( 'googlepay_button_shipping_enabled' ) ) - : false, + 'enabled' => $use_shipping_form, 'configured' => wc_shipping_enabled() && wc_get_shipping_method_count( false, true ) > 0, ); diff --git a/readme.txt b/readme.txt index 81924ee66..0813aa65e 100644 --- a/readme.txt +++ b/readme.txt @@ -194,6 +194,8 @@ If you encounter issues with the PayPal buttons not appearing after an update, p * Enhancement - Require PHP 7.4+, WP 6.3+, WC 6.9+ #2556 * Enhancement - Modularity module migration #1944 * Enhancement - Keep only 5 tags in readme.txt #2562 +* Enhancement - Select ACDC by default during onboarding for China store locations #2619 +* Enhancement - Add title, description and gatewayId to the express payment method #2566 = 2.9.0 - 2024-09-02 = * Fix - Fatal error in Block Editor when using WooCommerce blocks #2534