From beb6a6f4c7e850fb7c715c186de9e95599a70333 Mon Sep 17 00:00:00 2001 From: Matt Sherman Date: Wed, 7 Sep 2022 09:33:12 -0400 Subject: [PATCH] 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. --- .../products/sections/pricing-section.tsx | 23 +++++++++++-------- .../fix-products-pricing-tax-included-label | 4 ++++ 2 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 plugins/woocommerce/changelog/fix-products-pricing-tax-included-label diff --git a/plugins/woocommerce-admin/client/products/sections/pricing-section.tsx b/plugins/woocommerce-admin/client/products/sections/pricing-section.tsx index b24e93d9dc6..a68a6508d2f 100644 --- a/plugins/woocommerce-admin/client/products/sections/pricing-section.tsx +++ b/plugins/woocommerce-admin/client/products/sections/pricing-section.tsx @@ -63,16 +63,19 @@ export const PricingSection: React.FC = () => { return cleanValue; }; - const taxSettingsText = - 'Per your {{link}}store settings{{/link}}, tax is {{strong}}%sincluded{{/strong}} in the price.'; - const addNot = pricesIncludeTax ? '' : 'not '; - taxSettingsText.replace( taxSettingsText, addNot ); + const taxIncludedInPriceText = __( + 'Per your {{link}}store settings{{/link}}, tax is {{strong}}included{{/strong}} in the price.', + 'woocommerce' + ); + const taxNotIncludedInPriceText = __( + 'Per your {{link}}store settings{{/link}}, tax is {{strong}}not included{{/strong}} in the price.', + 'woocommerce' + ); const taxSettingsElement = interpolateComponents( { - mixedString: __( - 'Per your {{link}}store settings{{/link}}, tax is {{strong}}not included{{/strong}} in the price.', - 'woocommerce' - ), + mixedString: pricesIncludeTax + ? taxIncludedInPriceText + : taxNotIncludedInPriceText, components: { link: ( { target="_blank" type="external" onClick={ () => { - recordEvent( 'product_pricing_list_price_help' ); + recordEvent( + 'product_pricing_list_price_help_tax_settings_click' + ); } } > <> diff --git a/plugins/woocommerce/changelog/fix-products-pricing-tax-included-label b/plugins/woocommerce/changelog/fix-products-pricing-tax-included-label new file mode 100644 index 00000000000..76ea75485ff --- /dev/null +++ b/plugins/woocommerce/changelog/fix-products-pricing-tax-included-label @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +Fix product list price help label to properly reflect tax settings.