Update the price info, create helper util

This commit is contained in:
Narek Zakarian 2024-11-25 19:00:21 +04:00
parent 06e74e74f4
commit e2092d23f0
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7
5 changed files with 145 additions and 41 deletions

View file

@ -1,8 +1,9 @@
import BadgeBox, { BADGE_BOX_TITLE_BIG } from "../BadgeBox";
import { __, sprintf } from '@wordpress/i18n';
import Separator from '../Separator';
import generatePriceText from '../../../utils/badgeBoxUtils';
const BcdcFlow = ( { isPayLater, storeCountry } ) => {
const BcdcFlow = ( { isPayLater, storeCountry, storeCurrency, countryPriceInfo } ) => {
if (isPayLater && storeCountry === 'us') {
return (
<div className="ppcp-r-welcome-docs__wrapper">
@ -80,7 +81,7 @@ const BcdcFlow = ( { isPayLater, storeCountry } ) => {
<BadgeBox
title={__('Credit and Debit Cards', 'woocommerce-paypal-payments')}
imageBadge={['icon-button-visa.svg', 'icon-button-mastercard.svg', 'icon-button-amex.svg', 'icon-button-discover.svg']}
textBadge={__('from 2.59% + $0.49 USD<sup>1</sup>', 'woocommerce-paypal-payments')}
textBadge={__('from 2.99% + $0.49 USD<sup>1</sup>', 'woocommerce-paypal-payments')}
description={sprintf(
// translators: %s: Link to PayPal REST application guide
__(
@ -100,7 +101,7 @@ const BcdcFlow = ( { isPayLater, storeCountry } ) => {
<BadgeBox
title={__('PayPal Checkout', 'woocommerce-paypal-payments')}
titleType={BADGE_BOX_TITLE_BIG}
textBadge={__('from 3.40% + €0.35 EUR<sup>1</sup>', 'woocommerce-paypal-payments')}
textBadge={generatePriceText('checkout', countryPriceInfo[storeCountry], storeCurrency)}
description={__(
'Our all-in-one checkout solution lets you offer PayPal, Venmo, Pay Later options, and more to help maximise conversion',
'woocommerce-paypal-payments'
@ -143,7 +144,7 @@ const BcdcFlow = ( { isPayLater, storeCountry } ) => {
<BadgeBox
title={__('Credit and Debit Cards', 'woocommerce-paypal-payments')}
imageBadge={['icon-button-visa.svg', 'icon-button-mastercard.svg', 'icon-button-amex.svg', 'icon-button-discover.svg']}
textBadge={__('from 3.40% + €0.35 EUR<sup>1</sup>', 'woocommerce-paypal-payments')}
textBadge={generatePriceText('standardCardFields', countryPriceInfo[storeCountry], storeCurrency)}
description={sprintf(
// translators: %s: Link to PayPal REST application guide
__(