♻️ Replace generatePriceText with custom component

This commit is contained in:
Philipp Stracker 2024-12-12 16:55:19 +01:00
parent a3b68aae14
commit e59ae23c43
No known key found for this signature in database
8 changed files with 159 additions and 125 deletions

View file

@ -1,18 +0,0 @@
import { __ } from '@wordpress/i18n';
const generatePriceText = ( type, selectedCountryPrice, storeCurrency ) => {
if ( ! selectedCountryPrice || ! selectedCountryPrice[ type ] ) {
console.warn( `Invalid type or price data for: ${ type }` );
return '';
}
const percentage = selectedCountryPrice[ type ].toFixed( 2 );
const fixedFee = `${ selectedCountryPrice.currencySymbol }${ selectedCountryPrice.fixedFee }`;
return __(
`from ${ percentage }% + ${ fixedFee } ${ storeCurrency }<sup>1</sup>`,
'woocommerce-paypal-payments'
);
};
export default generatePriceText;