mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
🔀 Merge branch 'trunk' & resolve conflicts
# Conflicts: # modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/FeatureSettingsBlock.js # modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Overview/Features.js
This commit is contained in:
commit
a582b256d8
4 changed files with 389 additions and 252 deletions
|
@ -46,6 +46,15 @@ const FeatureSettingsBlock = ( { title, description, ...props } ) => {
|
||||||
return <Button { ...buttonProps }>{ text }</Button>;
|
return <Button { ...buttonProps }>{ text }</Button>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const renderDescription = () => {
|
||||||
|
return (
|
||||||
|
<span
|
||||||
|
className="ppcp-r-feature-item__description ppcp-r-settings-block__feature__description"
|
||||||
|
dangerouslySetInnerHTML={ { __html: description } }
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingsBlock { ...props } className="ppcp-r-settings-block__feature">
|
<SettingsBlock { ...props } className="ppcp-r-settings-block__feature">
|
||||||
<Header>
|
<Header>
|
||||||
|
@ -56,7 +65,7 @@ const FeatureSettingsBlock = ( { title, description, ...props } ) => {
|
||||||
) }
|
) }
|
||||||
</Title>
|
</Title>
|
||||||
<Description className="ppcp-r-settings-block__feature__description">
|
<Description className="ppcp-r-settings-block__feature__description">
|
||||||
{ description }
|
{ renderDescription() }
|
||||||
{ printNotes() }
|
{ printNotes() }
|
||||||
</Description>
|
</Description>
|
||||||
</Header>
|
</Header>
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { TAB_IDS, selectTab } from '../../../../../utils/tabSelector';
|
import { TAB_IDS, selectTab } from '../../../../../utils/tabSelector';
|
||||||
|
import { payLaterMessagingComponentData } from '../../../../../data/settings/pay-later-messaging-component-data';
|
||||||
|
|
||||||
export const getFeatures = ( setActiveModal ) => [
|
export const getFeatures = ( setActiveModal ) => {
|
||||||
|
const storeCountry = ppcpSettings?.storeCountry;
|
||||||
|
const features = [
|
||||||
{
|
{
|
||||||
id: 'save_paypal_and_venmo',
|
id: 'save_paypal_and_venmo',
|
||||||
title: __( 'Save PayPal and Venmo', 'woocommerce-paypal-payments' ),
|
title: __( 'Save PayPal and Venmo', 'woocommerce-paypal-payments' ),
|
||||||
|
@ -38,7 +41,10 @@ export const getFeatures = ( setActiveModal ) => [
|
||||||
{
|
{
|
||||||
type: 'tertiary',
|
type: 'tertiary',
|
||||||
text: __( 'Learn more', 'woocommerce-paypal-payments' ),
|
text: __( 'Learn more', 'woocommerce-paypal-payments' ),
|
||||||
url: 'https://developer.paypal.com/studio/checkout/standard',
|
urls: {
|
||||||
|
sandbox: '#',
|
||||||
|
live: '#',
|
||||||
|
},
|
||||||
class: 'small-button',
|
class: 'small-button',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -168,7 +174,10 @@ export const getFeatures = ( setActiveModal ) => [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
notes: [
|
notes: [
|
||||||
__( '¹PayPal Q2 Earnings-2021.', 'woocommerce-paypal-payments' ),
|
__(
|
||||||
|
'¹PayPal Q2 Earnings-2021.',
|
||||||
|
'woocommerce-paypal-payments'
|
||||||
|
),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -226,7 +235,16 @@ export const getFeatures = ( setActiveModal ) => [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
];
|
||||||
|
|
||||||
|
const countryData = payLaterMessagingComponentData[ storeCountry ] || {};
|
||||||
|
|
||||||
|
// Add "Pay Later Messaging" to the feature list, if it's available.
|
||||||
|
if (
|
||||||
|
!! window.ppcpSettings?.isPayLaterConfiguratorAvailable &&
|
||||||
|
countryData
|
||||||
|
) {
|
||||||
|
features.push( {
|
||||||
id: 'pay_later_messaging',
|
id: 'pay_later_messaging',
|
||||||
title: __( 'Pay Later Messaging', 'woocommerce-paypal-payments' ),
|
title: __( 'Pay Later Messaging', 'woocommerce-paypal-payments' ),
|
||||||
description: __(
|
description: __(
|
||||||
|
@ -265,5 +283,8 @@ export const getFeatures = ( setActiveModal ) => [
|
||||||
class: 'small-button',
|
class: 'small-button',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
} );
|
||||||
];
|
}
|
||||||
|
|
||||||
|
return features;
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,106 @@
|
||||||
|
import { __, sprintf } from '@wordpress/i18n';
|
||||||
|
|
||||||
|
export const payLaterMessagingComponentData = {
|
||||||
|
US: {
|
||||||
|
description: sprintf(
|
||||||
|
__(
|
||||||
|
'Your customers can already buy now and pay later with PayPal — add messaging to your site to let them know. PayPal’s Pay Later helps boost merchants\' conversion rates and increases cart sizes by 39%%.¹ You get paid in full up front. <a target="_blank" href="%s">More about Pay Later</a>',
|
||||||
|
'woocommerce-paypal-payments'
|
||||||
|
),
|
||||||
|
'https://www.paypal.com/us/business/accept-payments/checkout/installments'
|
||||||
|
),
|
||||||
|
notes: [
|
||||||
|
__( '¹PayPal Q2 Earnings-2021.', 'woocommerce-paypal-payments' ),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
GB: {
|
||||||
|
description: sprintf(
|
||||||
|
__(
|
||||||
|
'Your customers can already buy now and pay later with PayPal — add messaging to your site to let them know. Pay in 3 gets a 216%% higher Average Order Value than a standard PayPal transaction.¹ There’s <strong>no extra cost</strong> and you get paid up front. <a target="_blank" href="%s">More about Pay in 3</a>',
|
||||||
|
'woocommerce-paypal-payments'
|
||||||
|
),
|
||||||
|
'https://www.paypal.com/uk/business/accept-payments/checkout/installments'
|
||||||
|
),
|
||||||
|
notes: [
|
||||||
|
__(
|
||||||
|
'Based on PayPal internal data from Q1 2022, results include Pay in 3 (UK).',
|
||||||
|
'woocommerce-paypal-payments'
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
FR: {
|
||||||
|
description: sprintf(
|
||||||
|
__(
|
||||||
|
'Your customers can already buy now and pay later with PayPal — add messaging to your site to let them know. Pay in 4x gets a 65%% higher Average Order Value than a standard PayPal transaction.¹ <strong>There\'s no extra cost on top of your PayPal Checkout rate</strong>, and you get paid up front. <a target="_blank" href="%s">More about Pay in 4x</a>',
|
||||||
|
'woocommerce-paypal-payments'
|
||||||
|
),
|
||||||
|
'https://www.paypal.com/fr/business/accept-payments/checkout/installments'
|
||||||
|
),
|
||||||
|
notes: [
|
||||||
|
__(
|
||||||
|
'Internal Data Analysis of 1124 SMB across integrated partners and non-integrated partners, November 2022. SMB internally defined as up to 100,000€ in annual estimated ecommerce online payment volume.',
|
||||||
|
'woocommerce-paypal-payments'
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
AU: {
|
||||||
|
description: sprintf(
|
||||||
|
__(
|
||||||
|
'Your customers can already buy now and pay later with PayPal — add messaging to your site to let them know. Pay in 4 gets more than a 100%% higher Average Order Value than a standard PayPal transaction.¹ There’s <strong>no extra cost</strong> and you get paid up front. <a target="_blank" href="%s">More about Pay in 4</a>',
|
||||||
|
'woocommerce-paypal-payments'
|
||||||
|
),
|
||||||
|
'https://www.paypal.com/au/business/accept-payments/checkout/installments'
|
||||||
|
),
|
||||||
|
notes: [
|
||||||
|
__(
|
||||||
|
'Based on PayPal internal data from Q1 2022, results include Pay in 4 (AU). Consumer eligibility applies.',
|
||||||
|
'woocommerce-paypal-payments'
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
IT: {
|
||||||
|
description: sprintf(
|
||||||
|
__(
|
||||||
|
'Your customers can already buy now and pay later with PayPal — add messaging to your site to let them know. Pay in 3 installments gets about a 275%% higher Average Order Value than a standard PayPal transaction.¹ <strong>There\'s no extra cost on top of your PayPal Checkout rate</strong>, and you get paid up front. <a target="_blank" href="%s">More about Pay in 3 installments</a>',
|
||||||
|
'woocommerce-paypal-payments'
|
||||||
|
),
|
||||||
|
'https://www.paypal.com/it/business/accept-payments/checkout/installments'
|
||||||
|
),
|
||||||
|
notes: [
|
||||||
|
__(
|
||||||
|
'Based on PayPal internal data from Q1 2022, results include Pay in 3 installments (IT).',
|
||||||
|
'woocommerce-paypal-payments'
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
ES: {
|
||||||
|
description: sprintf(
|
||||||
|
__(
|
||||||
|
'Your customers can already buy now and pay later with PayPal — add messaging to your site to let them know. Pay in 3 installments gets about a 275%% higher Average Order Value than a standard PayPal transaction.¹ <strong>There\'s no extra cost on top of your PayPal Checkout rate</strong>, and you get paid up front. <a target="_blank" href="%s">More about Pay in 3 installments</a>',
|
||||||
|
'woocommerce-paypal-payments'
|
||||||
|
),
|
||||||
|
'https://www.paypal.com/es/business/accept-payments/checkout/installments'
|
||||||
|
),
|
||||||
|
notes: [
|
||||||
|
__(
|
||||||
|
'Based on PayPal internal data from Q1 2022, results include Pay in 3 installments (ES).',
|
||||||
|
'woocommerce-paypal-payments'
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
DE: {
|
||||||
|
description: sprintf(
|
||||||
|
__(
|
||||||
|
'Your customers can already buy now and pay later with PayPal — add messaging to your site to let them know. When you offer your customers Pay Later options, 57%% will be more likely to buy from you again.¹ <strong>There\'s no extra cost</strong> and you get paid up front. <a target="_blank" href="%s">More about Pay Later</a>',
|
||||||
|
'woocommerce-paypal-payments'
|
||||||
|
),
|
||||||
|
'https://www.paypal.com/de/business/accept-payments/checkout/installments'
|
||||||
|
),
|
||||||
|
notes: [
|
||||||
|
__(
|
||||||
|
'Average order value in 2020 with PayPal installments compared to total PayPal sales.',
|
||||||
|
'woocommerce-paypal-payments'
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
|
@ -185,6 +185,7 @@ class SettingsModule implements ServiceModule, ExecutableModule {
|
||||||
'wcPaymentsTabUrl' => admin_url( 'admin.php?page=wc-settings&tab=checkout' ),
|
'wcPaymentsTabUrl' => admin_url( 'admin.php?page=wc-settings&tab=checkout' ),
|
||||||
'debug' => defined( 'WP_DEBUG' ) && WP_DEBUG,
|
'debug' => defined( 'WP_DEBUG' ) && WP_DEBUG,
|
||||||
'isPayLaterConfiguratorAvailable' => $is_pay_later_configurator_available,
|
'isPayLaterConfiguratorAvailable' => $is_pay_later_configurator_available,
|
||||||
|
'storeCountry' => $container->get( 'wcgateway.store-country' ),
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( $is_pay_later_configurator_available ) {
|
if ( $is_pay_later_configurator_available ) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue