Fix product list price help label to properly reflect tax settings (#34564)

* Fix product list price tax included help label

* Add changelog entry for products list price help label.
This commit is contained in:
Matt Sherman 2022-09-07 09:33:12 -04:00 committed by GitHub
parent 966cff5e7a
commit beb6a6f4c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 9 deletions

View File

@ -63,16 +63,19 @@ export const PricingSection: React.FC = () => {
return cleanValue; return cleanValue;
}; };
const taxSettingsText = const taxIncludedInPriceText = __(
'Per your {{link}}store settings{{/link}}, tax is {{strong}}%sincluded{{/strong}} in the price.'; 'Per your {{link}}store settings{{/link}}, tax is {{strong}}included{{/strong}} in the price.',
const addNot = pricesIncludeTax ? '' : 'not '; 'woocommerce'
taxSettingsText.replace( taxSettingsText, addNot ); );
const taxNotIncludedInPriceText = __(
'Per your {{link}}store settings{{/link}}, tax is {{strong}}not included{{/strong}} in the price.',
'woocommerce'
);
const taxSettingsElement = interpolateComponents( { const taxSettingsElement = interpolateComponents( {
mixedString: __( mixedString: pricesIncludeTax
'Per your {{link}}store settings{{/link}}, tax is {{strong}}not included{{/strong}} in the price.', ? taxIncludedInPriceText
'woocommerce' : taxNotIncludedInPriceText,
),
components: { components: {
link: ( link: (
<Link <Link
@ -80,7 +83,9 @@ export const PricingSection: React.FC = () => {
target="_blank" target="_blank"
type="external" type="external"
onClick={ () => { onClick={ () => {
recordEvent( 'product_pricing_list_price_help' ); recordEvent(
'product_pricing_list_price_help_tax_settings_click'
);
} } } }
> >
<></> <></>

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
Fix product list price help label to properly reflect tax settings.